Installing NVIDIA Drivers and CUDA 12.6 on Debian 13 (RTX 5070)

Install NVIDIA drivers, CUDA 12.6 and Docker GPU support on Debian 13 for an RTX 5070.

2 min read Updated

This guide walks you through installing NVIDIA proprietary drivers, the CUDA toolkit, and setting up Docker GPU support on Debian 13 for an NVIDIA RTX 5070.

1. Prerequisites

Before starting, make sure your system is up-to-date and has the necessary build tools:

bash
sudo apt update
sudo apt upgrade -y
sudo apt install -y build-essential dkms linux-headers-$(uname -r) wget

Disable the default Nouveau driver to prevent conflicts:

bash
sudo bash -c "echo 'blacklist nouveau' > /etc/modprobe.d/blacklist-nouveau.conf"
sudo bash -c "echo 'options nouveau modeset=0' >> /etc/modprobe.d/blacklist-nouveau.conf"
sudo update-initramfs -u
sudo reboot

2. Install NVIDIA Drivers

Download and install the official NVIDIA driver (version 570.190 used here):

bash
wget https://us.download.nvidia.com/XFree86/Linux-x86_64/570.190/NVIDIA-Linux-x86_64-570.190.run
chmod +x NVIDIA-Linux-x86_64-570.190.run
sudo ./NVIDIA-Linux-x86_64-570.190.run --kernel-module-type=open
sudo reboot

Verify the installation:

bash
nvidia-smi

You should see your RTX 5070 listed along with the driver version.

3. Install CUDA Toolkit 12.6

Download the CUDA installer:

bash
wget https://developer.download.nvidia.com/compute/cuda/12.6.2/local_installers/cuda_12.6.2_560.35.03_linux.run

Install CUDA toolkit silently:

bash
sudo sh cuda_12.6.2_560.35.03_linux.run --toolkit --silent --override

Add CUDA to your environment:

bash
echo 'export PATH=/usr/local/cuda/bin:$PATH' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH' >> ~/.bashrc
source ~/.bashrc

Verify CUDA installation:

bash
nvcc --version

4. Optional: Enable Docker GPU Support

Install NVIDIA container toolkit for Docker:

bash
sudo apt install -y nvidia-container-toolkit
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker

Test GPU inside a Docker container:

bash
sudo docker run --rm --gpus all nvidia/cuda:12.6.2-base-ubuntu22.04 nvidia-smi

You should see your RTX 5070 listed inside the container.

5. Post-Installation Tips

  1. Persistence Mode (optional): Keep the GPU driver active even when no process is using it:
bash
sudo nvidia-smi -pm 1
  1. Reboot after updates: Always reboot after installing kernel updates or drivers.

  2. Verify CUDA samples (optional):

bash
cuda-install-samples-12.6.sh ~/
cd ~/NVIDIA_CUDA-12.6_Samples/1_Utilities/deviceQuery
make
./deviceQuery

You should see your GPU detected with all capabilities.


Congratulations! Your Debian 13 system is now ready with NVIDIA drivers, CUDA 12.6, and Docker GPU support.

Search articles

Type to filter articles. Use the arrow keys to move through results and Enter to open one. Press Escape to close.