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.
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:
sudo apt update
sudo apt upgrade -y
sudo apt install -y build-essential dkms linux-headers-$(uname -r) wgetDisable the default Nouveau driver to prevent conflicts:
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 reboot2. Install NVIDIA Drivers
Download and install the official NVIDIA driver (version 570.190 used here):
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 rebootVerify the installation:
nvidia-smiYou should see your RTX 5070 listed along with the driver version.
3. Install CUDA Toolkit 12.6
Download the CUDA installer:
wget https://developer.download.nvidia.com/compute/cuda/12.6.2/local_installers/cuda_12.6.2_560.35.03_linux.runInstall CUDA toolkit silently:
sudo sh cuda_12.6.2_560.35.03_linux.run --toolkit --silent --overrideAdd CUDA to your environment:
echo 'export PATH=/usr/local/cuda/bin:$PATH' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH' >> ~/.bashrc
source ~/.bashrcVerify CUDA installation:
nvcc --version4. Optional: Enable Docker GPU Support
Install NVIDIA container toolkit for Docker:
sudo apt install -y nvidia-container-toolkit
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart dockerTest GPU inside a Docker container:
sudo docker run --rm --gpus all nvidia/cuda:12.6.2-base-ubuntu22.04 nvidia-smiYou should see your RTX 5070 listed inside the container.
5. Post-Installation Tips
- Persistence Mode (optional): Keep the GPU driver active even when no process is using it:
sudo nvidia-smi -pm 1Reboot after updates: Always reboot after installing kernel updates or drivers.
Verify CUDA samples (optional):
cuda-install-samples-12.6.sh ~/
cd ~/NVIDIA_CUDA-12.6_Samples/1_Utilities/deviceQuery
make
./deviceQueryYou 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.