mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-09-29 23:52:55 +00:00
nixos/amdvlk: init module (#318175)
This commit is contained in:
parent
c870e19d09
commit
7082d01967
@ -4,7 +4,8 @@
|
||||
|
||||
## Highlights {#sec-release-24.11-highlights}
|
||||
|
||||
- Create the first release note entry in this section!
|
||||
- [AMDVLK](https://github.com/GPUOpen-Drivers/AMDVLK), AMD's open source Vulkan driver, is now available to be configured as `hardware.amdgpu.amdvlk` option.
|
||||
This also allows configuring runtime settings of AMDVLK and enabling experimental features.
|
||||
|
||||
## New Services {#sec-release-24.11-new-services}
|
||||
|
||||
|
@ -549,6 +549,7 @@
|
||||
./services/games/xonotic.nix
|
||||
./services/hardware/acpid.nix
|
||||
./services/hardware/actkbd.nix
|
||||
./services/hardware/amdvlk.nix
|
||||
./services/hardware/argonone.nix
|
||||
./services/hardware/asusd.nix
|
||||
./services/hardware/auto-cpufreq.nix
|
||||
|
61
nixos/modules/services/hardware/amdvlk.nix
Normal file
61
nixos/modules/services/hardware/amdvlk.nix
Normal file
@ -0,0 +1,61 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.hardware.amdgpu.amdvlk;
|
||||
in {
|
||||
options.hardware.amdgpu.amdvlk = {
|
||||
enable = lib.mkEnableOption "AMDVLK Vulkan driver";
|
||||
|
||||
package = lib.mkPackageOption pkgs "amdvlk" { };
|
||||
|
||||
supportExperimental.enable = lib.mkEnableOption "Experimental features support";
|
||||
|
||||
support32Bit.enable = lib.mkEnableOption "32-bit driver support";
|
||||
support32Bit.package = lib.mkPackageOption pkgs [ "driversi686Linux" "amdvlk" ] { };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = with lib.types; attrsOf (either str int);
|
||||
default = { };
|
||||
example = {
|
||||
AllowVkPipelineCachingToDisk = 1;
|
||||
ShaderCacheMode = 1;
|
||||
IFH = 0;
|
||||
EnableVmAlwaysValid = 1;
|
||||
IdleAfterSubmitGpuMask = 1;
|
||||
};
|
||||
description = ''
|
||||
Runtime settings for AMDVLK to be configured {file}`/etc/amd/amdVulkanSettings.cfg`.
|
||||
See [AMDVLK GitHub page](https://github.com/GPUOpen-Drivers/AMDVLK?tab=readme-ov-file#runtime-settings).
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
hardware.opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
extraPackages = [ cfg.package ];
|
||||
driSupport32Bit = cfg.support32Bit.enable;
|
||||
extraPackages32 = [ cfg.support32Bit.package ];
|
||||
};
|
||||
|
||||
services.xserver.videoDrivers = [ "amdgpu" ];
|
||||
|
||||
environment.sessionVariables = lib.mkIf cfg.supportExperimental.enable {
|
||||
AMDVLK_ENABLE_DEVELOPING_EXT = "all";
|
||||
};
|
||||
|
||||
environment.etc = lib.mkIf (cfg.settings != { }) {
|
||||
"amd/amdVulkanSettings.cfg".text = lib.concatStrings
|
||||
(lib.mapAttrsToList
|
||||
(n: v: ''
|
||||
${n},${builtins.toString v}
|
||||
'')
|
||||
cfg.settings);
|
||||
};
|
||||
};
|
||||
|
||||
meta = {
|
||||
maintainers = with lib.maintainers; [ johnrtitor ];
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user