From f2b2ae018db90bdfec1ea7f43545787ccbe31961 Mon Sep 17 00:00:00 2001 From: Johannes Arnold Date: Tue, 23 Mar 2021 19:34:15 +0100 Subject: [PATCH 1/2] AMD: add configurations for graphics cards --- common/gpu/amd/default.nix | 17 +++++++++++++++++ common/gpu/amd/sea-islands/default.nix | 4 ++++ common/gpu/amd/southern-islands/default.nix | 4 ++++ flake.nix | 3 +++ 4 files changed, 28 insertions(+) create mode 100644 common/gpu/amd/default.nix create mode 100644 common/gpu/amd/sea-islands/default.nix create mode 100644 common/gpu/amd/southern-islands/default.nix diff --git a/common/gpu/amd/default.nix b/common/gpu/amd/default.nix new file mode 100644 index 0000000..3f98e98 --- /dev/null +++ b/common/gpu/amd/default.nix @@ -0,0 +1,17 @@ +{ config, lib, pkgs, ... }: + +{ + boot.initrd.kernelModules = [ "amdgpu" ]; + services.xserver.videoDrivers = [ "amdgpu" ]; + + hardware.opengl.extraPackages = with pkgs; [ + rocm-opencl-icd + rocm-opencl-runtime + amdvlk + ]; + + hardware.opengl = { + driSupport = lib.mkDefault true; + driSupport32Bit = lib.mkDefault true; + }; +} diff --git a/common/gpu/amd/sea-islands/default.nix b/common/gpu/amd/sea-islands/default.nix new file mode 100644 index 0000000..4e37395 --- /dev/null +++ b/common/gpu/amd/sea-islands/default.nix @@ -0,0 +1,4 @@ +{ + imports = [ ../. ]; + boot.kernelParams = [ "radeon.cik_support=0" "amdgpu.cik_support=1" ]; +} diff --git a/common/gpu/amd/southern-islands/default.nix b/common/gpu/amd/southern-islands/default.nix new file mode 100644 index 0000000..da68676 --- /dev/null +++ b/common/gpu/amd/southern-islands/default.nix @@ -0,0 +1,4 @@ +{ + imports = [ ../. ]; + boot.kernelParams = [ "radeon.si_support=0" "amdgpu.si_support=1" ]; +} diff --git a/flake.nix b/flake.nix index 6984470..a7fd70c 100644 --- a/flake.nix +++ b/flake.nix @@ -83,6 +83,9 @@ common-cpu-intel-sandy-bridge = import ./common/cpu/intel/sandy-bridge; common-gpu-nvidia = import ./common/gpu/nvidia.nix; common-gpu-nvidia-disable = import ./common/gpu/nvidia-disable.nix; + common-gpu-amd = import ./common/gpu/amd; + common-gpu-amd-sea-islands = import ./common/gpu/amd/sea-islands; + common-gpu-amd-southern-islands = import ./common/gpu/amd/southern-islands; common-pc-hdd = import ./common/pc/hdd; common-pc-laptop-hdd = import ./common/pc/laptop/hdd; common-pc-laptop-ssd = import ./common/pc/ssd; From 40ddf363c28fefac3a6685529e456a822ab7ade6 Mon Sep 17 00:00:00 2001 From: Johannes Arnold Date: Wed, 14 Apr 2021 16:18:05 +0200 Subject: [PATCH 2/2] Document driver choice --- common/gpu/amd/sea-islands/default.nix | 1 + common/gpu/amd/southern-islands/default.nix | 1 + 2 files changed, 2 insertions(+) diff --git a/common/gpu/amd/sea-islands/default.nix b/common/gpu/amd/sea-islands/default.nix index 4e37395..697e825 100644 --- a/common/gpu/amd/sea-islands/default.nix +++ b/common/gpu/amd/sea-islands/default.nix @@ -1,4 +1,5 @@ { imports = [ ../. ]; + # Explicitly set amdgpu support in place of radeon boot.kernelParams = [ "radeon.cik_support=0" "amdgpu.cik_support=1" ]; } diff --git a/common/gpu/amd/southern-islands/default.nix b/common/gpu/amd/southern-islands/default.nix index da68676..4939117 100644 --- a/common/gpu/amd/southern-islands/default.nix +++ b/common/gpu/amd/southern-islands/default.nix @@ -1,4 +1,5 @@ { imports = [ ../. ]; + # Explicitly set amdgpu support in place of radeon boot.kernelParams = [ "radeon.si_support=0" "amdgpu.si_support=1" ]; }