Upgrading to 19.09 failed

Hello,

I’m getting a failure with nvidia drivers

patching file kernel/common/inc/nv-linux.h
patching file kernel/conftest.sh
Hunk #1 succeeded at 1948 (offset 42 lines).
applying patch /nix/store/h6lvgraa2v6qjvb5kd0rbz3r2pmgylm3-kernel-5.1.patch?h=42d50ef8d6048608d18bdf2c296dd335260c5a1a
patching file kernel/common/inc/nv-list-helpers.h
Hunk #2 FAILED at 93.
1 out of 2 hunks FAILED -- saving rejects to file kernel/common/inc/nv-list-helpers.h.rej
patching file kernel/nvidia-drm/nvidia-drm-connector.c
Hunk #1 FAILED at 30.
1 out of 1 hunk FAILED -- saving rejects to file kernel/nvidia-drm/nvidia-drm-connector.c.rej
patching file kernel/nvidia-drm/nvidia-drm-drv.c
Hunk #1 FAILED at 41.
1 out of 1 hunk FAILED -- saving rejects to file kernel/nvidia-drm/nvidia-drm-drv.c.rej
patching file kernel/nvidia-drm/nvidia-drm-encoder.c
Hunk #1 FAILED at 31.
1 out of 1 hunk FAILED -- saving rejects to file kernel/nvidia-drm/nvidia-drm-encoder.c.rej
patching file kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c
Hunk #2 FAILED at 270.
1 out of 2 hunks FAILED -- saving rejects to file kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c.rej
patching file kernel/nvidia-uvm/uvm8.c

Here is how I have it configured:

   hardware.nvidia.modesetting.enable = true;                                    
   hardware.nvidia.optimus_prime = {                                             
     enable = true;                                                              
     intelBusId = "PCI:0:2:0";                                                   
     nvidiaBusId = "PCI:1:0:0";                                                  
   };                                                                            
                                                                                 
   services.xserver.videoDrivers = ["nvidiaLegacy390"]; 

In 19.03 this worked but not anymore. Could there be a problem with the driver I’m using?

2 Likes

Kernel and driver version?

I’m not sure what the default kernel is for 19.09 but searching for the nvidia driver it looks like the package has changed to linuxPackages.nvidia_x11_legacy390. Maybe this is what I should use instead of nvidiaLegacy390.

I changed xserver to use the new name. Now I’m getting an error with systemd.

warning: the following units failed: systemd-timesyncd.service
  
● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/nix/store/6snycpaz9zrs5m7xz6dixl1nl0ngdrma-systemd-243/example/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
  Drop-In: /nix/store/rli8cm5f5qki5w3w3wbzhh1f3n9g5d3i-system-units/systemd-timesyncd.service.d
           └─overrides.conf
   Active: failed (Result: exit-code) since Fri 2019-10-11 17:45:03 EDT; 35ms ago
     Docs: man:systemd-timesyncd.service(8)
  Process: 1219 ExecStart=/nix/store/6snycpaz9zrs5m7xz6dixl1nl0ngdrma-systemd-243/lib/systemd/systemd-timesyncd (code=exited, status=238/STATE_DIRECTORY)
 Main PID: 1219 (code=exited, status=238/STATE_DIRECTORY)
       IP: 0B in, 0B out
      CPU: 832us
  
Oct 11 17:45:03 n1 systemd[1]: systemd-timesyncd.service: Service has no hold-off time (RestartSec=0), scheduling restart.
Oct 11 17:45:03 n1 systemd[1]: systemd-timesyncd.service: Scheduled restart job, restart counter is at 5. 
Oct 11 17:45:03 n1 systemd[1]: Stopped Network Time Synchronization.
Oct 11 17:45:03 n1 systemd[1]: systemd-timesyncd.service: Start request repeated too quickly.
Oct 11 17:45:03 n1 systemd[1]: systemd-timesyncd.service: Failed with result 'exit-code'.
Oct 11 17:45:03 n1 systemd[1]: Failed to start Network Time Synchronization.
warning: error(s) occurred while switching to the new configuration

Actually this is not an issue. I just restarted and everything seems fine!

unless you absolutely require the legacy version, you should bump it to:

services.xserver.videoDrivers = ["nvidia"]; 
1 Like

I’m not sure how exactly you resolved the problems with the patches – maybe some kind of naming confusion? Anyway, I pushed a fix in nvidia-x11: Remove patches from the 390 version. (#69851) · NixOS/nixpkgs@9ce5780 · GitHub

I’m not sure either but this is what I have:

  hardware.nvidia.modesetting.enable = true;                                    
  hardware.nvidia.optimus_prime = {                                             
    enable = true;                                                              
    intelBusId = "PCI:0:2:0";                                                   
    nvidiaBusId = "PCI:1:0:0";                                                  
  };                                                                            
                                                                                
  services.xserver.videoDrivers = ["linuxPackages.nvidia_x11_legacy390"]; 

I’m going to try switching to “nvidia”.

I don’t think that got you any of the official drivers. The list isn’t checked for typos etc. (that’s hard, as different drivers are handled by different parts of code)

Yup it looks like I am using nouveau with ‘nvidia’.

That is weird, but I’ve never used switchable HW (optimus) and I don’t know its implementation. Actually, most people writing our nvidia tickets/issues seem to have problems with switchable setups; my feeling certainly is that it seems less reliable (on NixOS).

“nvidia” shouldn’t give you nouveau, you’re probably including the driver somewhere else. If you need a reference for the nvidia configuration, you can try looking at my configuration [1], though it’s messy but that should be where the bulk of the nvidia configuration is.

[1] https://git.sr.ht/~eadwu/nixos-configuration/tree/master/hardware/gpu/nvidia

It turns out I do need to use nvidiaLegacy390. My computer is old and this seems to work now. Maybe the patches fix helped? When I switched to nvidia or anything else nouveau would be used instead.

Yes, the errors shown in your original post should be fixed now in 19.09.

1 Like