How to change default system graphics intel to nvidia P40 on RHEL 7

Dear Friends,

How to change default system graphics intel to nvidia P40 on RHEL 7

System is running on init 5 on KDE Desktop

nvidia-smi

Thu Jan 9 10:49:54 2020
±----------------------------------------------------------------------------+
| NVIDIA-SMI 418.87.01 Driver Version: 418.87.01 CUDA Version: 10.1 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Tesla P40 On | 00000000:18:00.0 Off | 0 |
| N/A 24C P8 9W / 250W | 0MiB / 22919MiB | 0% Default |
±------------------------------±---------------------±---------------------+
| 1 Tesla P40 On | 00000000:AF:00.0 Off | 0 |
| N/A 25C P8 9W / 250W | 0MiB / 22919MiB | 0% Default |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| No running processes found |
±----------------------------------------------------------------------------+

No /bin/X process is running

also got an issue with startx command (“segmentation fault”) details given below)

startx

xauth: file /root/.serverauth.46761 does not exist

X.Org X Server 1.19.5
Release Date: 2017-10-12
X Protocol Version 11, Revision 0
Build Operating System: 2.6.32-696.18.7.el6.x86_64
Current Operating System: Linux visualization 3.10.0-862.el7.x86_64 #1 SMP Wed Mar 21 18:14:51 EDT 2018 x86_64
Kernel command line: BOOT_IMAGE=images/visualization-image/vmlinuz initrd=images/visualization-image/initrd rdblacklist=nouveau ip=172.21.3.106:172.21.3.254:172.21.3.254:255.255.254.0 BOOTIF=01-a0-42-3f-3b-4f-98
Build Date: 13 February 2018 02:39:52PM
Build ID: xorg-x11-server 1.19.5-5.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.2.log”, Time: Tue Jan 7 17:43:16 2020
(==) Using config file: “/etc/X11/xorg.conf”
(==) Using config directory: “/etc/X11/xorg.conf.d”
(==) Using system config directory “/usr/share/X11/xorg.conf.d”
(EE)
(EE) Backtrace:
(EE) 0: /usr/bin/X (xorg_backtrace+0x55) [0x555555702135]
(EE) 1: /usr/bin/X (0x555555554000+0x1b1ec9) [0x555555705ec9]
(EE) 2: /lib64/libpthread.so.0 (0x2aaaad1e0000+0xf680) [0x2aaaad1ef680]
(EE)
(EE) Segmentation fault at address 0x0
(EE)
Fatal server error:
(EE) Caught signal 11 (Segmentation fault). Server aborting
(EE)
(EE)
Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.
(EE) Please also check the log file at “/var/log/Xorg.2.log” for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error

BR\
nvidia-bug-report.log.gz (1.76 MB)