HDMI output not working on NVIDIA laptop

The problem

I am seeing the follownig error on the dmesg log when I plug a HDMI monitor on my Razer Blade 2021 :

[...] trimmed for brevity
[    0.000000] DMI: Razer Blade 15 Advanced Model (Early 2021) - RZ09-036/CH560, BIOS 1.04 04/07/2021
[...] trimmed for brevity
[   84.665607] [drm] DisplayID checksum invalid, remainder is 20
[   84.665611] [drm] DisplayID checksum invalid, remainder is 20
[   84.666017] [drm] DisplayID checksum invalid, remainder is 20
[   84.666019] [drm] DisplayID checksum invalid, remainder is 20
[   84.666023] [drm] DisplayID checksum invalid, remainder is 20
[   84.666024] [drm] DisplayID checksum invalid, remainder is 20
[   84.666034] [drm] DisplayID checksum invalid, remainder is 20
[   84.666035] [drm] DisplayID checksum invalid, remainder is 20
[   84.666036] [drm] DisplayID checksum invalid, remainder is 20

The monitor does not show on any of the graphical interfaces provided in GNOME. I have tried several of them and the error persists. I tried switching to GDM with even less success (see this Github issue to have an idea why).

Anyone has an idea on where it could come from ?

Informations on the system

I will do my best to provide as much information on the system but if you think that a crucial piece of information is missing, please do not hesitate to give pointers !

Relevant part of configuration file

I tried both hardware.nvidia.modesetting.enable=true and false without success.

{ config, pkgs, lib, ... }:

let
  nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" ''
    export __NV_PRIME_RENDER_OFFLOAD=1
    export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
    export __GLX_VENDOR_LIBRARY_NAME=nvidia
    export __VK_LAYER_NV_optimus=NVIDIA_only
    exec -a "$0" "$@"
  '';
in
{
  services.xserver = {
    videoDrivers = [ "nvidia" ];
    config = ''
          Section "Device"
              Identifier  "Intel Graphics"
              Driver      "intel"
              Option      "TearFree"        "true"
              Option      "SwapbuffersWait" "true"
              BusID       "PCI:0:2:0"
          EndSection

          Section "Device"
              Identifier "nvidia"
              Driver "nvidia"
              BusID "PCI:1:0:0"
              Option "AllowEmptyInitialConfiguration"
          EndSection
        '';
        screenSection = ''
          Option         "metamodes" "nvidia-auto-select +0+0 {ForceFullCompositionPipeline=On}"
          Option         "AllowIndirectGLXProtocol" "off"
          Option         "TripleBuffer" "on"
        '';
    exportConfiguration = true;
  };
  users.users.sirc.extraGroups = [ "video" ];
  environment.systemPackages = [ nvidia-offload ];
  hardware = {
    opengl.extraPackages32 = with pkgs.pkgsi686Linux; [ libva ];
    nvidia = {
      package = config.boot.kernelPackages.nvidiaPackages.beta;
      powerManagement = {
        enable = true;
        finegrained = true;
      };
      modesetting.enable = false;
      prime = {
        offload.enable = true;
        intelBusId = "PCI:0:2:0";
        nvidiaBusId = "PCI:1:0:0";
      };
    };
  };
}
`lspci -k | grep VGA`
00:02.0 VGA compatible controller: Intel Corporation CometLake-H GT2 [UHD Graphics] (rev 05)
01:00.0 VGA compatible controller: NVIDIA Corporation GA104M [GeForce RTX 3070 Mobile / Max-Q] (rev a1)
`sudo nvidia-smi`
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 495.29.05    Driver Version: 495.29.05    CUDA Version: 11.5     |
|-------------------------------+----------------------+----------------------+
| 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 GeForce ...  Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   46C    P8    11W /  N/A |      5MiB /  7982MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      3990      G   ...xorg-server-1.20.13/bin/X        4MiB |
+-----------------------------------------------------------------------------+
`xrandr --list-providers`
Providers: number : 2
Provider 0: id: 0x43 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 1 associated providers: 0 name:modesetting
Provider 1: id: 0x1ed cap: 0x2, Sink Output crtcs: 4 outputs: 7 associated providers: 0 name:NVIDIA-G0
Relevant `inxi -v7` output
System:    Kernel: 5.14.21 x86_64 bits: 64 compiler: gcc v: 10.3.0 Desktop: GNOME 41.1 tk: GTK 3.24.30 
           wm: gnome-shell dm: LightDM 1.30.0 Distro: NixOS 22.05 (Quokka) 
Machine:   Type: Laptop System: Razer product: Blade 15 Advanced Model (Early 2021) - RZ09-036 v: 6.04 
           serial: <superuser required> Chassis: type: 10 serial: <superuser required> 
           Mobo: Razer model: CH560 v: 4 serial: <superuser required> UEFI: Razer v: 1.04 date: 04/07/2021 
Graphics:  Message: No device data found. 
           Device-1: Azurewave Integrated Camera type: USB driver: uvcvideo bus-ID: 1-7:3 chip-ID: 13d3:56d5 class-ID: 0e02 
           serial: 200901010001 
           Display: x11 server: X.Org 1.20.13 compositor: gnome-shell driver: loaded: N/A resolution: 1920x1080~60Hz s-dpi: 96 
           OpenGL: renderer: Mesa Intel UHD Graphics (CML GT2) v: 4.6 Mesa 21.2.5 direct render: Yes 
           Packages: 3678 nix-default: 87 nix-sys: 3491 nix-usr: 100 Shell: Bash v: 5.1.8 running-in: tmux: inxi: 3.3.04 
`nix-info`
 - system: `"x86_64-linux"`
 - host os: `Linux 5.14.21, NixOS, 22.05 (Quokka)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.4`
 - channels(root): `"nixos-22.05pre333986.73369f8d086, home-manager, nix-ld"`
 - nixpkgs: `/nix/store/gm4hhjl5qdwsp600h4d8awjql30d0lb3-nixos-unstable-2021-11-25`

Did you (or anyone else) figure this out? I have been trying to figure this out as well for quite some time and with all the different configuration options available I have not been able to get the integrated graphics AND Nvidia graphics cards running at the same time.

I have been able to successfully switch between the two cards but it seems that the Nvidia driver doesn’t like my integrated graphics card and the i915 driver seems to stop the Nvidia card from working properly (and blacklisting the i915 driver prevents the integrated graphics from working). Which results in me choosing between either my laptop display working or external monitors.

Perhaps you need Reverse Prime Sync. See nvidia: Add Reverse Prime Sync by GoogleBot42 · Pull Request #165188 · NixOS/nixpkgs · GitHub

1 Like

I did not, I decided to use specialization as a temporary solution (we know how it goes: temporary becomes permanent if it is usable) but I am still hoping to find a real solution.

I will give it a look !

It seems to be a work in progress not a full fledged solution (yet)…