开发者

Locate CUDA installation on Linux

开发者 https://www.devze.com 2023-02-07 12:02 出处:网络
What\'s the best way? Here are my solutions: 开发者_JAVA百科echo $PATH | sed \"s/:/\\n/g\" | grep \"cuda/bin\" | sed \"s/\\/bin//g\" |head -n 1

What's the best way? Here are my solutions:

开发者_JAVA百科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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消