Can't install nvidia-smi

I can’t use nvidia-smi
$ nvidia-smi
NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

tried:
$ sudo apt-get install -f nvidia-384 libcuda1-384 nvidia-opencl-icd-384
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 moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libcuda1-384 : Depends: nvidia-headless-390 but it is not going to be installed
 nvidia-384 : Depends: nvidia-driver-390 but it is not going to be installed
 nvidia-opencl-icd-384 : Depends: nvidia-headless-390 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

If you haven’t already, check out the How do I remove and reinstall Lambda Stack FAQ.

Let us know if it fixes the issue you’re encountering.

Unfortunately, I tried that and it didn’t help.

Please run the following command and upload the file named nvidia-smi-troubleshooting.txt that the command produces:

sudo apt update &> nvidia-smi-troubleshooting.txt

The command will show if you have the latest packages from your configured apt repositories.

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Hit:1 Index of /ubuntu focal InRelease
Get:2 Index of /ubuntu focal-updates InRelease [114 kB]
Get:3 Index of /ubuntu focal-backports InRelease [108 kB]
Hit:4 https://download.sublimetext.com apt/stable/ InRelease
Get:5 Index of /ubuntu focal-updates/main amd64 Packages [2277 kB]
Get:6 Index of /ubuntu focal-updates/main i386 Packages [764 kB]
Get:7 Index of /ubuntu focal-updates/main amd64 DEP-11 Metadata [275 kB]
Get:8 Index of /ubuntu focal-updates/main amd64 c-n-f Metadata [16.1 kB]
Get:9 Index of /ubuntu focal-updates/universe amd64 Packages [1011 kB]
Get:10 Index of /ubuntu focal-updates/universe i386 Packages [705 kB]
Get:11 Index of /ubuntu focal-updates/universe amd64 DEP-11 Metadata [408 kB]
Get:12 Index of /ubuntu focal-updates/multiverse amd64 DEP-11 Metadata [944 B]
Get:13 Index of /ubuntu focal-backports/main amd64 DEP-11 Metadata [7992 B]
Get:14 Index of /ubuntu focal-backports/universe amd64 DEP-11 Metadata [30.5 kB]
Get:15 Index of /ubuntu focal-security InRelease [114 kB]
Hit:16 Index of /compute/cuda/repos/ubuntu2004/x86_64 InRelease
Err:16 Index of /compute/cuda/repos/ubuntu2004/x86_64 InRelease
The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY A4B469963BF863CC
Hit:17 http://archive.lambdalabs.com/ubuntu focal InRelease
Get:18 Index of /ubuntu focal-security/main amd64 DEP-11 Metadata [40.7 kB]
Get:19 Index of /ubuntu focal-security/main amd64 c-n-f Metadata [11.6 kB]
Get:20 Index of /ubuntu focal-security/universe amd64 DEP-11 Metadata [93.8 kB]
Get:21 Index of /ubuntu focal-security/multiverse amd64 DEP-11 Metadata [940 B]
Hit:22 Index of /repos/code/ stable InRelease
Fetched 5978 kB in 4s (1408 kB/s)
Reading package lists…
Building dependency tree…
Reading state information…
4 packages can be upgraded. Run ‘apt list --upgradable’ to see them.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: Index of /compute/cuda/repos/ubuntu2004/x86_64 InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY A4B469963BF863CC
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:57 and /etc/apt/sources.list.d/lambda-repository.list:1
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:57 and /etc/apt/sources.list.d/lambda-repository.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:57 and /etc/apt/sources.list.d/lambda-repository.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:57 and /etc/apt/sources.list.d/lambda-repository.list:1
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:57 and /etc/apt/sources.list.d/lambda-repository.list:1
W: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:57 and /etc/apt/sources.list.d/lambda-repository.list:1
W: Target DEP-11-icons-small (main/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list:57 and /etc/apt/sources.list.d/lambda-repository.list:1
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:57 and /etc/apt/sources.list.d/lambda-repository.list:1
W: Target DEP-11-icons-hidpi (main/dep11/icons-64x64@2.tar) is configured multiple times in /etc/apt/sources.list:57 and /etc/apt/sources.list.d/lambda-repository.list:1
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:57 and /etc/apt/sources.list.d/lambda-repository.list:1
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:57 and /etc/apt/sources.list.d/lambda-repository.list:1
W: Failed to fetch http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/InRelease The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY A4B469963BF863CC
W: Some index files failed to download. They have been ignored, or old ones used instead.
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:57 and /etc/apt/sources.list.d/lambda-repository.list:1
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:57 and /etc/apt/sources.list.d/lambda-repository.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:57 and /etc/apt/sources.list.d/lambda-repository.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:57 and /etc/apt/sources.list.d/lambda-repository.list:1
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:57 and /etc/apt/sources.list.d/lambda-repository.list:1
W: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:57 and /etc/apt/sources.list.d/lambda-repository.list:1
W: Target DEP-11-icons-small (main/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list:57 and /etc/apt/sources.list.d/lambda-repository.list:1
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:57 and /etc/apt/sources.list.d/lambda-repository.list:1
W: Target DEP-11-icons-hidpi (main/dep11/icons-64x64@2.tar) is configured multiple times in /etc/apt/sources.list:57 and /etc/apt/sources.list.d/lambda-repository.list:1
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:57 and /etc/apt/sources.list.d/lambda-repository.list:1
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:57 and /etc/apt/sources.list.d/lambda-repository.list:1

The http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 NVIDIA repo is probably what’s causing the problem.

You can run grep -r developer.download.nvidia.com /etc/apt/sources.list.d to find the APT list that contains the NVIDIA repo. Delete the list.

Run sudo apt update &> nvidia-smi-troubleshooting.txt again so we can see the new output.

(Also, you might want to comment out line 57 of /etc/apt/sources.list to suppress all the […] is configured multiple times in /etc/apt/sources.list:57 and /etc/apt/sources.list.d/lambda-repository.list:1 warnings you’re receiving.)

I commented out lines 57 and 59 of /etc/apt/sources.list
56: ## Lambda Labs software repository
57: #deb http://archive.lambdalabs.com/ubuntu focal main
58: # deb-src http://archive.lambdalabs.com/ubuntu focal main
59: #deb Index of /compute/cuda/repos/ubuntu2004/x86_64>
60: # deb-src http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x8>

and commented out line 1 of /etc/apt/sources.list.d/lambda-repository.list which now looks like this
1: #deb http://archive.lambdalabs.com/ubuntu focal main
2: # deb-src http://archive.lambdalabs.com/ubuntu focal main

Now the output looks like this:

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Hit:1 Index of /ubuntu focal-security InRelease
Hit:2 Index of /repos/code/ stable InRelease
Hit:3 https://download.sublimetext.com apt/stable/ InRelease
Hit:4 Index of /ubuntu focal InRelease
Hit:5 Index of /ubuntu focal-updates InRelease
Hit:6 Index of /ubuntu focal-backports InRelease
Reading package lists…
Building dependency tree…
Reading state information…
21 packages can be upgraded. Run ‘apt list --upgradable’ to see them.

If I uncomment line 1 of /etc/apt/sources.list.d/lambda-repository.list which now looks like this
1: deb http://archive.lambdalabs.com/ubuntu focal main
2: # deb-src http://archive.lambdalabs.com/ubuntu focal main

The output looks like this:

Hit:1 Index of /repos/code/ stable InRelease
Get:2 http://archive.lambdalabs.com/ubuntu focal InRelease [3176 B]
Hit:3 https://download.sublimetext.com apt/stable/ InRelease
Get:4 http://archive.lambdalabs.com/ubuntu focal/main amd64 Packages [92.1 kB]
Hit:5 Index of /ubuntu focal-security InRelease
Get:6 http://archive.lambdalabs.com/ubuntu focal/main i386 Packages [30.8 kB]
Hit:7 Index of /ubuntu focal InRelease
Hit:8 Index of /ubuntu focal-updates InRelease
Hit:9 Index of /ubuntu focal-backports InRelease
Fetched 126 kB in 4s (35.0 kB/s)
Reading package lists… Done
Building dependency tree
Reading state information… Done
16 packages can be upgraded. Run ‘apt list --upgradable’ to see them.

Run sudo apt update && sudo apt upgrade.

That should upgrade all of your packages installed from APT repositories, including Lambda Stack—and fix the problem you’re experiencing with package dependencies being unmet.

This was fixed by reinstalling a new recovery linux image (formatting the workstation)