DEV Community

How to install NVIDIA drivers for machine learning on Ubuntu

Kevin Naidoo on November 18, 2023

A common pain point for setting up servers to run AI models - is getting the NVIDIA drivers to work correctly with Pytorch and other machine-learni...
Collapse
 
permafacture profile image
Elliot Hallmark

I created an account to say this was the perfect post. (You did drop the 2 at the end of the line sudo apt-get -y install cuda-toolkit-12-). Setting up drivers and cuda was such a pain the last time I installed Ubuntu. These instructions got me there in just a couple minutes. Thank you!

Collapse
 
kwnaidoo profile image
Kevin Naidoo

Awesome! Thanks for the feedback and glad this is working for you. The "-" at the end is on purpose, it will install the latest minor versions but you can also specify an exact version as well.

Collapse
 
permafacture profile image
Elliot Hallmark

I have the issue that my kernel keeps getting automatically upgraded and then the nvidia driver stops being recognized. I've had to fix it several times and I never remember how. Would be great if you updated these instructions to include preventing the driver from breaking