Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
startx fails via NVIDIA kernel module due to nvidia-settings
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
csuckk
n00b
n00b


Joined: 21 Sep 2022
Posts: 3

PostPosted: Thu Sep 22, 2022 2:10 pm    Post subject: startx fails via NVIDIA kernel module due to nvidia-settings Reply with quote

Hi there,

I have been using gentoo with X-server and dwm as my WM successfully for 2 months now and had NVIDIA proprietary drivers installed as well with no real issues. Unfortunately I made the mistake of saving and overwriting some X configuration files after trying to enable 144hz refresh rate via the nvidia-settings program. After rebooting, startx would fail and even after removing the xorg.conf file from /etc/X11/ and relying on /etc/X11/xorg.conf.d/ for default configuration. Rather foolishly I tinkered around with a few config files to try and achieve a quick fix and after no luck tried to remove all my changes. I did this by manually keeping a copy of /etc/X11/ in my home directory after a few failed attempts and then restoring to this after more unsuccessful attempts. I certainly realise now how naive I was being and will be sure to maintain proper backups in the future. I have also attempted to re-emerge X server and nvidia drivers and made sure all packages on my system stay up to date whilst I try to fix this issue. I now have no xorg.conf file and I will show the contents of the files in /etc/X11/ that from my little knowledge of X server I think are relevant to pinpoint the issue.

Let me know if any other details would be helpful and thanks in advance for any replies/advice.

System Details

OS: Gentoo Base System release 2.8 x86_64
Kernel: 5.15.52-gentoo-dist
CPU: AMD Ryzen 9 5950X
GPU: NVIDIA GeForce GTX 970

Firstly, here is the output of running,

lspci | grep NVIDIA:

Code:
09:00.0 VGA compatible controller: NVIDIA Corporation GM204 [GeForce GTX 970] (rev a1)

09:00.1 Audio device: NVIDIA Corporation GM204  High Definition Audio Controller (rev a1)


Running,

lsmod | grep nvidia:

Code:
nvidia_drm                65536  0
nvidia_modeset          1105920  1 nvidia_drm
nvidia                 38518784  1 nvidia_modeset
drm_kms_helper           233472  1 nvidia_drm
DRM                      466944  4 drm_kms_helper,nvidia,nvidia_drm


X11 config files

/etc/X11/xorg.conf.d/20-nvidia.conf:

Code:
Section "Device"
        Identifier "Card0"
        Driver "nvidia"
        VendorName "NVIDIA Corporation"
        BoardName "NVIDIA GeForce GTX 970"
EndSection


