Skip to content

Instantly share code, notes, and snippets.

@frengky
Last active July 19, 2023 09:31
Show Gist options
  • Star 16 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save frengky/6bd5835491be40184760 to your computer and use it in GitHub Desktop.
Save frengky/6bd5835491be40184760 to your computer and use it in GitHub Desktop.
Update Nvidia driver on CentOS 7.x after kernel update

Update Nvidia driver on CentOS 7.x

Download the latest Nvidia driver on http://www.nvidia.com/drivers

Update the kernel to the latest version

$ yum update

Change to runlevel 3 - multi user mode for the next reboot

$ systemctl set-default multi-user.target
$ systemctl get-default

Reboot your computer

$ reboot

Install the Nvidia driver from the console after rebooting

$ chmod +x NVIDIA-Linux-x86_64-xxx.xx.run
$ ./NVIDIA-Linux-x86_64-xxx.xx.run

Change back to runlevel 5 - graphical mode for the next reboot

$ systemctl set-default graphical.target
$ systemctl get-default

Reboot back to the graphical mode, and enjoy.

$ reboot
@johnstcn
Copy link

johnstcn commented Jul 5, 2018

Nice gist. If you are using the mainline kernel, you will also need to ensure you have the kernel-ml-devel package installed.

@jubilantsundar
Copy link

Hi frengky,
I'm using Centos 7. After I ran the following commands,
I'm unable to see a video output on my screen including no boot text.
$ yum update
$ systemctl set-default multi-user.target
$ systemctl get-default
$ reboot

@jubilantsundar
Copy link

Hi frengky,
I'm using Centos 7. After I ran the following commands,
I'm unable to see a video output on my screen including no boot text.
$ yum update
$ systemctl set-default multi-user.target
$ systemctl get-default
$ reboot

@Honghe
Copy link

Honghe commented Jan 21, 2021

If you have nvidia-docker installed, it is necessary to kill them.
The docker container:

sudo docker kill ${sudo docker ps -q}

The nvidia-docker-plugin:

$ ps aux|grep nvidia
root       3115  0.0  0.0      0     0 ?        S    14:52   0:00 [nvidia-modeset/]
root       3116  0.0  0.0      0     0 ?        S    14:52   0:00 [nvidia-modeset/]
nvidia-+   3615  0.3  0.0 9173572 46648 ?       Ssl  14:52   0:01 /usr/bin/nvidia-docker-plugin -s /var/lib/nvidia-docker
root       3657  0.0  0.0      0     0 ?        S    14:52   0:00 [irq/70-nvidia]
root       3658  0.0  0.0      0     0 ?        S    14:52   0:00 [nvidia]
root       3779  0.0  0.0      0     0 ?        S    14:52   0:00 [irq/71-nvidia]
root       3780  0.0  0.0      0     0 ?        S    14:52   0:00 [nvidia]

$ sudo kill 3615

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment