Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Locate CUDA installation on Linux

What's 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

They are all PATH-based. One could locate libraries instead. It would be more robust if there are no CUDA paths in PATH.

I'm using this in a Makefile.

like image 720
Narcolessico Avatar asked Jan 27 '11 03:01

Narcolessico


1 Answers

How does something based onldconfig -p | grep libcuda sound ? Considering an appropriate ldconfig setup is explicitly advised at the end of the installation of the CUDA toolkit, it should do the trick without path nicely, I think.

like image 73
Francois G Avatar answered Nov 09 '22 02:11

Francois G