I recently installed the latest version of NVIDIA Drivers and CUDA Toolkit. Everything seems to be working just fine; however, every time I sudo apt install or sudo apt remove something I get prompted the following message as well
Now, I’m a bit sceptical to run an autoremove when I know for a fact I’m using my NVIDIA graphic and associated drivers on my version of Ubuntu. For what reason this message appears if I’m using my RTX Quadro 5000, and is it safe to simply run sudo apt autoremove without having to deal with subsequent issues e.g. falling back to default graphic card or possibly breaking the system?
That looks like you installed cuda using the “cuda” metapackage and then removed it so now autoremove wants to remove all pulled in dependencies including the driver.
How did you initially install the driver and cuda toolkit?
Well, initially I had a RTX Quadro 4000 and installed Drivers and Cuda from here since the current installation method was not available back then. I’m talking early 2022 when the version for Cuda was 11.x.
I happened to recently upgrade my GPU to a Quadro 5000, so before installing the hardware component I removed all Drivers and Cuda toolkit as indicated here.
I then proceeded and re-install them once I upgraded the GPU following the steps highlighted here. This procedure is much easier and straightforward than the one I used before; however, it is different and, as you said, pulls everything from a repo I guess.
Still, this is weird as I purged everything before manually installing the new GPU, and then followed this new procedure for installing of Drivers and Cuda toolkit. Because this display message appeared before, soon after I installed the GPU, I thought I did something wrong so went on and remove everything again and started over with a clean install.
These are the exact steps I followed so far. One thing to mention is that I still have this repo among the others on my Ubuntu “Jammy Jellyfish” v22.04.2
Let me know what do you advise to do, is it safe to run autoremove, or I will cause the system to fall back to default graphic (or worst crash it)? Thanks!
I’m not really sure what to do or where this originates. Did you check whether the cuda repo is added twice? What’s happening when you just re-run
sudo apt install cuda
How can I check whether the cuda repo is added twice? This is the output when I run sudo apt install cuda
Reading package lists… Done
Building dependency tree… Done
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 moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
cuda-drivers-530 : Depends: nvidia-settings (>= 530.30.02) but 510.47.03-0ubuntu1 is to be installed
E: Unable to correct problems, you have held broken packages.
Very interesting, is there a safe way to do so? I believe in this case the offending nvidia-settings package is 510.47.03-0ubuntu1.
To be clear I also set my Nvidia X Server Settings to the default Ubuntu version which happens to be exactly that one (510.47.03-0ubuntu1), simply because I liked the option to set performance mode. See this post for a more comprehensive context.
UPDATE
I went on and unhold the Nvidia X Server Settings, run sudo apt upgrade so that also this tool matches the Drivers and Toolkit distro and, finally, re-run sudo apt-get install cuda. This time I was prompted with the following
The following packages were automatically installed and are no longer required:
cpu-checker ipxe-qemu ipxe-qemu-256k-compat-efi-roms libaio1 libcacard0 libdaxctl1 libdecor-0-0 libdecor-0-plugin-1-cairo libfdt1 libgfapi0 libgfrpc0 libgfxdr0 libglusterfs0 libiscsi7 libndctl6 libpmem1 libpmemobj1 libqrencode4 librados2
librbd1 libsdl2-2.0-0 libspice-server1 liburing2 libusbredirparser1 libvirglrenderer1 msr-tools ovmf pass qemu-block-extra qemu-system-common qemu-system-data qemu-system-gui qemu-system-x86 qemu-utils qrencode seabios tree uidmap xclip
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
cuda-12-1 cuda-demo-suite-12-1 cuda-drivers cuda-drivers-530 cuda-runtime-12-1
The following NEW packages will be installed:
cuda cuda-12-1 cuda-demo-suite-12-1 cuda-drivers cuda-drivers-530 cuda-runtime-12-1
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 3,991 kB of archives.
After this operation, 12.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
As you can see I proceed to install the missing dependencies, but still get some hanging packages/libraries which I’m not entirely sure if it’s safe to remove. Let me know, thanks again!
For one, unfortunately, I don’t know what a kvm virtual machine is; hence, I looked it up online. From what I’m aware I’ve never used something similar, the only things I’ve done is setting up a Container Device Interface (CDI) for Docker, as the tool I’m using rely on an older version of CUDA and it doesn’t support v12.1.
But I tend to believe this was the issue.
Anyway, yesterday I decided to give it another try, so went on switching to my default graphic card, purging all Drivers and Toolkit associated packages for then doing a clean install. The problem seems to have disappeared; however, it’s worth mentioning that at first I though something was wrong with what I did since after this new installation the system was not “picking-up” my NVIDIA graphic unit.
Then, I though I might need to specifically telling my system through the Nvidia X Server Setting that I want my GPU in “Performance Mode” — aka “always active” I believe. So, I downgraded the Nvidia X Server Setting to the default Ubuntu version where I can set that preference and, afterwards, I re-installed the version shipped with the 12.1 Drivers and Toolkit. Finally, I made sure to install the remaining CUDA dependencies as before.
That said, with the new Nvidia X Server Setting where I find the option to toggle on/off the “Performance Mode”, as this is a very lengthy and painful procedure to go through all the times, as you might convey… maybe I’m missing something but I couldn’t see this option in the latest releases of the GUI interface. Let me know, thanks.