Nvidia:HowToInstall
lastmod 2026-01-02created 2016-06-0817 edits
Notes on how to install the NVIDIA Driver.
| WARNING |
| If you plan to install CUDA, you should install the driver using the CUDA Toolkit. When using CUDA, a mismatched driver version may prevent it from starting properly. |
How to install NVIDIA in CentOS
How to install NVIDIA on CentOS is as follows:
## 우선, 그래픽모드 종료를 위해 <code>Ctrl + Alt + F2</code>를 입력.
$ /sbin/init 3
$ modprobe -r nouveau
## nouveau가 종료되었는지 확인:
$ lsmod | grep nouv ## 아무것도 출력되지 않아야 한다!
$ yum install -y kernel-devel gcc
$ chmod +x NVIDIA~.run
How to install NVIDIA in Ubuntu
How to install NVIDIA on Ubuntu is as follows: 1
## ppa:graphics-drivers/ppa: 최신형 nVidia 그래픽 카드 드라이버 지원.
## https://launchpad.net/~graphics-drivers/+archive/ubuntu/ppa
$ sudo apt-add-repository -y ppa:graphics-drivers/ppa
$ sudo apt-cache search nvidia
## 설치.
$ sudo apt-get install nvidia-352 nvidia-352-dev
## 재부팅.
$ sudo reboot
Or
Troubleshooting
Screen Blanks/Monitor Turns Off
A black screen appears after installation. You can install it manually as below.
- Linux Nvidia Graphic Card (Multi/Dual Graphic Card, Xinerama, Blackscreen)
- How to boot without problems when an NVidia graphics card conflicts with Ubuntu
For reference, in my case I used the Geforce GTX 750 ti Driver, and since it did not install properly, I proceeded as follows.
Add the following to the end of the /etc/modprobe.d/blacklist.conf file.
For reference, check the list of installed modules with the following command:
If the NVIDIA graphics card does not work or performs poorly, add the following to the end of the /etc/default/grub file. 2
## Find it!
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
## And change it to
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"
Update GRUB.
(For reference, the GRUB setting above can be reverted after installing the NVIDIA graphics card driver.)
Stop the service related to the graphics card currently in use and reboot.
## 관련 서비스가 뭔지 확인한다. -> gdm, gdm3, lightdm 같은 것들
sudo service --status-all
## Stop service.
$ sudo gdm service stop
## or
$ sudo service gdm3 stop
## or
$ sudo service lightdm stop
After installing the graphics card driver, edit xorg.profile to suit your setup and reboot.
If the screen still turns off, refer to this page and try the following.
- Switch to the console by using
ctrl+alt+F1, or reboot and select recovery mode from the GRUB menu. - Open and edit xorg.conf like this:
sudo nano /etc/X11/xorg.conf. - Find the line that says:
Section "Screen" - Insert a new line that says:
Option "UseDisplayDevice" "DFP". - Save the file. If you had to restart into recovery mode, type reboot, otherwise restart your display using
sudo /etc/init.d/gdm restart.3
Bash script in Ubuntu 14.04
#!/bin/bash
if [[ $(id -u) -ne 0 ]]; then
echo "Please run as root."
exit 1
fi
apt-get purge -y nvidia*
apt-get purge -y xserver-xorg-video-nouveau
BLACKLIST_PATH=/etc/modprobe.d/blacklist.conf
GRUB_PATH=/etc/default/grub
echo "Update $BLACKLIST_PATH"
echo "blacklist vga16fb" >> $BLACKLIST_PATH
echo "blacklist nouveau" >> $BLACKLIST_PATH
echo "blacklist rivafb" >> $BLACKLIST_PATH
echo "blacklist nvidiafb" >> $BLACKLIST_PATH
echo "blacklist rivatv" >> $BLACKLIST_PATH
echo "Update $GRUB_PATH"
sed -i.temp 's/^\(GRUB_CMDLINE_LINUX_DEFAULT=.*\)"$/\1 nomodeset"/g' $GRUB_PATH
update-grub
echo "Run reboot."
Next step:
#!/bin/bash
if [[ $(id -u) -ne 0 ]]; then
echo "Please run as root."
exit 1
fi
service lightdm stop
if [[ $? -ne 0 ]]; then
echo "Fail service lightdm stop."
exit 1
fi
echo "Download NVIDIA Linux driver."
curl -O http://kr.download.nvidia.com/XFree86/Linux-x86_64/361.45.11/NVIDIA-Linux-x86_64-361.45.11.run
if [[ $? -ne 0 ]]; then
echo "Fail download."
exit 1
fi
chmod +x NVIDIA-Linux-x86_64-361.45.11.run
./NVIDIA-Linux-x86_64-361.45.11.run
in CentOS
- [Recommended] How to install Nvidia drivers in CentOS 7 - Tutorial 4
First, update the kernel.
If Nouveau exists5, add it to the Blacklist.
- Add the
rdblacklist=nouveauargument to theGRUB_CMDLINE_LINUXattribute in the/etc/default/grubfile. - Add
blacklist nouveauto the/etc/modprobe.d/blacklist.conffile.
Now just update GRUB. For this too, choose one of the two methods. 6
Fails to boot normally after a kernel patch
In this case, reinstalling the NVIDIA graphics driver may fix it. Proceed in the following order.
- Add the nomodeset option to grub.
- Update grub again using
update-grub. - Stop the lightdm service.
- Reinstall the NVIDIA graphics driver.
An alternate method of installing the NVIDIA driver was detected
NVIDIA Accelerated Graphics Driver for Linux-x86_64 (580.105.08)
An alternate method of installing the NVIDIA driver was detected. (This is usually a package provided by your distributor.) A
driver installed via that method may integrate better with your system than a driver installed by nvidia-installer.
Please review the message provided by the maintainer of this alternate installation method and decide how to proceed:
Continue installation Abort installation
The NVIDIA driver provided by Ubuntu can be installed by launching the "Software & Updates" application, and by selecting the
NVIDIA driver from the "Additional Drivers" tab.
Translation:
- NVIDIA Accelerated Graphics Driver (for Linux-x86_64) (580.105.08)
- Another method of installing the NVIDIA driver was detected. (This is usually a package provided by the distribution.)
- A driver installed this way may integrate better with the system than a driver installed with nvidia-installer.
- Review the message provided by the maintainer of this alternate installation method and choose one of the following.
- The NVIDIA driver provided by Ubuntu can be installed by launching the "Software & Updates" application
- and selecting the NVIDIA driver in the "Additional Drivers" tab.
Bottom line: just press the "Continue" button.
ERROR: An error occurred while performing the step
ERROR: An error occurred while performing the step: "Building kernel modules". See /var/log/nvidia-installer.log for details.
- Error: An error occurred while performing the "Building kernel modules" step. See the /var/log/nvidia-installer.log file for details.
ERROR: An error occurred while performing the step: "Checking to see whether the nvidia kernel module was successfully built".
See /var/log/nvidia-installer.log for details.
- Error: An error occurred while performing the "Checking whether the NVIDIA kernel module was successfully built" step. See the /var/log/nvidia-installer.log file for details.
Bottom line: check the /var/log/nvidia-installer.log file.
=== error: unrecognized command-line option '-ftrivial-auto-var-init=zero' ===
cc: error: unrecognized command-line option '-ftrivial-auto-var-init=zero'
290 make[3]: *** [scripts/Makefile.build:243: /tmp/makeself.YWzjR1r1/NVIDIA-Linux-x86_64-580.105.08/kernel/nvidia/nv-platform.o] Error 1
...
This feature requires GCC 12 or later. Check with the gcc --version command.
See Alternatives#GCC 12 for details.
WARNING: Unable to determine the path to install the libglvnd EGL vendor library config files
WARNING: Unable to determine the path to install the libglvnd EGL vendor library config files. Check that you have pkg-config and the libglvnd development libraries installed, or specify a path with --glvnd-egl-config-path.
- Warning: Unable to determine the installation path for the libglvnd EGL vendor library configuration files. Check that pkg-config and the libglvnd development libraries are installed, or specify a path with the
--glvnd-egl-config-pathoption.
Would you like to run the nvidia-xconfig utility to automatically update your X configuration file so that the NVIDIA X driver will be used when you restart X?
Would you like to run the nvidia-xconfig utility to automatically update your X configuration file so that the NVIDIA X driver will be used when you restart X? Any pre-existing X configuration file will be backed up.
- Would you like to run the nvidia-xconfig utility to automatically update the X configuration file so that the NVIDIA X driver is used when X restarts? The existing X configuration file will be backed up.
See also
Favorite site
- CentOS 7にNVIDIA GeForce GTX TITAN Xを導入
- [Recommended] NVIDIA LINUX : how to install
- Ubuntu 14.04 & Nvidia GTX 960
-
How To : Install NVIDIA 346.59 Graphics Drivers in Ubuntu/Linux Mint Systems -
Install Nvidia Driver 346.59 in Ubuntu from PPA - Installing the nvidia driver on Ubuntu 14.04
- nvidia-331 drivers gives black screen at startup
- [Recommended] 3 ways to install the nvidiqa graphics driver on Linux Mint and Ubuntu 7
- Ubuntu 14.04 install NVIDIA driver
- 3 ways to install the nvidia graphics card driver on Linux Mint and Ubuntu
- Installing the nvidia driver on Ubuntu 14.04
- [Recommended] BinaryDriverHowto/Nvidia
References
-
(For reference, after installing it properly this way, the issue where only a black screen appeared when switching to a virtual console was resolved) ↩
-
For a detailed explanation of the added
nomodeset, see here. ↩ -
How_to_install_Nvidia_drivers_in_CentOS_7_-_Tutorial.pdf ↩
-
Can be checked with
lsmod | grep nouveau↩ -
If the
grub.cfgfile below does not exist, use thesudo grub2-mkconfig -o /boot/grub2/grub.cfgcommand instead. ↩ -
How_to_install_nvidia_graphic_driver_from_the_Ubuntu_and_Mint.pdf ↩