(I have tried adding the line "Option "AllowEmptyInitialConfiguration" before attempting startx with no effect)

/etc/X11/xinit/xinit.d/95-nvidia-settings:

Code:
#!/bin/sh
/usr/bin/nvidia-settings --load-config-only


(I have tried commenting off this line before attempting startx with no effect)


Logs etc.

Logs were parsed through an ocr, so there may be a couple of mistakes I didn't catch after checking against the original logs.

After running startx as user "li2us":

Code:
hostname: Unknown host

X.Org X Server 1.21.1.4
X Protocol Version 11, Revision 0
Current Operating System: Linux gentoopc 5.15.52-gentoo-dist #1 SMP Sun Jul 3 05:21:48 -00 2022 x86_64
Kernel command line: BOOT_IMAGE=/vmlinuz-5.15.52-gentoo-dist root=UUID=2ebe4f89-bb00-415a-9bce-04188d39f96a ro

Current version of pixman: 0.40.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: "/home/li2us/.local/share/xorg/Xorg.O.log", Time: Thu Sep 22 15:13:27 2022
 (==) Using config directory: "/etc/X11/xorg.conf.d"
 (==) Using system config directory "/usr/share/X11/xorg.conf.d"
 r help. (EE) Please also check the log file at "/home/li2us/.1ocal/share/xorg/Xorg.O.log" for additional information.(EE) (EE)S
erver terminated with error (1). Closing log file.
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error


Contents of /home/li2us/.local/share/xorg/Xorg.0.log:

Code:
[ 456.002] 

X.Org X Server 1.21.1.4 

X Protocol Version 11, Revision 0 

[ 456.002] Current Operating System: Linux gentoopc 5.15.52-gentoo-dist #1 SMP Sun Jul 3 05:21:48 -00 2022 x86_64 

[ 456.002] Kernel command line: BOOT_IMAGE=/vmlinuz-5.15.52-gentoo-dist root=UUID=2ebe4f89-bb00-415a-9bce-04188d39f96a ro 

[ 456.003] 

[ 456.003] Current version of pixman: 0.40.0 

[ 456.004]   Before reporting problems, check http://wiki.x.org 

        to make sure that you have the latest version. 

[ 456.004] Markers: (--) probed. (**) from config file, (==) default setting,   

        (++) from command line, (!!) notice. (II) informational, 

 

        (WW) warning. (EE) error, (NI) not implemented, (??) unknown. 

[ 456.005] (==) Log file: "/home/li2us/.1ocal/share/xorg/Xorg.O.log", Time: Wed Sep 21 13:33:02 2022 

[ 456.006] (==) Using config directory: "/etc/X11/xorg.conf.d" 

[ 456.006] (==) Using system config directory "/usr/share/X11/xorg.conf.d" 

[ 456.006] (==) No Layout section. Using the first Screen section. 

[ 456.006] (==) No screen section available. Using defaults. 

[ 456.006] (**) |-->Screen "Default Screen Section" (0) 

[ 456.006] (**) | |-->Monitor "<default monitor>" 

[ 456.006] (==) No device specified for screen "Default Screen Section". 

        Using the first device section listed. 

[ 456.006] (**) | |-->Device "Card0" 

[ 456.006] (==) No monitor specified for screen "Default Screen Section". 

        Using a default monitor configuration. 

[ 456.006] (==) Automatically adding devices 

[ 456.006] (==) Automatically enabling devices 

[ 456.006] (==) Automatically adding GPU devices 

[ 456.006] (==) Automatically binding GPU devices 

[ 456.006] (==) Max clients allowed: 256, resource mask: 0x1fffff 

[ 456.006] (==) FontPath set to:   

         /usr/share/fonts/misc,   

         /usr/share/fonts/TTF, 

         /usr/share/fonts/OTF,   

         /usr/share/fonts/Type1,   

         /usr/share/fonts/100dpi,   

         /usr/share/fonts/75dpi 

[ 456.006] (==) ModulePath set to "/usr/lib64/xorg/modules" 

[ 456.006] (II) The server relies on udev to provide the list of input devices. 

          If no devices become available, reconfigure udev or disable AutoAddDevices   

[ 456.006] (II) Module ABI versions:   

[ 456.006]  X.Org ANSI C Emulation: 0.4 

[ 456.006]  X.Org Video Driver: 25.2 

[ 456.006]  X.Org Xlnput driver : 24.4 

[ 456.006]  X.Org Server Extension : 10.0 

[ 456.006] (++) using VT number 1 

[ 456.007] (II) systemd-logind: took control of session /org/freedesktop/login1/session/_31 

[ 456.007] (II) xfree86: Adding drm device (,dev/dri/card0) 

[ 456.007] (II) Platform probe for /sys/devices/pci0000:00/0000:00:03.1/0000:09:00.0/drm/card0 

[ 456.007] (II) systemd-logind: got fd for /dev/dri/card0 226:0 fd 10 paused 0 

[ 456.008] (--) PC1:*(9@0:0:0) 10de:13c2:10de:13c2 rev 161, Mem @ 0xfb000000/16777216, 0xd0000000/268435456, 0xe0000000/33554432, I/O @ 0x0000d000/128, BIOS 0x????????/131072 

[ 456.008] (II) LoadModule: "glx" 

[ 456.008] (II) Loading /usr/lib64/xorg/modules/extensions/libglx.so 

[ 456.009] (II) Module glx: vendor="X.Org Foundation" 

[ 456.009]   compiled for 1.21.1.4. module version = 1.0.0 

[ 456.009] ABI class: X.Org Server Extension. version 10.0 

[ 456.009] (II) LoadModule: "nvidia"

[ 456.009] (II) Loading /usr/lib64/xorg/modules/drivers/nvidia_drv.so 

[ 456.009] (II) Module nvidia: vendor=" NVIDIA Corporation" 

[ 456.009] compiled for 1.6.99.901, module version = 1.0.0 

[ 456.009] Module class: X.Org Video Driver   

[ 456.009] (II) NVIDIA dlloader X Driver 515.65.01 Wed Jul 20 13:50:46 UTC 2022   

[ 456.009] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs   

[ 456.009] (II) systemd-logind: releasing fd for 226:0   

[ 456.009] (II) Loading sub module "fb"

[ 456.009] (II) LoadModule: "fb"

[ 456.009] (II) Module "fb" already built-in   

[ 456.009] (II) Loading sub module "wfb"
 
[ 456.009] (II) LoadModule: "wfb"   

[ 456.009] (II) Loading /usr/lib64/xorg/modules/libwfb.so   

[ 456.009] (II) Module wfb: vendor="X.Org Foundation"   

[ 456.009] compiled for 1.21.1.4, module version = 1.0.0   

[ 456.009] ABI class: X.Org ANSI C Emulation, version 0.4   

[ 456.009] (II) Loading sub module "ramdac" 

[ 456.009] (II) LoadModule: "ramdac"   

[ 456.009] (II) Module "ramdac" already built-in   

[ 456.009] (EE) NVIDIA: Failed to initialize the NVIDIA kernel module. Please see the   

[ 456.009] (EE) NVIDIA:    system’s kernel log for additional error messages and   

[ 456.009] (EE) NVIDIA:    consult the NVIDIA README for details.   

[ 456.009] (EE) NVIDIA: Failed to initialize the NVIDIA kernel module. Please see the   

[ 456.009] (EE) NVIDIA:    system’s kernel log for additional error messages and   

[ 456.009] (EE) NVIDIA:    consult the NVIDIA README for details.   

[ 456.009] (EE) NVIDIA: Failed to initialize the NVIDIA kernel module. Please see the   

[ 456.009] (EE) NVIDIA:    system’s kernel log for additional error messages and   

[ 456.009] (EE) NVIDIA:    consult the NVIDIA README for details.   

[ 456.009] (EE) NVIDIA: Failed to initialize the NVIDIA kernel module. Please see the   

[ 456.009] (EE) NVIDIA:    system’s kernel log for additional error messages and   

[ 456.009] (EE) NVIDIA:    consult the NVIDIA README for details.   

[ 456.009] (EE) NVIDIA: Failed to initialize the NVIDIA kernel module. Please see the   

[ 456.009] (EE) NVIDIA:    system’s kernel log for additional error messages and   

[ 456.009] (EE) NVIDIA:    consult the NVIDIA README for details.   

[ 456.009] (EE) No devices detected.   

[ 456.009] (EE)   

[ 456.009] Fatal server error:   

[ 456.009] (EE) no screens found(EE)   

[ 456.009] (EE)     

[ 456.009] Please consult the The X.Org Foundation support   

[ 456.009] at http:/wiki.x.org for help.   

[ 456.009] (EE) Please also check the log file at “/home/li2us/.local/share/xorg/Xorg.0.log” for additional information.   

[ 456.009] (EE)   

[ 456.011] (EE) Server terminated with error
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54236
Location: 56N 3W

PostPosted: Sat Sep 24, 2022 6:37 pm    Post subject: Reply with quote

csuckk,

Welcome to Gentoo.

Code:
[ 456.009] (EE) NVIDIA: Failed to initialize the NVIDIA kernel module. Please see the   
[ 456.009] (EE) NVIDIA:    system’s kernel log for additional error messages and   
[ 456.009] (EE) NVIDIA:    consult the NVIDIA README for details.   


Please put dmesg onto a pastebin.

Your kernel .config file would be good too. That's another pastebin.

wgetpaste can help.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
csuckk
n00b
n00b


Joined: 21 Sep 2022
Posts: 3

PostPosted: Mon Sep 26, 2022 4:51 pm    Post subject: Reply with quote

Thanks for the welcome.

dmesg: https://dpaste.com/D9P2CZTH6

Kernel .config file: https://dpaste.com/ECDJ5K7NP

Appreciate it. :)
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2719

