Updating the Nvidia drivers

Here are some notes for updating the Nvidia drivers

This post covers the following topics

  • Official documentation for linux installation
  • Updating the drivers
  • Removing old drivers
  • Verify the installation
  • Enabling persistence mode


Official documentation

The official documentation for the CUDA linux installation guide is here


lspci | grep -i nvidia  (see what GPU you have)

uname -m && cat /etc/*release (see what version of linux you have)

Update the drivers

I did an upgrade, and just used

sudo apt-get update cuda 

It automatically removes old packages, and try to install new packages.

For me, I only cared about the device drivers, and not the different runtime libraries of CUDA.

Remove old installations

dpkg -l | grep nvidia is a useful command to see what packages have been installed, in case we need to remove certain outdated packages. Note the drivers are going to be notes as “device drivers” in the right most column. 

 sudo apt-get –purge remove <package-name>


Verify the installation

cat /proc/driver/nvidia/version

NVRM version: NVIDIA UNIX x86_64 Kernel Module  384.130  Wed Mar 21 03:37:26 PDT 2018

GCC version:  gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.4)

or you can do nvidia-smi 

Another test you can do is compile the sameples under /usr/local/cuda-<version>/samples. Do a sudo make to compile all the sample CUDA files, and run this one below (also described in the official installation guide)


This shows you detailed information about your GPU, driver version, runtime version …

Enabling the persistence mode

Persistence mode keeps the drivers initialized and data persistent when no process is actively using the driver. If X is used, it keeps the GPU drivers persistent. However, in server environments where no desktop GUI is used (X-term not used) running, it can take 1-3 seconds for the GPU to start up when a task is assigned to the GPU.

To deal with this issue, Nvidia has provided a “persistent mode” option that updates the kernel. In the persistent mode, running “nvidia-smi” is much faster, and the power consumption and temperature of the GPUs are significantly reduced.

sudo nvidia-smi -i 0,12,3 -pm ENABLED  (enable the persistent mode) 

This persistent mode approach is about to be deprecated and replaced with the newer “persistent deamon” approach.

The official documentation is here


This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s