1 { config, lib, pkgs, ... }:
4 cfg = config.hardware.amdgpu.amdvlk;
6 options.hardware.amdgpu.amdvlk = {
7 enable = lib.mkEnableOption "AMDVLK Vulkan driver";
9 package = lib.mkPackageOption pkgs "amdvlk" { };
11 supportExperimental.enable = lib.mkEnableOption "Experimental features support";
13 support32Bit.enable = lib.mkEnableOption "32-bit driver support";
14 support32Bit.package = lib.mkPackageOption pkgs [ "driversi686Linux" "amdvlk" ] { };
16 settings = lib.mkOption {
17 type = with lib.types; attrsOf (either str int);
20 AllowVkPipelineCachingToDisk = 1;
23 EnableVmAlwaysValid = 1;
24 IdleAfterSubmitGpuMask = 1;
27 Runtime settings for AMDVLK to be configured {file}`/etc/amd/amdVulkanSettings.cfg`.
28 See [AMDVLK GitHub page](https://github.com/GPUOpen-Drivers/AMDVLK?tab=readme-ov-file#runtime-settings).
33 config = lib.mkIf cfg.enable {
36 extraPackages = [ cfg.package ];
37 extraPackages32 = [ cfg.support32Bit.package ];
40 services.xserver.videoDrivers = [ "amdgpu" ];
42 environment.sessionVariables = lib.mkIf cfg.supportExperimental.enable {
43 AMDVLK_ENABLE_DEVELOPING_EXT = "all";
46 environment.etc = lib.mkIf (cfg.settings != { }) {
47 "amd/amdVulkanSettings.cfg".text = lib.concatStrings
50 ${n},${builtins.toString v}
57 maintainers = with lib.maintainers; [ johnrtitor ];