Nvidia Optimus on dell 3590 : AD107GLM [RTX 500 Ada Generation Laptop GPU]

Hello,
I’ve been happily using Nixos with optimus on a Dell laptop.
Now I changed the laptop and I’m struggling to make it work. On arch it’s working as expected, so I suppose that drivers for linux do exist.

Here on Nixos, no matter what driver I’m using, I’m not able to make it work: X doesn’t start at all of, if starts, it does with integrated graphics. Plus, no matter what I do, external monitor is not used. Here are some infos:

sudo lshw -c display
[sudo] password di CyberPingU: 
  *-display                 
       description: simpledrmdrmfb
       physical id: 0
       bus info: pci@0000:01:00.0
       logical name: /dev/fb0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list fb
       configuration: depth=32 latency=0 mode=1920x1080 visual=truecolor xres=1920 yres=1080
       resources: iomemory:400-3ff iomemory:410-40f memory:7c000000-7cffffff memory:4000000000-40ffffffff memory:4100000000-4101ffffff ioport:3000(size=128)
  *-display UNCLAIMED
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 08
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm bus_master cap_list
       configuration: latency=0
       resources: iomemory:510-50f iomemory:410-40f memory:5128000000-5128ffffff memory:4110000000-411fffffff memory:c0000-dffff memory:4102000000-4108ffffff
  *-graphics
       product: simpledrmdrmfb
       physical id: 3
       logical name: /dev/fb0
       capabilities: fb
       configuration: depth=32 resolution=1920,1080

I say that on arch linux the “graphics” entry doesn’t exist and the first 2 display do not show “UNCLAIMED”.

Here is the lspci output:

[nix-shell:~]$ lspci | grep "VGA\|3D"
00:02.0 VGA compatible controller: Intel Corporation Meteor Lake-P [Intel Arc Graphics] (rev 08)
01:00.0 3D controller: NVIDIA Corporation AD107GLM [RTX 500 Ada Generation Laptop GPU] (rev a1)

Now, following nvidia wiki I tried every single of these entries:

hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable;
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.beta;
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.production;  # (installs 550)
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.vulkan_beta;

In the block

  # Enable OpenGL
  hardware.graphics = {
    enable = true;
  };

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

  hardware.nvidia = {

    modesetting.enable = true;
    powerManagement.enable = false;
    powerManagement.finegrained = false;
    open = false;
    nvidiaSettings = true;
   package = config.boot.kernelPackages.nvidiaPackages.stable; # <-- Here I tried production, eta, stable
prime = {
		# Make sure to use the correct Bus ID values for your system!
		intelBusId = "PCI:0:2:0";
		nvidiaBusId = "PCI:1:0:0";
	};
  };

With this Configuration sddm doesn’t start and logs say something like “unable to start framebuffer, please specify a busID for every entry”. But I did… 1:0:0 and 0:2:0 (as you saw from the lshw and from the lspci).

If I try to add

boot.initrd.kernelModules = [ "nvidia" ];
boot.extraModulePackages = [ config.boot.kernelPackages.nvidia_x11 ];

and remove the services.xserver.videoDrivers = ["nvidia"]; otherwise it complains, I can see that X starts. But no nvidia and no dual monitor.

Basically: no nvidia and no dual monitor OR no X at all. These are my choices -.-

I even tried to use the " Running the new RTX SUPER on nixos stable" but this approach didn’t bring
me anywhere.

I have no more clues. Can anyone help me?
Is this graphic card even supported? Also this is a Dell Laptop, but I’m starting to think that the video card is not supported.

This is the output from inxi -G on arch linux (working nvidia drivers)

 sudo inxi -G
Graphics:
  Device-1: Intel Meteor Lake-P [Intel Arc Graphics] driver: i915 v: kernel
  Device-2: NVIDIA AD107GLM [RTX 500 Ada Generation Laptop GPU]
    driver: nvidia v: 565.57.01
  Device-3: Logitech HD Pro Webcam C920 driver: snd-usb-audio,uvcvideo
    type: USB
  Device-4: Sunplus Innovation Integrated_Webcam_FHD driver: uvcvideo
    type: USB
  Display: unspecified server: X.Org v: 21.1.14 with: Xwayland v: 24.1.4
    driver: X: loaded: modesetting,nvidia dri: iris gpu: i915 resolution:
    1: 1920x1080~60Hz 2: 1920x1080~60Hz
  API: EGL v: 1.5 drivers: iris,nvidia platforms: gbm,x11,surfaceless,device
  API: OpenGL v: 4.6.0 compat-v: 4.6 vendor: intel mesa v: 24.3.1-arch1.1
    renderer: Mesa Intel Arc Graphics (MTL)
  API: Vulkan v: 1.3.295 drivers: nvidia surfaces: xcb,xlib

