Skip to content

[CUDA] Cannot find libdevice when compiling files in non-C drive #5028

Closed
@yuxianch

Description

@yuxianch

Describe the bug
Cannot find libdevice when compiling files with CUDA backend in non-C drive

To Reproduce
Supposing CUDA is installed in C drive, run the following command in non-C drive.

touch test.cpp
clang-cl /TP  -fsycl -fsycl-unnamed-lambda /EHsc -sycl-std=2020 -fsycl-targets=nvptx64-nvidia-cuda -std:c++17  -c test.cpp

It will show the following error:

clang-cl: error: cannot find libdevice for sm_50; provide path to different CUDA installation via '--cuda-path', or pass '-nocudalib' to build without linking with libdevice

If providing CUDA installation by "--cuda-path", then the error will be gone.

$ clang-cl /TP  -fsycl -fsycl-unnamed-lambda /EHsc -sycl-std=2020 -fsycl-targets=nvptx64-nvidia-cuda -std:c++17  -c test.cpp --cuda-path=C:/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.4
warning: linking module
      'path_of_compiler_build\lib\clang\14.0.0\../../clc\remangled-l32-signed_char.libspirv-nvptx64--nvidiacl.bc':
      Linking two modules of different target triples:
      'path_of_compiler_build\lib\clang\14.0.0\../../clc\remangled-l32-signed_char.libspirv-nvptx64--nvidiacl.bc'
      is 'nvptx64-unknown-nvidiacl' whereas 'test.cpp' is 'nvptx64-nvidia-cuda'
 [-Wlinker-warnings]
1 warning generated.

Environment (please complete the following information):

Cuda compilation tools, release 11.4, V11.4.120
Build cuda_11.4.r11.4/compiler.30300941_0

Additional context
This issue can be only be reproduced on non-C drive(where CUDA is installed).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcompilerCompiler related issuecudaCUDA back-end

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions