Closed
Description
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):
- OS: Windows
- Target device and vendor: Nvidia GPU
- DPC++ version: https://github.com/intel/llvm.git 2869ca7
- CUDA version:
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).