NVIDIA Optimus Dual Graphics Configuration
Many laptops are equipped with both Intel/AMD integrated graphics and NVIDIA discrete graphics. NVIDIA calls this technology Optimus. In daily use, the power-efficient integrated GPU drives the display; when high performance is needed (gaming, rendering, CUDA), it switches to the discrete GPU. This article describes how to correctly install drivers and use PRIME Render Offload on Debian 13.
Step 1: Confirm Hardware
# List all graphics cards, confirm both Intel/AMD and NVIDIA are present
lspci | grep -E "VGA|3D"If you see two graphics cards (e.g., one Intel and one NVIDIA), it is an Optimus hybrid architecture.
Step 2: Enable non-free-firmware and non-free repositories
NVIDIA proprietary drivers are in the non-free component. Ensure your sources include non-free and non-free-firmware (for Debian 13's default deb822 format, see deb822 sources format):
Components: main contrib non-free non-free-firmwareAfter modification, run:
sudo apt updateStep 3: Install NVIDIA Driver
The official Debian repository contains tested NVIDIA drivers. Prefer official packages over the .run installer from the NVIDIA website:
# Install kernel headers (needed to compile driver modules)
sudo apt install linux-headers-amd64
# Install NVIDIA driver and PRIME support
sudo apt install nvidia-driver firmware-misc-nonfree
# Reboot to load the driver
sudo rebootThe installation automatically compiles modules for the current kernel via DKMS. Debian's nvidia-driver package configures PRIME by default: the integrated GPU still drives the desktop on boot, and the discrete GPU is enabled on demand — this is the power-saving behavior desired for laptops.
Step 4: Verification
# Check discrete GPU status (if driver is working, GPU info will be listed)
nvidia-smi
# Confirm current OpenGL renderer (should default to Intel/AMD integrated GPU)
glxinfo | grep "OpenGL renderer"glxinfo is provided by the mesa-utils package (sudo apt install mesa-utils).
Step 5: Run Programs with Discrete GPU on Demand (PRIME Render Offload)
Use the integrated GPU for daily tasks, and pass individual programs to the discrete GPU only when needed. This is called PRIME Render Offload:
# Run a program with the discrete GPU
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia <program-name>
# For example, run glxgears test with the discrete GPU
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia glxgearsFor convenience, define an alias in ~/.bashrc:
alias nv-run='__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia'
# Then use: nv-run blenderDesktop environments (GNOME/KDE) usually provide a "Run with dedicated graphics card" option in the right-click menu of applications, which uses the same mechanism under the hood.
CUDA / Computational Use
If you only need to run CUDA computations (e.g., AI inference) rather than graphics rendering, once the driver is installed and nvidia-smi recognizes the discrete GPU, there is no need for PRIME offload. Install the CUDA toolkit:
sudo apt install nvidia-cuda-toolkitWayland and Common Issues
- Wayland: Newer NVIDIA drivers have good support for Wayland. If you encounter display corruption or cannot log in, switch to an Xorg session at the login screen for debugging.
- Black screen / cannot enter desktop: Temporarily add
nomodesetat the end of thelinuxline in the GRUB boot entry to enter a low-resolution desktop, then check driver installation. nvidia-smireports "No devices found": Usually means the driver was not compiled successfully for the current kernel. Check iflinux-headers-amd64is installed and re-runsudo apt install --reinstall nvidia-driver.
Summary
- Enable
non-freerepository → Installlinux-headers-amd64+nvidia-driver→ Reboot. - By default, the integrated GPU saves power; use
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidiato call the discrete GPU on demand. - Prefer Debian official driver packages; avoid the
.runinstaller from the official website.
Further reading: Hardware Compatibility · deb822 sources format