Using internal + external monitor with Nvidia offload

I’m using a Thinkpad P50 and set my Nvidia PRIME mode to offload as the wiki says sync is harmful to the GPU and seems to be being retired.

  services.xserver.videoDrivers = [ "nvidia" ];
  hardware.nvidia = {
    modesetting.enable = true;
    prime = {
      sync.enable = false; # gpu always
      offload.enable = true; # gpu on demand
      #nvidiaBusId = "PCI:10:0:0"; #epgu
      nvidiaBusId = "PCI:1:0:0"; # dedicated gpu
      intelBusId = "PCI:0:2:0";
    };
  };

  # required for external monitor usage on nvidia offload
  specialisation = {
    external-display.configuration = {
      system.nixos.tags = [ "external-display" ];
      hardware.nvidia.prime.offload.enable = lib.mkForce false;
      hardware.nvidia.powerManagement.enable = lib.mkForce false;
    };
  };

However, I suspect that my laptop is one of the special conditions where external display ports are only exposed to the dedicated GPU. As such, I can either use only the internal monitor or only an external monitor.

Has there been any progress in fixing usecases like this, or should I revert to sync? Is sync significantly harmful to the dGPU or is it just not ideal?

The feature you are looking for is called reverse PRIME, PRIME - ArchWiki

Interesting, apparently there is progress in getting it implemented. I suppose I’ll just have to wait for now. Thank you for clarifying.

Actually calling the xrandr command alone is already enough for me, without configuration changes, you can also have a try.

Very interesting, I didn’t think it’d be that simple.
I got it working by grabbing the source output provider number from

xrandr --listproviders

and running

xrandr --setprovideroutputsource NVIDIA-G0 modesetting
xrandr --auto

It seems this method is just displaying a framebuffer on the external screen? Regardless, it works and I’m happy of that. Thank you again.

1 Like