Black screen amdgpu error: no EDID read

My monitor ( ROG SWIFT PG278Q ) was working on my previous pc when I had nvidia. I got a new pc with a AMD Radeon RX 7800 XT and now the monitor is just black at 640x480.
fresh install of nixos plasma.

I was able to get the resolution adjusted
https://wiki.nixos.org/wiki/AMD_GPU

boot.kernelParams = [
  "video=DP-1:2560x1440@144"
  "video=DP-2:2560x1440@144"
];

journalctl had one error: [drm:detect_link_and_local_sink [amdgpu]] ERROR No EDID read.
Im not sure where or how to fix edid.

hello
can you post more infos about our system (config, where is your monitor plugged in) and also share your dmesg log.

The monitor is plugged in the video card via displayport.

configuration.nix

# Edit this configuration file to define what should be installed on
# your system.  Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).

{ config, pkgs, ... }:

{
  imports =
    [ # Include the results of the hardware scan.
      <nixos-hardware/common/gpu/amd/default.nix>
      ./hardware-configuration.nix
    ];

  # Bootloader.
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;

  networking.hostName = "nixos"; # Define your hostname.
  # networking.wireless.enable = true;  # Enables wireless support via wpa_supplicant.

  # Configure network proxy if necessary
  # networking.proxy.default = "http://user:password@proxy:port/";
  # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";

  # Enable networking
  networking.networkmanager.enable = true;

  # Set your time zone.
  time.timeZone = "America/New_York";

  # Select internationalisation properties.
  i18n.defaultLocale = "en_US.UTF-8";

  i18n.extraLocaleSettings = {
    LC_ADDRESS = "en_US.UTF-8";
    LC_IDENTIFICATION = "en_US.UTF-8";
    LC_MEASUREMENT = "en_US.UTF-8";
    LC_MONETARY = "en_US.UTF-8";
    LC_NAME = "en_US.UTF-8";
    LC_NUMERIC = "en_US.UTF-8";
    LC_PAPER = "en_US.UTF-8";
    LC_TELEPHONE = "en_US.UTF-8";
    LC_TIME = "en_US.UTF-8";
  };

  # Enable the X11 windowing system.
  # You can disable this if you're only using the Wayland session.
  services.xserver.enable = true;

  # Enable the KDE Plasma Desktop Environment.
  services.displayManager.sddm.enable = true;
  services.desktopManager.plasma6.enable = true;

  # Configure keymap in X11
  services.xserver.xkb = {
    layout = "us";
    variant = "";
  };

    # Graphics
  hardware.graphics.enable = true;
  hardware.graphics.enable32Bit = true;
  services.xserver.videoDrivers = [ "amdgpu" ];


  # Steam
  programs.steam = {
  enable = true;
  remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
  dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
  localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
};


  # Enable CUPS to print documents.
  services.printing.enable = true;

  # Enable sound with pipewire.
  hardware.pulseaudio.enable = false;
  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
    # If you want to use JACK applications, uncomment this
    #jack.enable = true;

    # use the example session manager (no others are packaged yet so this is enabled by default,
    # no need to redefine it in your config for now)
    #media-session.enable = true;
  };

  # Enable touchpad support (enabled default in most desktopManager).
  # services.xserver.libinput.enable = true;

  # Define a user account. Don't forget to set a password with ‘passwd’.
  users.users.dustin = {
    isNormalUser = true;
    description = "Dustin";
    extraGroups = [ "networkmanager" "wheel" ];
    packages = with pkgs; [
      kdePackages.kate
    #  thunderbird
    ];
  };

  # Install firefox.
  programs.firefox.enable = true;

  # Allow unfree packages
  nixpkgs.config.allowUnfree = true;

  # Allow disk management
  programs.partition-manager.enable = true;

  # List packages installed in system profile. To search, run:
  # $ nix search wget
  environment.systemPackages = with pkgs; [
  #  vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
    wget
    steam
    discord
    wezterm
    git
    btop
    tmux
    neovim
    tldr
    element-web
    thunderbird
  ];

  # Some programs need SUID wrappers, can be configured further or are
  # started in user sessions.
  # programs.mtr.enable = true;
  # programs.gnupg.agent = {
  #   enable = true;
  #   enableSSHSupport = true;
  # };

  # List services that you want to enable:

  # Enable the OpenSSH daemon.
  # services.openssh.enable = true;

  # Open ports in the firewall.
  # networking.firewall.allowedTCPPorts = [ ... ];
  # networking.firewall.allowedUDPPorts = [ ... ];
  # Or disable the firewall altogether.
  # networking.firewall.enable = false;

  # This value determines the NixOS release from which the default
  # settings for stateful data, like file locations and database versions
  # on your system were taken. It‘s perfectly fine and recommended to leave
  # this value at the release version of the first install of this system.
  # Before changing this value read the documentation for this option
  # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
  system.stateVersion = "24.11"; # Did you read the comment?

}

hardware-configuration.nix

# Do not modify this file!  It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations.  Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:

