Reputation: 335
I was trying to run nvcc -V
to check cuda version but I got the following error message.
Command 'nvcc' not found, but can be installed with: sudo apt install nvidia-cuda-toolkit
But gpu acceleration is working fine for training models on cuda. Is there another way to find out cuda compiler tools version. I know nvidia-smi
doesn't give the right version.
Is there a way to install or configure nvcc. So I don't have to install a whole new toolkit.
Upvotes: 12
Views: 50882
Reputation: 335
As @pQB and @talonmies above mentioned you only need to install the GPU drivers (Versioned 430-470 these days) to use PyTorch. If you are using your GPU display port you should be fine.
For Cuda compilation tools you need to install the whole toolkit, which includes the driver as well. If installing manually from CLI the downloaded file, CLI will give you the option to choose the components to install or skip. Generally, it is recommended to install the compilation tools (which are system wide) and GPU drivers together because it avoids compatibility issues.
Upvotes: 2
Reputation: 1340
Most of the time, nvcc and other CUDA SDK binaries are not in the environment variable PATH. Check the installation path of CUDA; if it is installed under /usr/local/cuda
, add its bin folder to the PATH variable in your ~/.bashrc
:
export CUDA_HOME=/usr/local/cuda
export PATH=${CUDA_HOME}/bin:${PATH}
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:$LD_LIBRARY_PATH
You can apply the changes with source ~/.bashrc
, or the next time you log in, everything is set automatically.
Upvotes: 37