Nvidia driver/CUDA installation causes centos 7 to hang on boot. unable to access user interface.

Below are the outputs of above commands—
Please suggest what am I supposed to do now?

[root@localhost X11]# X -configure

X.Org X Server 1.19.3
Release Date: 2017-03-15
X Protocol Version 11, Revision 0
Build Operating System: 3.10.0-514.16.1.el7.x86_64
Current Operating System: Linux localhost.localdomain 3.10.0-693.2.2.el7.x86_64 #1 SMP Tue Sep 12 22:26:13 UTC 2017 x86_64
Kernel command line: BOOT_IMAGE=/vmlinuz-3.10.0-693.2.2.el7.x86_64 root=/dev/mapper/cl-root ro crashkernel=auto rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgb quiet LANG=en_US.UTF-8 nouveau.modeset=0 rd.driver.blacklist=nouveau video=vesa:off
Build Date: 05 August 2017 06:19:43AM
Build ID: xorg-x11-server 1.19.3-11.el7
Current version of pixman: 0.34.0
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (–) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: “/var/log/Xorg.0.log”, Time: Thu Oct 26 11:07:27 2017
List of video drivers:
ati
dummy
intel
nouveau
nvidia
qxl
radeon
v4l
vmware
modesetting
fbdev
vesa
(++) Using config file: “/root/xorg.conf.new”
(==) Using config directory: “/etc/X11/xorg.conf.d”
(==) Using system config directory “/usr/share/X11/xorg.conf.d”
Number of created screens does not match number of detected devices.
Configuration failed.
(EE) Server terminated with error (2). Closing log file.
///////////////////////////////////////////////////////////

[root@localhost X11]# Xorg -configure :0

X.Org X Server 1.19.3
Release Date: 2017-03-15
X Protocol Version 11, Revision 0
Build Operating System: 3.10.0-514.16.1.el7.x86_64
Current Operating System: Linux localhost.localdomain 3.10.0-693.2.2.el7.x86_64 #1 SMP Tue Sep 12 22:26:13 UTC 2017 x86_64
Kernel command line: BOOT_IMAGE=/vmlinuz-3.10.0-693.2.2.el7.x86_64 root=/dev/mapper/cl-root ro crashkernel=auto rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgb quiet LANG=en_US.UTF-8 nouveau.modeset=0 rd.driver.blacklist=nouveau video=vesa:off
Build Date: 05 August 2017 06:19:43AM
Build ID: xorg-x11-server 1.19.3-11.el7
Current version of pixman: 0.34.0
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (–) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: “/var/log/Xorg.0.log”, Time: Thu Oct 26 11:09:24 2017
List of video drivers:
ati
dummy
intel
nouveau
nvidia
qxl
radeon
v4l
vmware
modesetting
fbdev
vesa
(++) Using config file: “/root/xorg.conf.new”
(==) Using config directory: “/etc/X11/xorg.conf.d”
(==) Using system config directory “/usr/share/X11/xorg.conf.d”
Number of created screens does not match number of detected devices.
Configuration failed.
(EE) Server terminated with error (2). Closing log file.

Dear Shubhra,
Now, you check whether xorg.conf.new is located at /root.
Then you can do the remained operations according to the above message (i.e. the third step).
Good luck!
Youshan

Dear ysliu,

xorg.conf.new file is created in /root folder. I copied this file (xorg.conf.new) to /etc/X11/ and I made changes suggested by you mentioned below:-

Step:
#vim xorg.conf
In the Section “Files”:
Adding ModulePath “usr/lib64/nvidia/modules” below the ModulePath “/usr/lib64/xorg/modules”
In the Section “InputDevice”
Replacing the kbd with nvidia

and removed the previous file i.e xorg.conf from /etc/X11/

Still I am getting the same problem, after reboot ( msg appeared something has gone wrong ). I have to login from another machine to work on that machine.

Do I need to try this command? If yes then what is the path?
#X -configure xorg.conf

Dear Shubhra,
After the above operations (do not try that command), I can enter my system.
Please see the log file.
Maybe your problem is different from mine.
Youshan

Dear Ysliu,

My problem has been solved. Thanks for your help!!

Dear Shubhra,

how could you fix that? Mine stoped at “Starting Switch Root…”

and just hang there… help me pls

Dear supremeoape,

I followed the steps mentioned by ysliu and my problem was resolved. Kindly check the steps. Hope you will find solution there!!

Hello txbob,

I have the almost same situation as MrMayor, so I tried your command as “echo -e “blacklist nouveau\noptions nouveau modeset=0” > /etc/modprobe.d/disable-nouveau.conf
dracut --force”

However, after rebooting, I even can’t enter the runlever 3, the screen became totally black with a cursor signal flashed in the left corner every 10 seconds. What should I do? And no response to the keyboard.

I used to have K4200 and Tesla. But now I replaced the two display cards with two GTX 1080 Ti cards for GPU usage. However, after I installed cuda 8.0 toolkit, the x window crashed. Before I run your commands above, I can use the command line with “init 3”.

Dear Shubhra,
Now, I install cuda on another machine. I still have the same probelm.
Xorg -configure :0
I get some errors.
How you solved it.
Thanks a lot!
youshan

Dear Shubhra,
When I install cuda on another computer (GPU: Titan Xp).
I have the same error like yours:
Number of created screens does not match number of detected devices.
Configuration failed.
How did you solve this problem?
Thanks a lot!
Youshan