What driver am I supposed to install in nixos? I mean, how am I supposed to correctly load driver: nvidia v: 565.57.01 ?

Your PRIME config seems incomplete to me. In addition to the busIDs, you must choose a GPU mode (offload or sync). For example:

hardware.nvidia.prime = {
  offload.enable = true;
  offload.enableOffloadCmd = true; # install `nvidia-offload`

  intelBusId = "PCI:0:2:0";
  nvidiaBusId = "PCI:1:0:0";
};

If that still doesn’t work, try setting the busIDs to:

intelBusId = "0@0:2:0";
nvidiaBusId = "1@0:0:0";

As suggested in Issues with nvidia-powerd.service and Optimus PRIME offloading on NixOS - #3 by marmar. With this, the intel GPU will be used by default for rendering and you can use the Nvidia GPU with nvidia-offload command.

If you’d like to use Nvidia for rendering by default, you could try inverting the busID order (haven’t verified if this works):

intelBusId = "1@0:2:0";
nvidiaBusId = "0@0:0:0";

or set the following env variables:

environment.variables = {
  GBM_BACKEND = "nvidia-drm";
  __GLX_VENDOR_LIBRARY_NAME = "nvidia";
};

You can specify which driver version you’d like to use with:

hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
  version = "565.57.01"; # beta
  sha256_64bit = "sha256-buvpTlheOF6IBPWnQVLfQUiHv4GcwhvZW3Ks0PsYLHo=";
  sha256_aarch64 = "sha256-aDVc3sNTG4O3y+vKW87mw+i9AqXCY29GVqEIUlsvYfE=";
  openSha256 = "sha256-/tM3n9huz1MTE6KKtTCBglBMBGGL/GOHi5ZSUag4zXA=";
  settingsSha256 = "sha256-H7uEe34LdmUFcMcS6bz7sbpYhg9zPCb/5AmZZFTx1QA=";
  persistencedSha256 = "sha256-hdszsACWNqkCh8G4VBNitDT85gk9gJe1BlQ8LdrYIkg=";
};

You can get the hashes either from the nvidia-x11 derivation or if they’re not available there for a certain version, you can set them to empty strings, rebuild your system and you’ll find the correct hash printed in the console.

Hi @eljamm,
this is my modification:

  # Enable OpenGL
  hardware.graphics = {
    enable = true;
  };

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

  hardware.nvidia = {
  modesetting.enable = true;
  powerManagement.enable = false;
  powerManagement.finegrained = false;
  open = false;
  nvidiaSettings = true;
  package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
  version = "565.57.01"; # beta
  sha256_64bit = "sha256-buvpTlheOF6IBPWnQVLfQUiHv4GcwhvZW3Ks0PsYLHo=";
  sha256_aarch64 = "sha256-aDVc3sNTG4O3y+vKW87mw+i9AqXCY29GVqEIUlsvYfE=";
  openSha256 = "sha256-/tM3n9huz1MTE6KKtTCBglBMBGGL/GOHi5ZSUag4zXA=";
  settingsSha256 = "sha256-H7uEe34LdmUFcMcS6bz7sbpYhg9zPCb/5AmZZFTx1QA=";
  persistencedSha256 = "sha256-hdszsACWNqkCh8G4VBNitDT85gk9gJe1BlQ8LdrYIkg=";
  };

  prime = {
  offload.enable = true;
  offload.enableOffloadCmd = true; # install `nvidia-offload`

  intelBusId = "PCI:0:2:0";
  nvidiaBusId = "PCI:1:0:0";
  };
 };

As suggested I tried even the 0@0:2:0 syntax. Still no luck.

