diff --git a/hosts/desktop/gpu-configuration.nix b/hosts/desktop/gpu-configuration.nix new file mode 100644 index 0000000..53d1d24 --- /dev/null +++ b/hosts/desktop/gpu-configuration.nix @@ -0,0 +1,30 @@ +{ config, pkgs, ... }: + +{ + imports = [ ]; + options.shared.configuration.gpu = { }; + config = { + boot.initrd.kernelModules = [ "amdgpu" ]; + services.xserver.videoDrivers = [ "amdgpu" ]; + + environment = { + variables = { + ROC_ENABLE_PRE_VEGA = "1"; + }; + systemPackages = with pkgs; [ + clinfo + ]; + }; + + hardware.opengl = { + enable = true; + extraPackages = with pkgs; [ + amdvlk + rocmPackages.clr.icd + ]; + driSupport = true; + driSupport32Bit = true; + }; + + }; +} diff --git a/hosts/desktop/shared-configuration.nix b/hosts/desktop/shared-configuration.nix index 7058ebe..8bcc4aa 100644 --- a/hosts/desktop/shared-configuration.nix +++ b/hosts/desktop/shared-configuration.nix @@ -7,6 +7,7 @@ ../../modules/nixos/systems/fonts.nix # Include the results of the hardware scan. ./hardware-configuration.nix + ./gpu-configuration.nix ]; options.shared.configuration = { }; config = { @@ -81,10 +82,6 @@ wl-clipboard ]; - hardware = { - opengl.enable = true; - }; - # Enable the X11 windowing system. services.xserver.enable = true;