œœœ

Install the required apt packages

sudo apt update
sudo apt upgrade
sudo apt install ubuntu-drivers-common

Install the drivers

The driver version changes from platform to platform, CPU to CPU and a lot of other factors affect the driver version. So we shall install the driver recommended by Ubuntu.

sudo ubuntu-drivers autoinstall

Reboot

sudo reboot

Check for proper driver installation

Run the following command:

nvidia-smi

If the above returns an error, please backtrack for any errors in the previous steps.

Installing CUDA

First of all check the maximum version of CUDA supported by your device. You can do it by running the below command:

nvidia-smi