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

common-config: Enable RX 6000 Series AMDGPU #111177

Merged
merged 1 commit into from Feb 3, 2021

Conversation

afontaine
Copy link
Contributor

Motivation for this change

The kernel config parameter DRM_AMD_DC_DCN3_0 is required to enable
the RX 6000 series GPUs, and is supported on kernels at least 5.9.12.

Source: https://wiki.gentoo.org/wiki/AMDGPU#Installation

I've tested this locally on my machine with an RX 6900XT. Not sure what other testing is possible, aside from other owners of a 6000 series GPU.

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.

@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/setting-up-x-in-nixos-with-amd-radeon-6800/11124/6

@afontaine afontaine changed the title common-crnfig: Enable RX 6000 Series AMDGPU common-config: Enable RX 6000 Series AMDGPU Jan 29, 2021
The kernel config parameter `DRM_AMD_DC_DCN3_0` is required to enable
the RX 6000 series GPUs, and is supported on kernels at least `5.9.12`.

Source: https://wiki.gentoo.org/wiki/AMDGPU#Installation
@kimat
Copy link
Contributor

kimat commented Jan 31, 2021

I just tested this and can report this works great.

Here's how I tested this branch:

I created an iso with this patch and flashed in on a usb flash drive

git clone --depth=1 https://github.com/afontaine/nixpkgs.git -b enable-rx6000-gpus
cd nixpkgs/nixos
nix-build -A config.system.build.isoImage -I nixos-config=modules/installer/cd-dvd/installation-cd-graphical-plasma5-new-kernel.nix default.nix
# identify the usb drive
sudo lsblk -o NAME,MODEL | grep Flash
# FLASH_DRIVE=/dev/sdd
ISO=result/iso/nixos-21.03pre-git-x86_64-linux.iso
sudo dd bs=1M if="${ISO}" of="${FLASH_DRIVE}" && sync

I booted on the flash drive

✔️ Unlike a similar build I made from master, this build would let the installer arrive until the plasma desktop.

I installed nixos using the flash drive

I just added the following to the configuration.nix file generated by nixos-generate-config:

{
  boot.kernelPackages = pkgs.linuxPackages_latest;
}

✔️ The resulting installation also booted fine and resulted in the plasma desktop being usable.

I switched the configuration to have the amdgpu driver used

After switching to this branch as a the nixos channel:

sudo nix-channel --add https://github.com/afontaine/nixpkgs/archive/enable-rx6000-gpus.tar.gz nixos
sudo nixos-channel --udpate

And extending the configuration.nix file to contain the following:

{
  boot.kernelPackages = pkgs.linuxPackages_latest;
  boot.initrd.kernelModules = [ "amdgpu" ];
  services.xserver.videoDrivers = [ "amdgpu" ];
  hardware.opengl = {
    enable = true;
    driSupport32Bit = true;
  };
}

✔️ The amdgpu driver was correctly used:

sudo inxi -G
Graphics:  Device-1: Advanced Micro Devices [AMD/ATI] driver: amdgpu v: kernel 
           Display: x11 server: X.org 1.20.10 driver: loaded: amdgpu note: n/a (using device driver) 
           resolution: <missing: xdpyinfo> 
           OpenGL: renderer: AMD SIENNA_CICHLID (DRM 3.40.0 5.10.11 LLVM 11.0.1) v: 4.6 Mesa 20.3.3

@afontaine
Copy link
Contributor Author

afontaine commented Feb 1, 2021

@kimat With this patch, you should no longer need the boot.kernelPatches configuration, as that is the purpose of the patch 😉

If that's not the case, let me know 👍 My current configuration no longer contains the patch configuration.

@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/prs-ready-for-review/3032/455

@SuperSandro2000
Copy link
Member

This rebuilds a lot of kernels. Maybe it should go through staging?

@afontaine
Copy link
Contributor Author

afontaine commented Feb 1, 2021

This rebuilds a lot of kernels. Maybe it should go through staging?

Sure @SuperSandro2000! Do I target staging or staging-next?

@afontaine afontaine changed the base branch from master to staging February 1, 2021 20:35
@kimat
Copy link
Contributor

kimat commented Feb 1, 2021

@afontaine, I just updated my pervious comment to showcase how I correctly tested this branch, with success, now.

@SuperSandro2000
Copy link
Member

This rebuilds a lot of kernels. Maybe it should go through staging?

Sure @SuperSandro2000! Do I target staging or staging-next?

staging is correct here.

@afontaine
Copy link
Contributor Author

afontaine commented Feb 2, 2021 via email

@afontaine
Copy link
Contributor Author

@kimat that is great to hear 👍 glad everything is working

@SuperSandro2000 SuperSandro2000 merged commit 7e55500 into NixOS:staging Feb 3, 2021
Mic92 added a commit to Mic92/nixpkgs that referenced this pull request Feb 15, 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

4 participants