apt install nvidia-smi Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package nvidia-smi
The command you are trying to use (apt install nvidia-smi
) won't work because nvidia-smi
is part of the NVIDIA driver package, not a standalone package available in the default Ubuntu repositories. Here’s how you can properly install the NVIDIA drivers, which will include nvidia-smi
:
Steps to Install NVIDIA Drivers on Ubuntu
1. Add the Graphics Drivers PPA (Optional but Recommended)
This step is useful to get the latest NVIDIA drivers through a more frequently updated repository.
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
2. Identify Available NVIDIA Drivers
Before installation, identify which driver is suitable for your hardware.
ubuntu-drivers devices
This command will list the recommended drivers for your GPU.
3. Install the Recommended NVIDIA Driver
Once you know the recommended version (let’s assume nvidia-driver-###
is recommended), install it using:
sudo apt install nvidia-driver-###
Replace ###
with the version number recommended by the previous command.
4. Reboot the System
After installation, reboot your system to allow the new driver to load:
sudo reboot
5. Verify Installation
After rebooting, verify that the driver is installed correctly by running:
nvidia-smi
This command should show you information about your NVIDIA GPU, including usage stats and driver version.
Troubleshooting
Secure Boot: If Secure Boot is enabled on your system, it might prevent the NVIDIA driver from loading correctly. You might need to disable Secure Boot in your BIOS settings to use proprietary drivers.
Check for Errors: If you encounter errors during installation, carefully read the terminal output for clues. You may need to remove any incorrect or old drivers before reinstalling using:
sudo apt remove --purge '^nvidia-.*'
Compatibility: Ensure your system's GPU is supported by the driver you are installing. NVIDIA's website can provide compatibility information for their drivers.
Using the package management system and official repositories or PPAs ensures you are installing properly signed and supported drivers for your hardware.