Building torchscript simple example with cuda yields 'cannot find -lcuda'

50 Views Asked by At

I'm trying to build a simple example following the given tutorial.

  • I have cuda-11.8 on my machine
  • I run things in a conda environment

When running things, I first encountered some errors and warning that I eventually fixed by using the following cmake command - ensuring the project was going to use the cuda lib from my machine :

cmake -DCMAKE_CUDA_COMPILER=/usr/local/cuda-11.8/bin/nvcc -DCMAKE_PREFIX_PATH=/usr/lib/libtorch -DCMAKE_C_COMPILER=gcc -DLIBNVTOOLSEXT=/usr/local/cuda-11.8/lib64/libnvToolsExt.so -DCUDA_NVRTC_LIB=/usr/local/cuda-11.8/lib64/libnvrtc.so ..

It runs fine without any warning. But when I run make, I get the following error:

/home/grybouilli/.conda/envs/lvs/bin/../lib/gcc/x86_64-conda-linux-gnu/11.2.0/../../../../x86_64-conda-linux-gnu/bin/ld: cannot find -lcuda: Aucun fichier ou dossier de ce type
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/loading-cell.dir/build.make:113 : loading-cell] Erreur 1
make[1]: *** [CMakeFiles/Makefile2:83 : CMakeFiles/loading-cell.dir/all] Erreur 2
make: *** [Makefile:91 : all] Erreur 2
0

There are 0 best solutions below