{
  imports =
    [ (modulesPath + "/installer/scan/not-detected.nix")
    ];

  boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
  boot.initrd.kernelModules = [ "amdgpu" ];
  boot.kernelModules = [ "kvm-amd" ];
  boot.kernelPackages = pkgs.linuxPackages_latest;
  boot.kernelPatches = [
    {
      name = "Rust Support";
      patch = null;
      features = {
        rust = true;
      };
    }
  ];
  boot.extraModulePackages = [ ];
  boot.kernelParams = [
  "video=DP-1:2560x1440@144"
  "video=DP-2:2560x1440@144"
];


  fileSystems."/" =
    { device = "/dev/disk/by-uuid/2fd952b0-f307-4b3b-8edf-7d5e554c6767";
      fsType = "ext4";
    };

  fileSystems."/run/media/dustin/games" = {
    device = "/dev/disk/by-uuid/24a83170-d6e1-4188-95ad-ecc2827204fe";
    fsType = "auto";
  };

  fileSystems."/run/media/dustin/projects" = {
    device = "/dev/disk/by-uuid/14e4e640-5100-4e6f-beba-d389e22757a6";
    fsType = "auto";
  };

  fileSystems."/boot" =
    { device = "/dev/disk/by-uuid/ECE2-0221";
      fsType = "vfat";
      options = [ "fmask=0077" "dmask=0077" ];
    };

  swapDevices = [ ];

  # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
  # (the default) this is the recommended approach. When using systemd-networkd it's
  # still possible to use this option, but it's recommended to use it in conjunction
  # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
  networking.useDHCP = lib.mkDefault true;
  # networking.interfaces.enp112s0.useDHCP = lib.mkDefault true;
  # networking.interfaces.wlp111s0.useDHCP = lib.mkDefault true;

  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
  hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;

  hardware.graphics.extraPackages = with pkgs; [
    amdvlk
    rocmPackages.clr.icd
  ];
  # For 32 bit applications
  hardware.graphics.extraPackages32 = with pkgs; [
    driversi686Linux.amdvlk
  ];

  environment.systemPackages = with pkgs; [ lact ];
  systemd.packages = with pkgs; [ lact ];
  systemd.services.lactd.wantedBy = ["multi-user.target"];
}

dmesg log

But everything works fine now with the kernelParams?
The error just says that the system could not read the resolution of your monitor. If you don’t have any other issues just ignore it.

the kernelParams sets the resolution. The system settings, shows the screen. The computer acts like the monitor exists, but I’m stuck with a black screen. I can move windows to the screen, I just can’t see 'em.

So just to clarify. Both of your monitors are have a blackscreen.
First of all can you describe a bit more what you changed so that this behavior happened?
Was it only the GPU switch, did you do a full re installation or have you changed any cables.
Also when booting do you have a direct blackscreen or can you login.
Third question is are you using X or wayland. If you are using either try the other one.

Fourth could you try these kernelParams:

  boot.kernelParams = [
  "video=DP-1:e"
  "video=DP-2:e"
  ];

I have 2 monitors. One works (HDMI 1080), the other is blackscreen (Displayport QHD).

It has been a blackscreen since install on this pc. I used the same 2 monitors, with the same cords, on a previous pc running nix, but the old pc had nvidia ( 2060 super ). The old pc died, and got a new pc. new pc

The blackscreen monitor works when booting, bios, selecting nix build. As soon as it hits the login screen, the monitor blacks out.

I am using X. I have tried wayland. With wayland, the screen was still black and my mouse didnt work, so I just use X so i can have my mouse.

I will add the params.

after trying the kernelParams, plasma’s display configuration window shows a 3rd montior. My working monitor is still working at 1080, and the other 2 in display configuration is at 640x480.

Ok so first of all can you run this command:

head /sys/class/drm/*/status

This should tell you where the monitor is connected. Pleas post the output of that.
Second try another port on the gpu.
Third run this command and post the output: xrandr
Fourth run this command and post the output: ls /sys/class/drm/*/edid

[dustin@nixos:~]$ head /sys/class/drm/*/status
==> /sys/class/drm/card1-DP-1/status <==
disconnected

==> /sys/class/drm/card1-DP-2/status <==
connected

==> /sys/class/drm/card1-DP-3/status <==
disconnected

==> /sys/class/drm/card1-HDMI-A-1/status <==
connected

==> /sys/class/drm/card1-Writeback-1/status <==
unknown
  1. Same result on the other displayports.
[dustin@nixos:~]$ xrandr
Screen 0: minimum 320 x 200, current 4480 x 1440, maximum 16384 x 16384
DisplayPort-0 disconnected (normal left inverted right x axis y axis)
DisplayPort-1 connected 2560x1440+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   2560x1440    144.04*
   640x480       59.94
DisplayPort-2 disconnected (normal left inverted right x axis y axis)
HDMI-A-0 connected primary 1920x1080+2560+0 (normal left inverted right x axis y axis) 598mm x 336mm
   1920x1080     60.00*+  50.00    59.94    59.99
   1600x1200     60.00
   1680x1050     59.88
   1280x1024     75.02    60.02
   1440x900      59.90
   1280x960      60.00
   1366x768      59.79
   1280x800      60.00
   1152x864      75.00
   1280x720      60.00    50.00    59.94
   1024x768      75.03    70.07    60.00
   832x624       74.55
   800x600       72.19    75.00    60.32    56.25
   720x576       50.00
   720x480       60.00    59.94
   640x480       75.00    72.81    66.67    60.00    59.94
   720x400       70.08
[dustin@nixos:~]$ ls /sys/class/drm/*/edid
/sys/class/drm/card1-DP-1/edid  /sys/class/drm/card1-HDMI-A-1/edid
/sys/class/drm/card1-DP-2/edid  /sys/class/drm/card1-Writeback-1/edid
/sys/class/drm/card1-DP-3/edid

