Install Graphics Drivers Linux: Step-by-Step Guide
In this article
- Why Linux Graphics Drivers Matter
- How Linux Graphics Drivers Work
- Choosing the Right Driver for Your GPU
- Installing NVIDIA Drivers on Ubuntu/Debian
- Installing AMD and Intel Drivers
- Configuring Graphics Drivers After Installation
- Common Problems and Solutions
- Frequently Asked Questions
- Safety and Precautions
To install and configure graphics drivers on Linux, you first identify your GPU (NVIDIA, AMD, or Intel), then use your distribution's package manager or the manufacturer's official installer to install the appropriate driver, and finally reboot and verify with a command like glxinfo or nvidia-smi. The exact commands differ by distribution, but the core process is consistent across Ubuntu, Fedora, Arch, and others.
Why Linux Graphics Drivers Matter
Linux supports three main GPU vendors: NVIDIA, AMD, and Intel. Each has different driver models:
- NVIDIA: Proprietary driver (recommended for gaming and CUDA) or open-source
nouveau(basic support, lower performance). - AMD: Open-source
amdgpudriver is built into the kernel and performs well for most tasks; proprietary AMDGPU-PRO exists for some enterprise features. - Intel: Open-source
i915driver is included in the kernel; works out-of-the-box for most integrated graphics.
Without proper drivers, you may experience low resolution, no hardware acceleration, screen tearing, or crashes. Installing the correct driver unlocks full performance and features like Vulkan support and external monitor management.
How Linux Graphics Drivers Work
Linux graphics stack has several layers:
- Kernel mode setting (KMS): The kernel loads a driver (e.g.,
amdgpu,i915,nouveau) to control the GPU hardware. - Mesa: An open-source user-space library that implements OpenGL, Vulkan, and other graphics APIs. It works with AMD and Intel drivers, and also with NVIDIA via a compatibility layer.
- Xorg or Wayland: Display servers that communicate with the GPU driver to render windows.
- DDX driver: For Xorg, a separate driver (like
xserver-xorg-video-amdgpu) handles 2D acceleration.
For NVIDIA proprietary, the driver includes its own kernel module (nvidia) and user-space libraries, bypassing Mesa for OpenGL. This is why NVIDIA requires a separate installation process.
Choosing the Right Driver for Your GPU
First, identify your GPU with:
lspci -k | grep -A 2 -E "VGA|3D"
Then decide based on your needs:
- NVIDIA: If you game, use CUDA, or need high performance, install the proprietary driver. For older cards, the legacy driver branch may be required.
- AMD: The open-source driver is usually best. Only install AMDGPU-PRO if you need specific professional software support.
- Intel: The built-in driver is sufficient for most users. No action needed unless you have a very new CPU where a newer kernel helps.
Check your distribution's documentation for recommended drivers. For example, Ubuntu offers a “Additional Drivers” tool that lists available proprietary options.
Installing NVIDIA Drivers on Ubuntu/Debian
Ubuntu and Debian provide a convenient tool:
- Open “Software & Updates” and go to the “Additional Drivers” tab.
- Select the proprietary driver (e.g., “Using NVIDIA driver metapackage”) and click “Apply Changes”.
- Reboot.
Alternatively, use the terminal:
sudo apt update
sudo apt install nvidia-driver-550
Replace 550 with the latest version available for your card. After reboot, verify with nvidia-smi.
For Fedora, enable RPM Fusion and run sudo dnf install akmod-nvidia. For Arch, use sudo pacman -S nvidia.
Installing AMD and Intel Drivers
AMD and Intel drivers are mostly in the kernel, so you usually need no extra installation. However, for newer GPUs, you may need a newer kernel. For example, on Ubuntu, you can install the linux-oem kernel or use a newer distribution release.
For AMD, ensure the amdgpu module is loaded:
lsmod | grep amdgpu
If not, add amdgpu to /etc/modules-load.d/ and reboot. For Intel, the i915 driver is almost always loaded automatically.
If you need Vulkan support, install vulkan-radeon (AMD) or vulkan-intel (Intel) from your package manager.
Configuring Graphics Drivers After Installation
After installation, you may need to configure settings:
- NVIDIA: Run
sudo nvidia-xconfigto generate an Xorg configuration file (though modern systems often work without it). Usenvidia-settingsto adjust resolution, refresh rate, and multi-monitor setup. - AMD/Intel: Use
xrandrto set resolution, or configure via your desktop environment's display settings. For advanced tuning, create an Xorg configuration file in/etc/X11/xorg.conf.d/.
For Wayland, most settings are managed by the compositor (e.g., GNOME's Settings app).
Common Problems and Solutions
- Screen goes blank after installing NVIDIA driver: Boot into recovery mode and uninstall the driver with
sudo apt purge nvidia-*, then reinstall with the correct version. - Driver not loading after kernel update: On Ubuntu, run
sudo update-initramfs -u; on Fedora,sudo dnf reinstall akmod-nvidia. - Poor performance with open-source drivers: Ensure you have the latest Mesa and kernel. On Ubuntu, add the Kisak Mesa PPA or use a rolling-release distro.
- External monitor not detected: Check if the GPU is properly recognized with
xrandr. For NVIDIA, ensure the driver is loaded and trynvidia-settingsto configure.
Frequently Asked Questions
How do I check which graphics driver is currently in use?
Run lspci -k | grep -A 2 -E "VGA|3D" to see the kernel driver in use. For NVIDIA, nvidia-smi shows the driver version. For Mesa, glxinfo | grep "OpenGL renderer" shows the renderer string.
Is it safe to install proprietary drivers?
Yes, they are safe and officially supported by the vendors. However, they are closed-source, so you cannot inspect the code. For most users, the performance benefit outweighs this. Always install from your distribution's repository or the official vendor site, never from random sources.
Do I need to reinstall drivers after every kernel update?
For NVIDIA proprietary, yes, because the kernel module must be rebuilt. Distributions like Ubuntu and Fedora automate this with DKMS or akmod. For AMD/Intel open-source, no, they are part of the kernel and update automatically.
Can I use both NVIDIA and AMD GPUs together?
Yes, but it requires careful configuration (e.g., PRIME offloading). It's advanced and not recommended for beginners. You would need to install drivers for both and configure Xorg to use the correct GPU per application.
What is the difference between open-source and proprietary drivers?
Open-source drivers are community-developed, transparent, and often integrated into the kernel. Proprietary drivers are closed-source, offer better performance for NVIDIA, and include features like CUDA. For AMD, open-source is usually better; for NVIDIA, proprietary is usually better.
Safety and Precautions
When installing drivers, follow these safety tips:
- Always back up your system before major driver changes.
- If you have a dual-GPU laptop (hybrid graphics), refer to your distribution's guide for PRIME or NVIDIA Optimus setup.
- Overclocking or undervolting your GPU can cause instability and may void warranty. Only do it if you understand the risks.
- Never open your power supply or touch internal components without grounding yourself. Static electricity can damage hardware.
If you are unsure, stick with the open-source drivers that come with your distribution. They are stable and sufficient for most users.