From 3b4ce62451358882fb3f9bad5930fd13086223d1 Mon Sep 17 00:00:00 2001 From: David McFarland Date: Wed, 21 Sep 2016 22:42:16 -0300 Subject: amdgpu-pro: Init at 16.30.3-315407 --- nixos/modules/hardware/video/amdgpu-pro.nix | 56 +++++++++++++++++++++++++++++ nixos/modules/module-list.nix | 1 + 2 files changed, 57 insertions(+) create mode 100644 nixos/modules/hardware/video/amdgpu-pro.nix (limited to 'nixos/modules') diff --git a/nixos/modules/hardware/video/amdgpu-pro.nix b/nixos/modules/hardware/video/amdgpu-pro.nix new file mode 100644 index 0000000000000..3723d7690dc67 --- /dev/null +++ b/nixos/modules/hardware/video/amdgpu-pro.nix @@ -0,0 +1,56 @@ +# This module provides the proprietary AMDGPU-PRO drivers. + +{ config, lib, pkgs, pkgs_i686, ... }: + +with lib; + +let + + drivers = config.services.xserver.videoDrivers; + + enabled = elem "amdgpu-pro" drivers; + + package = config.boot.kernelPackages.amdgpu-pro; + package32 = pkgs_i686.linuxPackages.amdgpu-pro.override { libsOnly = true; kernel = null; }; + + opengl = config.hardware.opengl; + +in + +{ + + config = mkIf enabled { + + services.xserver.drivers = singleton + { name = "amdgpu"; modules = [ package ]; libPath = [ package ]; }; + + hardware.opengl.package = package; + hardware.opengl.package32 = package32; + + boot.extraModulePackages = [ package ]; + + boot.blacklistedKernelModules = [ "radeon" ]; + + hardware.firmware = [ package ]; + + system.activationScripts.setup-amdgpu-pro = '' + mkdir -p /run/lib + ln -sfn ${package}/lib ${package.libCompatDir} + '' + optionalString opengl.driSupport32Bit '' + ln -sfn ${package32}/lib ${package32.libCompatDir} + ''; + + environment.etc = { + "amd/amdrc".source = package + "/etc/amd/amdrc"; + "amd/amdapfxx.blb".source = package + "/etc/amd/amdapfxx.blb"; + "gbm/gbm.conf".source = package + "/etc/gbm/gbm.conf"; + "OpenCL/vendors/amdocl64.icd".source = package + "/etc/OpenCL/vendors/amdocl64.icd"; + "vulkan/icd.d/amd_icd64.json".source = package + "/etc/vulkan/icd.d/amd_icd64.json"; + } // optionalAttrs opengl.driSupport32Bit { + "OpenCL/vendors/amdocl32.icd".source = package32 + "/etc/OpenCL/vendors/amdocl32.icd"; + "vulkan/icd.d/amd_icd32.json".source = package32 + "/etc/vulkan/icd.d/amd_icd32.json"; + }; + + }; + +} diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 7064dcd968ae0..ed5245ec7274a 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -38,6 +38,7 @@ ./hardware/opengl.nix ./hardware/pcmcia.nix ./hardware/video/amdgpu.nix + ./hardware/video/amdgpu-pro.nix ./hardware/video/ati.nix ./hardware/video/bumblebee.nix ./hardware/video/displaylink.nix -- cgit 1.4.1