Nvidia legacy driver 340 not starting during boot / start of X server


#1

My laptop has a Nvidia GeForce 8600M GT graphics card.

When using the nouveau driver package, my screen freezes up after 10 to 30 minutes. I can still log in from my Raspberry Pi.
To avoid this I tried to use

services.xserver.videoDrivers = [ "nvidiaLegacy340" ];

in my configuration.nix. But then, the X server won’t start. When running

systemctl status display-manager.service

I get

display-manager.service - X11 Server
   Loaded: loaded (/nix/store/6nplrcxm1dgchw5hswgzglqhhvs50s9b-unit-display-manager.service/display-manager.service; linked; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2019-01-19 15:14:40 CET; 2min 29s ago
  Process: 708 ExecStart=/nix/store/3aw6j5n9zq9s9s0f7hibf6bdky2jr4yv-unit-script-display-manager-start (code=exited, status=1/FAILURE)
  Process: 706 ExecStartPre=/nix/store/5rwhshh5ik39cfla97jpxlb57lypg29x-unit-script-display-manager-pre-start (code=exited, status=0/SUCCESS)
 Main PID: 708 (code=exited, status=1/FAILURE)

Jan 19 15:14:40 hackbetz systemd[1]: display-manager.service: Service RestartSec=200ms expired, scheduling restart.
Jan 19 15:14:40 hackbetz systemd[1]: display-manager.service: Scheduled restart job, restart counter is at 3.
Jan 19 15:14:40 hackbetz systemd[1]: Stopped X11 Server.
Jan 19 15:14:40 hackbetz systemd[1]: display-manager.service: Start request repeated too quickly.
Jan 19 15:14:40 hackbetz systemd[1]: display-manager.service: Failed with result 'exit-code'.
Jan 19 15:14:40 hackbetz systemd[1]: Failed to start X11 Server.

The files seem all to be there. Probably starting lightdm fails:

[root@hackbetz:/home/mrtn]# cat /nix/store/3aw6j5n9zq9s9s0f7hibf6bdky2jr4yv-unit-script-display-manager-start
#! /nix/store/a9i0a06gcs8w9fj9nghsl0b6vvqpzpi4-bash-4.4-p23/bin/bash -e
export PATH=/nix/store/pn7ni2kmc92pl3ndhnar2l1dxzqq9m8f-lightdm-1.28.0/sbin:$PATH
exec /nix/store/pn7ni2kmc92pl3ndhnar2l1dxzqq9m8f-lightdm-1.28.0/sbin/lightdm

What can I do? Would be really great if someone could give me some hint or advice.

My laptop is a MacBook pro from mid 2008.


#2

I’d look at /var/log/X.0.log


#3

Thanks, I did:

[    38.488] (EE) NVIDIA(GPU-0): Failed to initialize the NVIDIA GPU at PCI:1:0:0.  Please
[    38.488] (EE) NVIDIA(GPU-0):     check your system's kernel log for additional error
[    38.488] (EE) NVIDIA(GPU-0):     messages and refer to Chapter 8: Common Problems in the
[    38.489] (EE) NVIDIA(GPU-0):     README for additional information.
[    38.489] (EE) NVIDIA(GPU-0): Failed to initialize the NVIDIA graphics device!
[    38.489] (EE) NVIDIA(0): Failing initialization of X screen 0

When looking up the mentioned page of “Common Problems”, they recommended to try some kernel parameters. I did (and here I am ultimately happy to have generations!!) and either they didn’t have any use, or they stopped the system from booting to X or at all.
They recommend setting one or a combination of

pci=noacpi
pci=biosirq
noapic
acpi

By looking into the systemd journal I found something interesting. It seems that - even without any of the above mentioned options - the kernel can not load all required modules:

Jan 20 11:31:58 hackbetz systemd-modules-load[447]: Failed to find module 'snd_pcm_oss'
Jan 20 11:31:58 hackbetz systemd-modules-load[447]: Failed to find module 'nvidia-uvm'
Jan 20 11:32:01 hackbetz systemd-modules-load[447]: Inserted module 'nvidia'
Jan 20 11:32:01 hackbetz systemd-modules-load[447]: Failed to find module 'nvidia_modeset'
Jan 20 11:32:01 hackbetz systemd-modules-load[447]: Failed to find module 'nvidia_drm'