← Back to Blog
Utility

Update CUDA for Ubuntu 24.

If you upgrade ubuntu from 22 to 24 LTE version, you need to update your CUDA drivers . This step by step guide shows you how to do it.

During the Upgrade

  • Driver Disruption: Ubuntu 24.04 uses a much newer Linux kernel (6.8+). Old Ubuntu 22.04 NVIDIA drivers will likely break or fail to load during the OS kernel upgrade.
  • Package Conflicts: Old CUDA paths and metapackages from 22.04 can conflict with 24.04 repositories.

Fix and Ensure Compatibility

Purge Old Drivers: Before or immediately after upgrading, clean out old conflicting drivers:


sudo apt-get --purge remove "*nvidia*" "cuda*" "*cublas*" -y

sudo apt-get autoremove -y

Install New Drivers: Install a modern NVIDIA driver (version 550 or newer) compatible with Ubuntu 24.04:


sudo ubuntu-drivers devices

sudo apt install nvidia-driver-550 # or newer recommended version

Use the 24.04 CUDA Repository: Download and install the official NVIDIA CUDA Toolkit keyring specifically built for Ubuntu 24.04 rather than carrying over old deb files

Rebuild Python Environments: If you use PyTorch, TensorFlow, or Conda for machine learning, expect to reinstall or update those packages so they bind correctly to the new system libraries