Find the CUDA installation on Linux

What is the best way? Here are my solutions:

echo $PATH | sed "s/:/\n/g" | grep "cuda/bin" | sed "s/\/bin//g" | head -n 1 which nvcc | sed "s/\/bin\/nvcc// which nvcc | head -c -10 

All of them are based on PATH. Instead, libraries could be found; this would be more reliable if PATH did not have CUDA paths.

I use this in a makefile.

+4
source share
1 answer

How ldconfig -p | grep libcuda based sound works ldconfig -p | grep libcuda ldconfig -p | grep libcuda ? Given that the corresponding setting ldconfig clearly reported at the end of the installation CUDA toolkit, it seems, should do the trick without a path.

+5
source

Source: https://habr.com/ru/post/1337250/


All Articles