CUDA steps on the pit
View CUDA version
When I want to check the version of CUDA, the following situation suddenly occurs:
This is not because the system does not have CUDA installed, but because the environment does not have it.
Notice:Do not execute apt install nvidia-cuda-toolkit
it, or it will reinstall a version.
Solution
Enter the bin directory
- First find the bin directory of cuda, for example:
/usr/local/cuda/bin
- Check if there is nvcc
add environment variable
$ export PATH=/usr/local/cuda/bin:$PATH
$ export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
Enter nvcc -V
the view again to display the version of CUDA