CUDALibrarySamples
CUDALibrarySamples copied to clipboard
cannot find -lcuda: No such file or directory
There exit error:
/root/anaconda3/envs/deepspeed/bin/../lib/gcc/x86_64-conda-linux-gnu/14.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: skipping incompatible /lib/i386-linux-gnu/libcuda.so when searching for -lcuda
/root/anaconda3/envs/deepspeed/bin/../lib/gcc/x86_64-conda-linux-gnu/14.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: cannot find -lcuda: No such file or directory
/root/anaconda3/envs/deepspeed/bin/../lib/gcc/x86_64-conda-linux-gnu/14.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: skipping incompatible /lib/i386-linux-gnu/libcuda.so when searching for -lcuda
Maybe something wrong in my cuda?
When I run the command ll /usr/local/cuda-12.1/:
total 144
drwxrwxrwx 17 root root 4096 10月 14 19:40 ./
drwxr-xr-x 16 root root 4096 10月 14 20:22 ../
drwxr-xr-x 3 root root 4096 10月 9 10:35 bin/
drwxr-xr-x 5 root root 4096 10月 9 10:34 compute-sanitizer/
-rw-r--r-- 1 root root 160 10月 9 10:35 DOCS
-rw-r--r-- 1 root root 61498 10月 9 10:35 EULA.txt
drwxr-xr-x 5 root root 4096 10月 9 10:35 extras/
drwxr-xr-x 6 root root 4096 10月 9 10:34 gds/
drwxr-xr-x 2 root root 4096 10月 9 10:34 gds-12.1/
lrwxrwxrwx 1 root root 50 10月 14 19:40 include -> /usr/local/cuda-12.1/targets/x86_64-linux/include//
lrwxrwxrwx 1 root root 46 10月 14 19:40 lib64 -> /usr/local/cuda-12.1/targets/x86_64-linux/lib//
drwxr-xr-x 7 root root 4096 10月 9 10:35 libnvvp/
drwxr-xr-x 7 root root 4096 10月 9 10:35 nsight-compute-2023.1.0/
drwxr-xr-x 2 root root 4096 10月 9 10:34 nsightee_plugins/
drwxr-xr-x 6 root root 4096 10月 9 10:35 nsight-systems-2023.1.2/
drwxr-xr-x 3 root root 4096 10月 9 10:34 nvml/
drwxr-xr-x 7 root root 4096 10月 9 10:35 nvvm/
-rw-r--r-- 1 root root 524 10月 9 10:35 README
drwxr-xr-x 3 root root 4096 10月 9 10:34 share/
drwxr-xr-x 2 root root 4096 10月 9 10:34 src/
drwxr-xr-x 3 root root 4096 10月 9 10:34 targets/
drwxr-xr-x 2 root root 4096 10月 9 10:35 tools/
-rw-r--r-- 1 root root 2928 10月 9 10:34 version.json
Is that right?
I have configured the environmental variable $CUDA_HOME as /usr/local/cuda-12.1
Hi @niebowen666,
Thank you for reaching out.
The ld linker has a search order that looks for libraries to link, and $CUDA_HOME doesn't alter that. If you want your compilation process to look for the libraries there, you should use -L flag accordingly (as documented here).