Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/amdgpu: add option for Display Core support #107400

Closed
wants to merge 2 commits into from

Conversation

wakira
Copy link
Member

@wakira wakira commented Dec 22, 2020

Motivation for this change

My RX6800 cannot detect any outputs unless I enable drm display core support by compiling linux with DRM_AMD_DC_DCN3_0.
I don't know if this is a universal issue of newer AMD cards or just my specific AIB card/MB combination.
I also noticed that many people have issues with DC enabled instead (with older generation of cards).

Anyway I think it is a good idea to have a module option to enable (disable) DC for all supported cards.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Add NixOS option hardware.amdgpu.enableDisplayCore that enables display core for all supported chipsets.
Newer gpus might require DC to function normally.
hardware.amdgpu.displayCore = "default" will behave exactly like before.
@berbiche
Copy link
Member

@wakira
Not to hijack this PR, but do you know whether DCN has anything to do with display stream compression (DSC) support?
DSC doesn't seem to work with my RX5700XT (works on Windows though).

@wakira
Copy link
Member Author

wakira commented Jan 3, 2021

@wakira
Not to hijack this PR, but do you know whether DCN has anything to do with display stream compression (DSC) support?
DSC doesn't seem to work with my RX5700XT (works on Windows though).

For 5700XT display core is enabled by default. I'm afraid DC might not be the problem here but you can try adding amdgpu.dc=0 to boot.kernelParams to disable it. Have you tried another distro such as Archlinux?

@berbiche
Copy link
Member

berbiche commented Jan 4, 2021

Have you tried another distro such as Archlinux?

No I haven't. I'll create a different issue for that.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/amdgpu-and-display-stream-compression-non-working-monitor/10820/1

@turboMaCk turboMaCk requested review from lheckemann and vikanezrimaya and removed request for lheckemann January 9, 2021 12:41
Copy link
Member

@vikanezrimaya vikanezrimaya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont know why I was tagged here. The code looks clean and understandable (except the kernel options themselves, they're like Latin to me - but it doesn't look like defaults are changing, so it's backwards compatible)

I'll stamp an LGTM here but with a big caveat - I'm a noob when it comes to display drivers, I literally nuked my GPU driver on Windows last time I tried to make my discrete GPU work in my laptop. Also I don't have merge rights - and probably for a good reason for now 🤣

@mintchaos
Copy link

I've got a similar issue with my 6800XT. Outputs break when amdgpu loads. Will see if I can try out this patch.

@mintchaos
Copy link

Didn't try this full patch, ended up just throwing this in my config for now. But it worked and made my computer usable again. Copied the configs from https://bugzilla.kernel.org/show_bug.cgi?id=210479

  boot.kernelPatches = [{
    name = "make amd 6x00 work";
    patch = null;
    extraConfig = ''
      DRM_AMD_DC y
      DRM_AMD_DC_DCN y
      DRM_AMD_DC_DCN3_0 y
          '';
  }];

Which is mostly to say that anyone with a modern amdgpu is going to need this. And here's my vote that this OP's PR gets in.

@Artturin
Copy link
Member

Artturin commented Jan 11, 2021

6800XT works by default on arch but not on nixos as reported by @wiltaylor

ARCH https://github.com/archlinux/svntogit-packages/blob/af2aa8baea48af5dc732e9e46c3e6c60666781d6/trunk/config#L6100

# Display Engine Configuration
#
CONFIG_DRM_AMD_DC=y
CONFIG_DRM_AMD_DC_DCN=y
CONFIG_DRM_AMD_DC_DCN3_0=y
CONFIG_DRM_AMD_DC_HDCP=y
CONFIG_DRM_AMD_DC_SI=y
# end of Display Engine Configuration

NIXOS zcat /proc/config.gz > kernelconfig

# Display Engine Configuration
#
CONFIG_DRM_AMD_DC=y
CONFIG_DRM_AMD_DC_DCN=y
# CONFIG_DRM_AMD_DC_DCN3_0 is not set
# CONFIG_DRM_AMD_DC_HDCP is not set
# CONFIG_DRM_AMD_DC_SI is not set
# end of Display Engine Configuration

@wiltaylor
Copy link
Contributor

Adding the missing options as above has fixed it so I can now boot into Xorg and vulkan seems to be working.

@wakira
Copy link
Member Author

wakira commented Jan 12, 2021

Instead of this PR maybe we can just enable all relevant kernel configs by default? If arch is doing that it should be fine

@Artturin
Copy link
Member

@lheckemann
Copy link
Member

+1 for setting them universally (in pkgs/os-specific/linux/kernel/common-config.nix). I misunderstood originally, thinking that these options will break some other GPUs, but if that's not the case we should enable them everywhere, so that all the affected users don't have to build their own kernel.

@wakira
Copy link
Member Author

wakira commented Jan 12, 2021

Closed in favor of #109105

@wakira wakira closed this Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants