[SOLVED] Can't startx after installing non-free nvidia drivers.
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Can't startx after installing non-free nvidia drivers.
I'm having trouble starting X once I've installed the non free nvidia drivers. I'm using a fairly minimal Debian 10, when installing the distro I refuse a desktop environment and then install openbox and xinit. I start X either by calling startx, or installing lightdm.
Following the advice of on Debian Wiki at https://wiki.debian.org/NvidiaGraphicsDrivers for Debian 10 "Buster" I end up with a blacklisted nouveau. When I call startx I get an error like "cannot start in framebuffer mode".
I've installed the headers for my kernel, but I suspect that the error is something to do with having the wrong kernel or wrong kernel headers for this setup.
I realize that I may not have followed the instructions in Debian Wiki correctly, there's a lot of info on that page. To clarify, I have added non-free and contrib in my apt sources, and updated apt. I've installed non-free-misc and nvidia-driver, as recommended by nvidia-detect and the wiki. I've also installed the kernel headers for my kernel (linux-headers-4.19.0-14-amd64, linux-headers-4.19.0-14-common, linux-headers-amd64).
Some of the confusion might be in the required driver, Debian Wiki says that Nvidia GeForce GT 1030 is supported by drivers 460.39 (nvidia-driver in buster-backports non-free contrib), 418.181.07 (nvidia-driver in buster non-free contrib), and 390.138 (nvidia-legacy-390xx-driver in buster non-free contrib).
I seem to get trouble performance from nouveau, worse than no GPU according to glmark2.
I've attached the outputs from the recommended system calls (lspci, uname, lshw, nvidia-detect).
When I tried to install the proprietary drivers from the Nvidia website, the install fails as it can't find kernel-drm. I'll be happy to install the non-free drivers, or the website drivers, (or even nouveau if it gives decent performance).
Tricky, I've popped back to nouveau as I use this machine for work. I've attached a current dmesg in case it's useful. Else, I can try to reproduce the issue but I'd need to get back to a working state before monday.
Let me know if a dmesg with the error reproduced is essential and I'll do it.
Here is a standard sources.list for a system running the Stable version of Debian:
Code:
# Security updates
deb http://security.debian.org/ buster/updates main contrib non-free
deb-src http://security.debian.org/ buster/updates main contrib non-free
## Debian mirror
# Base repository
deb https://deb.debian.org/debian buster main contrib non-free
deb-src https://deb.debian.org/debian buster main contrib non-free
# Stable updates
deb https://deb.debian.org/debian buster-updates main contrib non-free
deb-src https://deb.debian.org/debian buster-updates main contrib non-free
# Stable backports
deb https://deb.debian.org/debian buster-backports main contrib non-free
deb-src https://deb.debian.org/debian buster-backports main contrib non-free
The stdout was long (243 lines, so it's attached as text)
I saw some warning lines..
Code:
Job for nvidia-persistenced.service failed because the control process exited with error code.
See "systemctl status nvidia-persistenced.service" and "journalctl -xe" for details.
Code:
W: Possible missing firmware /lib/firmware/nvidia/gv100/acr/ucode_load.bin for module nouveau
The output of "systemctl status nvidia-persistenced.service" follows:
Code:
# sudo systemctl status nvidia-persistenced.service
nvidia-persistenced.service - NVIDIA Persistence Daemon
Loaded: loaded (/lib/systemd/system/nvidia-persistenced.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2021-02-27 13:20:57 GMT; 1min 44s ago
Process: 10355 ExecStart=/usr/bin/nvidia-persistenced --user nvpd (code=exited, status=1/FAILURE)
Process: 10357 ExecStopPost=/bin/rm -rf /var/run/nvidia-persistenced (code=exited, status=0/SUCCESS)
Feb 27 13:20:57 platina systemd[1]: Starting NVIDIA Persistence Daemon...
Feb 27 13:20:57 platina nvidia-persistenced[10356]: Started (10356)
Feb 27 13:20:57 platina nvidia-persistenced[10356]: Failed to open libnvidia-cfg.so.1: libnvidia-cfg.so.1: cannot open shared object file: No such file or dire
Feb 27 13:20:57 platina systemd[1]: nvidia-persistenced.service: Control process exited, code=exited, status=1/FAILURE
Feb 27 13:20:57 platina nvidia-persistenced[10355]: nvidia-persistenced failed to initialize. Check syslog for more details.
Feb 27 13:20:57 platina nvidia-persistenced[10356]: Shutdown (10356)
Feb 27 13:20:57 platina systemd[1]: nvidia-persistenced.service: Failed with result 'exit-code'.
Feb 27 13:20:57 platina systemd[1]: Failed to start NVIDIA Persistence Daemon.
Regarding the error ["Possible missing firmware /lib/firmware/nvidia/gv100/acr/ucode_load.bin for module nouveau" I searched apt for the file ucode_load.bin
None of which are gv100/acr/ucode_load.bin, and I have firmware-misc-nonfree installed anyway. Plus I'm not sure if I'm bothered about missing firmweare for nouveau.
I then purged nvidia-driver, ran 'apt autoremove' installed libnvidia-legacy-390xx-cfg1 and then reinstalled nvidia-driver to see if anything was different.
That didn't show any new errors, but still the nvidia-persistenced service wouldn't start
Code:
amartin@platina:~$ sudo systemctl status nvidia-persistenced.service
nvidia-persistenced.service - NVIDIA Persistence Daemon
Loaded: loaded (/lib/systemd/system/nvidia-persistenced.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2021-02-27 13:26:42 GMT; 1min 12s ago
Process: 31245 ExecStart=/usr/bin/nvidia-persistenced --user nvpd (code=exited, status=1/FAILURE)
Process: 31251 ExecStopPost=/bin/rm -rf /var/run/nvidia-persistenced (code=exited, status=0/SUCCESS)
Feb 27 13:26:42 platina systemd[1]: Starting NVIDIA Persistence Daemon...
Feb 27 13:26:42 platina nvidia-persistenced[31246]: Started (31246)
Feb 27 13:26:42 platina nvidia-persistenced[31246]: Failed to query NVIDIA devices. Please ensure that the NVIDIA device files (/dev/nvidia*) exist, and that user 113 has read and write permissions for those files.
Feb 27 13:26:42 platina nvidia-persistenced[31246]: Shutdown (31246)
Feb 27 13:26:42 platina nvidia-persistenced[31245]: nvidia-persistenced failed to initialize. Check syslog for more details.
Feb 27 13:26:42 platina systemd[1]: nvidia-persistenced.service: Control process exited, code=exited, status=1/FAILURE
Feb 27 13:26:42 platina systemd[1]: nvidia-persistenced.service: Failed with result 'exit-code'.
Feb 27 13:26:42 platina systemd[1]: Failed to start NVIDIA Persistence Daemon.
I'll restart now, and post dmesg if X doesn't start. If it does start I'll say thanks!
I won't be able to post until later today though.
Cheers,
Andrew
Last edited by AndrewMartin; 02-27-2021 at 12:26 PM.
Here's my angle.
I've tried in the distant past to install a minimal Debian and then build it up myself to try and keep it lean and mean. I could never get everything to work like a generic Debian install, learned my lesson and just accept the default setup and I'm not wasting time troubleshooting. Apparently you need this unit for work...
Not the route I would take based on my past experiences on a computer that needs to work.
You don't mention if this is an Optimus system or not. I don't have Optimus, but do have the ability to use either Intel or Nvidia graphics. I get "nvidia-persistenced.service" errors when I boot with Intel graphics. Because the Nvidia graphics device is not present/non-existing when I boot with Intel, but all Nvidia stuff is installed. So perhaps you have Optimus and need to install other stuff because with Optimus systems, everything goes through Intel graphics, Intel graphics are the base graphics and Nvidia is only used when needed.
You have the proper firmware installed, you'll find the file at---> /lib/firmware/nvidia/gv100/acr/ucode_load.bin. When installing nvidia-driver, proper headers and build essentials will be downloaded and installed/configured automatically.
Normally Debian installs nvidia-driver without hickups on any of my systems. The problems you describe suggest either you are missing some X libraries or other libraries due to minimal desktop install, or you have Optimus and need to install other stuff.
It's a little tower, it requires a low profile graphics card. I thought optimus was only a concern for laptops, but I admit I'd not heard of optimus at all before starting to troubleshoot this graphics card.
It's possible I'm missing certain packages, I felt the install was fairly standard, I just didn't want to choose a desktop environment because Openbox wasn't on the list and that's my preference since I used Crunchbang about a decade ago.
Do you think there might be some xorg-* packages I'm missing?
This is what gets posted to stderr when I run startx.
Code:
X.Org X Server 1.20.4
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.19.0-12-amd64 x86_64 Debian
Current Operating System: Linux platina 4.19.0-14-amd64 #1 SMP Debian 4.19.171-2 (2021-01-30) x86_64
Kernel command line: BOOT_IMAGE=/vmlinuz-4.19.0-14-amd64 root=/dev/mapper/platina--vg-root ro quiet
Build Date: 01 December 2020 05:59:57PM
xorg-server 2:1.20.4-1+deb10u2 (https://www.debian.org/support)
Current version of pixman: 0.36.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: Sat Feb 27 18:31:34 2021
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
xf86EnableIOPorts: failed to set IOPL for I/O (Operation not permitted)
(EE)
Fatal server error:
(EE) Cannot run in framebuffer mode. Please specify busIDs for all framebuffer devices
(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.0.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
If I try booting straight into graphical mode, I just get a flashing cursor in the top left of an otherwise black screen.
I've attached the new dmesg.
To get back to a graphical environment I had to 'apt purge *nvidia*', unblacklist nouveau and reboot.
From this thread it seems like adding backports to my apt sources, and checking I'm not missing any graphical/desktop packages might help.
When the screen goes blank are you able to switch to tty2 and run startx or xinit manually? It may give some additional errors which could help troubleshoot
nv drivers or nvidia drivers? "legacy" (cough) sounds like driver nv.
YOU DIDN'T MENTION IF IT'S AN AGP. YOU MUST HAVE KERNEL CONFIGURED FOR YOUR CARD AGP OPTIONS. debian usually does that. but it's still important you check they didn't do something silly: that the agp kernel module is int he kernel (and any modules loaded when you boot in /etc/modules). If it's PCIe, then don't do that.
NVidia releases quality drivers for Xorg not for debian. You need the NVidia driver for the version of Xorg your runnning. Get the driver from NVidia.
make sure your xorg.conf has driver as "nv" loaded: but really follow instructions that the NVIDIA driver come with. completely ignore debian's instructions.
and start X using "X" not startx, just to be sure none of the scripts are hacking your startup while your testing.
That is all. It will work if it ever did. It probably did if NVidia said it did.
fb must be selected as a kernel option, also AGP. you have to have certain "fb console" set up if you intend to have a desktop and text consoles (meaning, not booting straight into X, and since yo9u don't know how to boot straight into X, i'll assume that you want consoles)
fb consoles are tricky.
"old video card + AGP + needs fbconsole" == TROUBLES
it works - but you need know some ins and outs and ... it's really hacky.
let me be REALLY CLEAR: if your card is AGP and not exactly supported by the kernel IT WILL NEVER WORK. so check that first if your card is AGP. (or considered buying a used pcie card off amazon that's a little newer?)
------------------------
if you were loading a NEW Xorg server with SEMI-RECENT Nvidia card and the "nvidia" driver PCIe. "it just works". possibly one driver option to place.
I believe GeForce GT 1030 on pcie is "nvidia" driver not "nv driver". I could be wrong.
"nv" driver will NOT work with "1050 pcie" and "nvidia" driver may require "nvidiamodset" option.
your saying 1030 and talking about backporting scares me frankly
Also notice kernel framebuffer is incompatible with nvidia-drivers, so you should disable it. Please refer here for a small guide (intended for Gentoo, but still usefull if you need to re-compile kernel) https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers
I've added debian-backports to my sources, though I understand that to install something from backports that it also present in stable, I'll have to call "apt install -t debian-backports" and I've not done that yet as I'm worried that having one package from backports and everything else from stable will have incompatilibities. I'm happy for someone to put my mind to rest, or tell me which two or three packages need to be installed from backports, if any.
As recommended by Brains, I've added the line "install_items+=/lib/firmware/nvidia/gv100/acr/ucode_load.bin" to /etc/dracut.conf.d/02-nvfirmware.conf. The directory /etc/dravit.conf.d didn't exist so I had to create it.
The card is not AGP, it's PCI-E 3.0 x 16.
My /etc/X11/xorg.conf is empty but /etc/X11/xorg.conf.nvidia-auto (X configuration file generated by nvidia-xconfig) contains content, including the line 'Driver: "nvidia"'.
I've edited my previous post, apparently Debian uses hook scripts in /etc/initramfs-tools/hooks to include missing firmware.
Quote:
I searched apt for the file ucode_load.bin
According to Debian package search, firmware-misc-nonfree does not have nvidia/gv100/acr/ucode_unload.bin, but does have nvidia/gv100/acr/ucode_unload.bin
I had issues with Intel HD audio not working because root filesystem was not mounted yet when the firmware was required, including the firmware in the initramfs.img fixed that. But if the firmware does not exist, no sense trying to include it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.