These are some outptus:
lshw -C display:

  *-display
       description: simpledrmdrmfb
       physical id: 0
       bus info: pci@0000:01:00.0
       logical name: /dev/fb0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list rom fb
       configuration: depth=32 driver=nvidia latency=0 mode=1920x1080 visual=truecolor xres=1920 yres=1080
       resources: iomemory:400-3ff iomemory:410-40f irq:194 memory:7c000000-7cffffff memory:4000000000-40ffffffff memory:4100000000-4101ffffff ioport:3000(size=128)
  *-display UNCLAIMED
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 08
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm bus_master cap_list
       configuration: latency=0
       resources: iomemory:510-50f iomemory:410-40f memory:5128000000-5128ffffff memory:4110000000-411fffffff memory:c0000-dffff memory:4102000000-4108ffffff
  *-graphics
       product: simpledrmdrmfb
       physical id: 4
       logical name: /dev/fb0
       capabilities: fb
       configuration: depth=32 resolution=1920,1080

inxi -G

Graphics:
  Message: Required tool lspci not installed. Check --recommends
  Device-1: HD Pro Webcam C920 driver: snd-usb-audio,uvcvideo type: USB
  Device-2: SunplusIT Integrated_Webcam_FHD driver: uvcvideo type: USB
  Display: unspecified server: X.org v: 1.21.1.14 with: Xwayland v: 24.1.4 driver: X:
    loaded: modesetting gpu: N/A tty: 240x67
  API: OpenGL Message: GL data unavailable in console, glxinfo missing.

journalctl

dic 09 13:28:58 nixos xserver-wrapper[1880]: (EE) Server terminated with error (1). Closing log file.
dic 09 13:28:58 nixos xserver-wrapper[1880]: (EE)
dic 09 13:28:58 nixos xserver-wrapper[1880]: (EE) Please also check the log file at "/dev/null" for additional information.
dic 09 13:28:58 nixos xserver-wrapper[1880]:  for help.
dic 09 13:28:58 nixos xserver-wrapper[1880]:          at http://wiki.x.org
dic 09 13:28:58 nixos xserver-wrapper[1880]: Please consult the The X.Org Foundation support
dic 09 13:28:58 nixos xserver-wrapper[1880]: (EE)
dic 09 13:28:58 nixos xserver-wrapper[1880]: (EE)
dic 09 13:28:58 nixos xserver-wrapper[1880]: (EE) Cannot run in framebuffer mode. Please specify busIDs        for all framebuffer devices
dic 09 13:28:58 nixos xserver-wrapper[1880]: Fatal server error:
dic 09 13:28:58 nixos xserver-wrapper[1880]: (EE)
dic 09 13:28:58 nixos xserver-wrapper[1880]: (II) UnloadModule: "modesetting"
dic 09 13:28:58 nixos xserver-wrapper[1880]: (EE) Screen 0 deleted because of no matching config section.

and as last, nvidia-smi

+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 565.57.01              Driver Version: 565.57.01      CUDA Version: 12.7     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA RTX 500 Ada Gener...    Off |   00000000:01:00.0 Off |                  N/A |
| N/A   47C    P8              2W /   30W |       1MiB /   4094MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+

I tried even different drivers version (i.e. the 565.77)

Try early-loading the drivers:

boot.initrd.kernelModules = [ "nvidia" "nvidia_modeset" "nvidia_drm" "nvidia_uvm" ];

# or with iGPU
#boot.initrd.kernelModules = [ "i915" "nvidia" "nvidia_modeset" "nvidia_drm" "nvidia_uvm" ];

or blacklisting the iGPU:

boot.kernelParams = [ "module_blacklist=i915" ];

If that still didn’t work, you can take a look at the modules in nixos-hardware/dell/precision, which might be useful.

Ok,
thanks for your advices, but I think I will give up for now.
I’ve given a look (and tried) the precision’s page. 3590 (mine) is not listed; besides that, all nvidia drivers/configs are for different videocards. This is not even seen just as “VGA” adapter only, but with “VGA” and “3D” controller. It seems that Ada 500 generation is not yet supported by nixos atm.

00:02.0 VGA compatible controller: Intel Corporation Meteor Lake-P [Intel Arc Graphics] (rev 08)
01:00.0 3D controller: NVIDIA Corporation AD107GLM [RTX 500 Ada Generation Laptop GPU] (rev a1)

Every configuration I tried, lead to the very same dead end: if I load nvidia, X won’t start. In any case, external monitor does not work.

1 Like