I follow the official guide to install cuda-toolkit on wsl2
- check the wsl kernel version and windows10 version
- install nvidia driver
- copy the following command to my shell
but when I finish, i try to use nvcc, it reports “Command ‘nvcc’ not found”
So can anyone gives me some suggestions?
so what was the output of running sudo apt-get -y install cuda-toolkit-12-3 ?
It all depends on whether this step was successful or not.
I think cuda-toolkit was installed successfully. But somehow it doesn’t work :(
You could check if subdirectories like
have been created. If so, there should be bin and lib subdirectories inside. These need to be in the PATH and LD_LIBRARY_PATH environment variables respectively.
This can be done in your ~/.bashrc script (assuming your Linux is using bash) with commands like
Thanks for your help! It turns out I just forgot to add “/usr/loca/cuda/bin” to $PATH.