Skip to main content
  1. Blog/

Installing an NVIDIA GPU Driver on Ubuntu 22.04

·1 min
Author
Chengyu
I’m Chengyu — a final-year Computer Science student at the University of Sydney. I write about the things I build and break, plus hiking, travel, gaming, and gadgets.
Table of Contents

1. Download the driver and disable the built-in one
#

  • Check the GPU model: lspci | grep -i nvidia
  • Download the driver from NVIDIA’s official site.
  • Remove Ubuntu’s bundled driver: sudo apt purge nvidia*
  • Blacklist the nouveau driver by editing /etc/modprobe.d/blacklist.conf.
  • Update the system and reboot.

2. Install the graphics driver
#

  • Stop the lightdm desktop service.
  • Make sure GCC is up to date (12+ is required).
  • Run the driver installer with the appropriate flags.
  • Verify with nvidia-smi.

3. Install CUDA
#

  • Followed a CSDN write-up for the exact steps.
  • Installed CUDA 12.4 via apt.
  • Added the CUDA environment variables to .bashrc.
  • Verified the install with the usual CUDA version commands.

Related