Ok so I think the problem is with edid not beeing correctly read.
To fix this we need to give the kernel the right EDID.
Pleas try following:

  1. download this edid. https://docs.nefarius.at/research/PG278Q.bin
  2. put it in /etc/nixos
  3. Than put this in your config:
  boot.kernelParams = [ "drm.edid_firmware=DP-2:edid/PG278Q.bin " "video=DP-2:e" ];
  hardware.firmware = [
  (
    pkgs.runCommand "edid.bin" { } ''
      mkdir -p $out/lib/firmware/edid
      cp ${./PG278Q.bin } $out/lib/firmware/edid/edid.bin
    ''
  )];
sources

Copying Custom EDID - #25 by adana
ASUS PG278Q Monitor on Linux - Nefarius™ Project Documentation

[dustin@nixos:~]$ sudo nixos-rebuild switch
[sudo] password for dustin:
building Nix...
building the system configuration...
error:
       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:37:12:
           36|
           37|   strict = derivationStrict drvAttrs;
             |            ^
           38|

       … while evaluating derivation 'nixos-system-nixos-24.11.717608.bf3287dac860'
         whose name attribute is located at /nix/store/sdmikw0x2qf11yhnxach7bv1ysa7p0yj-nixos-24.11/nixos/pkgs/stdenv/generic/make-derivation.nix:396:13

       … while evaluating attribute 'buildCommand' of derivation 'nixos-system-nixos-24.11.717608.bf3287dac860'
         at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/top-level.nix:1:2295:
       … while evaluating the option `boot.bootspec.writer':

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: A definition for option `boot.kernelParams."[definition 1-entry 1]"' is not of type `string, with spaces inside double quotes'. Definition values:
       - In `/etc/nixos/hardware-configuration.nix': "drm.edid_firmware=DP-2:edid/PG278Q.bin "

nvm, removed the whitespace in kernelParams and it ran

still got a blackscreen. system setting showing the blackscreen at 640x480

while looking around EDID, I did find a hardware list

That could be worth looking into if you can make out which of these is your concrete monitor:

ASUS 	AUS27B1 	ROG PG278QR 	2560x1440 	27.2 	2019 	00E8D3EECD3C
ASUS 	AUS27B1 	ROG PG278QR 	2560x1440 	27.2 	2018 	39C49DE914D8
ASUS 	AUS27B1 	ROG PG278QR 	2560x1440 	27.2 	2017 	13294FAF4176
ASUS 	AUS27B1 	ROG PG278QR 	2560x1440 	27.2 	2016 	2F07D4399187
ASUS 	AUS27B2 	ROG PG278QR 	2560x1440 	27.2 	2018 	385DC93E7BD6
ASUS 	AUS27B2 	ROG PG278QR 	2560x1440 	27.2 	2017 	5B7181436E4C
ASUS 	AUS27B6 	ROG PG278QE 	2560x1440 	27.2 	2019 	44939D31CCE6

Also could you try this in your config:

boot = {
  kernelPatches = [ {
    name = "edid-loader-fix-config";
    patch = null;
    extraConfig = ''
      FW_LOADER y
    '';
  } ];	
};

But without the kernelParams or the hardware.firmware

while the kernalPatch runs, I’ve tried to identify which one is my monitor.
Model#: PG278Q
S/N: E9LMQS002509
Manufactured Date: September 2014
Power: 19V 4.74A

I can’t find anymore info on the monitor itself. I’ll dig around for the box. I hope I didn’t throw it away.

I don’t see any helpful info on the website either

Nothing changed from the kernelPatch :confused:

I could just go through those EDIDs one by one and try them. How would I use them?

I highly doubt that this will work since your monitor is from 2014 but the oldest in the list is from 2016. You could however try to get the EDID by yourself. Therefor try this:

  1. install read-edid
  2. sudo modprobe i2c-dev (to read from the
  3. sudo get-edid > edid.bin (if this doesn’t work try to specify the monitors bus with the -b flag e.g. sudo get-edit -b 2)

And than this config again (maybe with updated file names):

  boot.kernelParams = [ "drm.edid_firmware=DP-2:edid/PG278Q.bin " "video=DP-2:e" ];
  hardware.firmware = [
  (
    pkgs.runCommand "edid.bin" { } ''
      mkdir -p $out/lib/firmware/edid
      cp ${./PG278Q.bin } $out/lib/firmware/edid/edid.bin
    ''
  )];

Also could you try setting down the display-port version to 1.1 on your monitor