Should I update my nvidia drivers on Ubuntu if I don't want to have any issues with Pytorch?

I have recently set up environment for pytorch on fresh Ubuntu 22.04.2 LTS system.

My current package versions:

nvidia drivers: 520.61.05
CUDA version: 11.8
pytorch: 2.0.1+cu118

It seems that there are some compatibility issues between latest pytorch version and latest CUDA Toolkit 12. Furthermore, it seems that CUDA 12.8 (latest) is incompatible with nvidia drivers v520.61.05 and CUDA 11.8 is incompatible with nvidia drivers v535.54.03 (latest) according to Table 3 from this page.

Now I want to run sudo apt-get update but it seems that it would update my nvidia drivers and (or) CUDA toolkit and pytorch won’t work properly with CUDA.

Should I add nvidia drivers and CUDA toolkit to the blacklist for updates? If so, how should I do that? What is a good approach to manage the versions of these packages?

Table 3 explains CUDA’s forward compatibility for data center GPUs, which need additional setup steps.
The PyTorch binaries with CUDA 11.8 are compatible to both drivers according to table 1.

1 Like

I’ve just run the command sudo apt-get update and it didn’t update neither the nvidia drivers nor CUDA toolkit so I think that the issue is resolved