Tuesday, April 25, 2023

installing NVIDIA graphics card in Centos 7-6 linux

First download NVIDIA driver from official website.

Now blacklist "nouveau" driver shipped with Linux OS which is responsible for graphical display.  Disable it to install NVIDIA graphics card software. 

because "nouveau" is default driver for graphics card and is shipped with OS, it necessary to disable it. Otherwise OS does not allow to install our graphics card driver. In CentOS 6, to disable "nouveau" graphics driver, just change name of "nouveau.ko" to your choosen name as mine is "nouveau.ko.original.backup"

Path to "nouveau.ko"  graphics driver in Centos 6 is :-

dir : "/lib/modules/2.6.32-754.el6.x86_64/kernel/drivers/gpu/drm/nouveau/"

# mv nouveau.ko nouveau.ko.original.backup

You do not need to blacklist, because if you rename it, at boot time OS can not find it by its original name. After renaming that, run "dracut" command as given below. Without it if you restart OS then OS will not boot even in emergency mode. So do as follows.

then run following commands :-

# dracut /boot/initramfs-$(uname -r).img $(uname -r) --force 

in centos 7 do only this to disable nouveau.ko

add "rdblacklist=nouveau" at last after "rhgb quiet" in grub.cfg.

as in this :-

linux16 /vmlinuz-3.10.0-862.el7.x86_64 root=UUID=0ec7e49f-5f1c-43db-be98-7f0d008a8514 ro crashkernel=auto rhgb quiet rdblacklist=nouveau


then run following commands :-

# dracut /boot/initramfs-$(uname -r).img $(uname -r) --force

then

# reboot 

boot in runlevel 3 mode, to do that :-

in boot menu highlight Linux 7 boot option then press "e", go down and add "3" after "rhgb quiet rdblacklist=nouveau" 

as :-


linux16 /vmlinuz-3.10.0-862.el7.x86_64 root=UUID=0ec7e49f-5f1c-43db-be98-7f0d008a8514 ro crashkernel=auto rhgb quiet rdblacklist=nouveau 3

and boot by pressing keys : Ctrl + X

 after getting command prompt login  as root then go to directory where NVIDIA driver is stored and run following command for driver :-

# ./NVIDIA-Linux-x86_64-352.30.run

here above is driver of your nvidia graphics card downloaded from internet.

# reboot

and NVIDIA-Linux is installed.

following command

 $ nvidia-xconfig 

will opens management window of NVIDIA card.

Most probably it may work.

you may add NVIDIA command in Main menu. This is I given already in previous blog.

You can add "nvidia.desktop" file in "/usr/share/applications/" folder to add nvidia shortcut in man menu. How to that I said it in one of previous blog search it.

No comments:

Post a Comment