Title: Which CUDA version should I install? Do they have back compatibility?
Tags: nvidia;cuda;gpu
Question: This is the first GPU I am using and unfortunately, I am using Ubuntu 20.04 not easy easy Windows.
I want to use my GPU (Nvidia Quadro 2000 1GB GDDR5) for very basic machine learning models. I've got a supercomputer from my university to train bigger models.
When I type ```nvidia-smi```  in my terminal I can see the following.
```+-----------------------------------------------------------------------------+
| NVIDIA-SMI 390.144                Driver Version: 390.144                   |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Quadro 2000         Off  | 00000000:01:00.0  On |                  N/A |
| 34%   62C    P0    N/A /  N/A |    383MiB /   963MiB |     20%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0       955      G   /usr/lib/xorg/Xorg                            93MiB |
|    0      1261      G   /usr/bin/gnome-shell                         143MiB |
|    0      3398      G   ...AAgAAAAAAAAACAAAAAAAAAA= --shared-files   142MiB |
+-----------------------------------------------------------------------------+
```
In other answers for example in this one Nvidia-smi shows CUDA version, but CUDA is not installed there is ```CUDA version``` next to the ```Driver version```.
I want to download Pytorch but I am not sure which CUDA version should I download. Or should I download CUDA separately in case I wish to run some Tensorflow code. BTW I use Anaconda with VScode.
I found an old article which says my GPU supports CUDA 2.1. Are the newer versions back-compatible?
As per Nmath's suggestion, I went on to install CUDA from the Ubuntu repository as follows.
```$ sudo apt install nvidia-cuda-toolkit

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been                Recommends: nvidia-visual-profiler (= 10.1.243-3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.oing to be installed
                       Recommends: nvidia-visual-profiler (= 10.1.243-3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
```
Here, I do understand that it need some dependencies. How do I fix it?

Comment: Check the CUDA compute capability requirements on any software you want to install.  My 2GB Quadro 1000 (cc=2.1 same as yours) was limited to CUDA 8.x for my DNN and Tensorflow.

Comment: `nvidia-visual-profiler` is at the multiverse repository. Make sure you have it enabled. Open Software & Updates to confirm and act accordingly.

Comment: @ChanganAuto Yes, Software restricted by copyright or legal issues (multiverse) is already checked in Software and Updates.

Comment: @ubfan1 Yes. the CUDA toolkit 9.0 supports my driver version (from nvidia-smi). Still when I install an older version of Pytorch that supports CUDA 9.0, Still torch.cuda.is_available() is False. Please see this question: https://askubuntu.com/q/1383692/1230667


Here is another answer: Quadro 2000 has Fermi architecture with compute capability 2.1. If you want to do deep learning, you may find difficulties since most CUDA features for deep learning are available for GPU with compute capability 3.0 or higher. Also, you may not be able to update to the latest version of CUDA toolkit since each CUDA version has minimum compute capability that it supports.
If you use desktop GPU, probably this list can help in finding alternatives (old) desktop GPUs. For CUDA compatibility table, you may also find this explanation helpful especially when installing/upgrading the driver and the CUDA toolkit on your GPU-powered machine.


Here is another answer: Don't overthink this. Just use the version of CUDA that is in repos for your version of Ubuntu. Unless you have a very specific technical reason for doing so, you shouldn't need to install a specific version, especially not one that isn't in Ubuntu's repositories. This is as true with CUDA as it is any other software. Think about this: why would developers release new versions of software that stop supporting features and hardware that most people are still using?
In fact, if you try to explicitly install software versions (especially older ones) that are different than what's in Ubuntu's repositories, this is often a recipe for disaster as lots of software in Ubuntu/Linux rely on dependencies and expect the version that is in official repositories.

Comment for this answer: Did you run `sudo apt update` and `sudo apt upgrade` first?  You need to be up-to-date on maintenance and your package management system can't be broken before installing anything new. This is a very different problem than the question you asked here. See: https://askubuntu.com/q/223237
Comment for this answer: `you have held broken packages` indicates that those commands would have had problems that need to be fixed first. Add the full output of each to your question
Comment for this answer: Thanks for the reply. I am getting some errors. I've updated the answer.
Comment for this answer: yes I did run the update and upgrade command first.

{'source': 'StackExchangeDataset', 'subset': 'askubuntu.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 4, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2021:00:12/24/21', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<nvidia><cuda><gpu>', 'Title': 'Which CUDA version should I install? Do they have back compatibility?', 'ViewCount': 1207, 'id': 1383657, 'user_AboutMe': '<p>I work in the field of data-driven discovery of partial differential equations. Alongside, I do a lot of coding in the field of computational plasticity, computational fluid dynamics, Non-linear mechanics etc.</p>\n', 'user_AccountId': 19923335.0, 'user_DisplayName': 'Prakhar Sharma', 'user_Reputation': 135.0, 'user_Views': 10.0, 'user_id': 1230667.0}}