nguyenvulong / QA

The Unlicense
0 stars 0 forks source link

[nvidia] install cuda toolkit and drivers #73

Open nguyenvulong opened 10 months ago

nguyenvulong commented 10 months ago

Note: for a complete guide, refer to this https://github.com/nguyenvulong/QA/issues/75 If you just want it to work, read on

1. cuda toolkit

If you are a pytorch user (Source).

you don’t need to download a full CUDA toolkit and would only need to install a compatible NVIDIA driver, since PyTorch binaries ship with their own CUDA dependencies.

That means you do not need to install cuda toolkit system-wide. You only need to install cuda drivers in step 2 then proceed to step 3 to install pytorch.

Refer to this official guide from nvidia. Select suitable settings and install cuda toolkit, then look below and install proper cuda drivers if you have not done so.

nvcc Refer to this guide from stackoverflow, there are instruction that recommend using apt to install the toolkit sudo apt install nvidia-cuda-toolkit but for Pytorch users, you may want to start from step 2 first.

nvcc might have been already installed during cuda toolkit installation, make sure to find it first in /usr/local/cuda/bin/nvcc before reinstalling a new one. Normally nvcc is not in the PATH.

image

2. cuda drivers

See the official guide from NVIDIA Note that Driver Installer section only shows up after you have selected your settings for cuda toolkit

Of use these commands For 535 sudo aptitude install nvidia-driver-535 nvidia-dkms-535

For 555

sudo apt-get install -y nvidia-driver-555-open
sudo apt-get install -y cuda-drivers-555

3. pytorch

Refer to this official URL from pytorch. You do not need to find a pytorch version compatible with the cuda toolkit version in step 1. pytorch installation will find and install the compatible cuda toolkit itself locally (in conda environment, for example).

4. read more

Compatibility Matrix (official URL from nvidia) image

nvidia ecosystem https://docs.nvidia.com/datacenter/tesla/drivers/index.html