Install Cuda Toolkit — Cuda Driver

Gia Huy ( CisMine)
3 min readMay 14, 2024

--

The CUDA Driver acts as a bridge between the operating system and the GPU, enabling communication with the hardware. Without it, the CUDA Toolkit, which provides software tools for GPU programming, cannot function properly. So, before installing the CUDA Toolkit, it's essential to install the CUDA Driver to ensure proper GPU utilization.

If you don't know the difference between them, I have explained in here

Install Cuda Driver

To begin, it's important to verify that your NVIDIA driver is compatible with your computer. This can be confirmed by Nvidia Driver

For example: my computer is Geforce MX570 - Ubuntu 22.04

Now I know that my suitable Nvidia Driver version is: 545.29.02

Let's open Software & Updates and install Nvidia Driver. Notice that install driver metapackage

After installing, click restart

You have successfully installed the CUDA Driver. You can verify this by open terminal and run this command

$nvidia-smi

You'll notice a recommendation for the CUDA Toolkit version

Install Cuda Toolkit

Now, you need to find the appropriate CUDA Toolkit to download in this link

For example: I need to isntall Cuda Toolkit version: 12.3

Follow the Installation Instructions

When done, run these commands to add your path

$nano /home/$USER/.bashrc

Then scroll until the end and add these ( replace cuda-12.3 into your version )

export PATH="/usr/local/cuda-12.3/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/cuda-12.3/lib64:$LD_LIBRARY_PATH"

Then:

Ctrl + o : save

Enter : accept changes

Ctrl + x : close editor

You have successfully installed the CUDA Toolkit. You can verify this by open terminal and run this command:

$nvcc -V

--

--

Gia Huy ( CisMine)

My name is Huy Gia. I am currently pursuing a B.Sc. degree. I am interested in the following topics: DL in Computer Vision, Parallel Programming With Cuda.