This guide ensures your system is ready for deep learning, GPU acceleration, and high-performance computing using the NVIDIA RTX 3050.
-
Ubuntu 22.04 (or newer)
-
RTX 3050 GPU
-
Internet connection
-
Terminal access (
sudo
) -
Charger plugged in (for laptops)
sudo apt update && sudo apt upgrade -y
π Why?
To ensure all existing packages are up to date, reducing the chance of version conflicts during driver or CUDA installation.
π Think of it like cleaning your desk before setting up a new PC build.
Optional (if prompted or just to be safe):
sudo reboot
Ubuntu uses Nouveau by default, but it conflicts with NVIDIAβs proprietary driver, so we need to blacklist it.
sudo nano /etc/modprobe.d/blacklist-nouveau.conf
Paste this into the file:
blacklist nouveau
options nouveau modeset=0
Save and exit:
-
Ctrl + O
,Enter
β Save -
Ctrl + X
β Exit
sudo update-initramfs -u
π Why?
Rebuilds the initial RAM filesystem with the new kernel module settings, so Nouveau stays disabled.
sudo reboot
ubuntu-drivers devices
π Why?
Shows the best driver recommended for your GPU (e.g., nvidia-driver-570
). You avoid guesswork.
sudo apt install nvidia-driver-570 -y
sudo reboot
π Why?
So the system starts using the new NVIDIA driver instead of the disabled Nouveau.
nvidia-smi
You should see output like this:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 570.xx Driver Version: 570.xx CUDA Version: 12.x |
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr.|
| 0 NVIDIA RTX 3050 Off | 00000000:01:00.0 On | |
+-----------------------------------------------------------------------------+
Congrats! You're running NVIDIA RTX 3050 successfully on Ubuntu π
π Why?
Confirms that your RTX 3050 is detected and functioning correctly with the installed driver.
You need this for GPU-based computations in ML, AI, and data science tasks.
4.1 Download .deb (local)
from the official CUDA site
Then install it:
sudo dpkg -i cuda-repo-ubuntu2204-12-8-local_*.deb
sudo cp /var/cuda-repo-*/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt update
sudo apt install cuda -y
π Why?
Adds the NVIDIA CUDA repo and installs the CUDA dev kit β including compiler (nvcc
), runtime libraries, and more.
Open .bashrc
:
nano ~/.bashrc
Add these lines at the bottom:
export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
Then apply the changes:
source ~/.bashrc
π Why?
So your terminal knows where to find CUDA tools and libraries.
nvcc --version
π Why?
To confirm CUDA installed correctly and the version is available.
cuDNN boosts ML frameworks like PyTorch & TensorFlow by giving GPU-based neural net performance.
5.1 Download .deb
from cuDNN Archive
Install it:
sudo dpkg -i cudnn-local-repo-ubuntu2204-8.9.7.29_1.0-1_amd64.deb
sudo cp /var/cudnn-local-repo-*/cudnn-*-keyring.gpg /usr/share/keyrings/
sudo apt update
sudo apt install libcudnn8 libcudnn8-dev libcudnn8-samples -y
π Why?
-
libcudnn8
: Runtime for deep learning -
libcudnn8-dev
: Headers for compiling models -
libcudnn8-samples
: Sample models to test
cat /usr/include/cudnn_version.h | grep CUDNN_MAJOR -A 2
π Why?
Checks the installed cuDNN version.
Run a sample test:
cp -r /usr/src/cudnn_samples_v8/ ~/cudnn_samples
cd ~/cudnn_samples/mnistCUDNN
make
./mnistCUDNN
β
Output should say: Test Passed!
π Why?
Confirms everything (CUDA + cuDNN) is correctly set up.
import torch
print(torch.cuda.is_available()) # Should return True
print(torch.cuda.get_device_name(0)) # NVIDIA RTX 3050
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
π Why?
To confirm your ML code can now access the GPU for training or inference.
Laptop GPUs like RTX 3050 may disable themselves on battery to save power.
π Always keep the charger connected during GPU-intensive tasks.
You now have a complete setup with:
-
β Official NVIDIA Driver
-
β CUDA 12.8
-
β cuDNN 8.9.7
-
β Fully GPU-enabled deep learning environment