PostPosted: Mon Sep 26, 2022 5:12 pm    Post subject: Reply with quote

That dmesg is showing it's loading old nvidia-drivers-510.73.05 modules while the Xorg is showing 515.65.01 userspace, seem to be a mismatch.

Code:
[    4.135653] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  510.73.05  Sat May  7 05:30:26 UTC 2022
Code:
[ 456.009] (II) NVIDIA dlloader X Driver 515.65.01 Wed Jul 20 13:50:46 UTC 2022
Often due to building nvidia-drivers against the wrong kernel (may want to check `eselect kernel list` and ensure it's the one you're booting).

If not that, maybe an old initramfs is carrying the old modules when it shouldn't (mentioning given more typically it gives an error about the mismatch, so "maybe" there's some more going on).
Back to top
View user's profile Send private message
csuckk
n00b
n00b


Joined: 21 Sep 2022
Posts: 3

PostPosted: Tue Sep 27, 2022 11:18 am    Post subject: Reply with quote

Thanks very much for your reply. I am still confused about how to proceed, however.

eselect kernel list points to the wrong kernel as you suggested, it points to 5.15.59 as I can now see in the kernel config file, when I am running 5.15.52.

I am confused as 5.15.52 is not a given option in the list and I think that I did not correctly update the bootloader (GRUB) when I tried to upgrade my kernel.

The /boot/ folder I have contains just three files related to version 5.15.59 (config, System.map and vmlinuz) and does not contain the grub config folder/files.

On startup Grub only gives an option to boot via the old 5.15.52 kernel, but I am not sure how to go about correctly amending this.

I remember that I tried to upgrade the kernel whilst trying to fix the original issue, so I must've not completed the procedure correctly. It was my first time upgrading as well so I apologise if I am being naive.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum