From e82629a01b494e674f8ac75eb5b92cbc45d32f6a Mon Sep 17 00:00:00 2001 From: Antoine Viallon Date: Mon, 13 May 2024 02:16:38 +0200 Subject: [PATCH] [Hardware/AMD] tune system to better utilize ROCm --- hardware/amd/amdgpu.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hardware/amd/amdgpu.nix b/hardware/amd/amdgpu.nix index 83f212f..8b991a3 100644 --- a/hardware/amd/amdgpu.nix +++ b/hardware/amd/amdgpu.nix @@ -47,8 +47,13 @@ in { ); }; + systemd.tmpfiles.rules = [ + "L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}" + ]; + environment.variables = { - "AMD_VULKAN_ICD" = strings.toUpper cfg.defaultVulkanImplementation; + AMD_VULKAN_ICD = strings.toUpper cfg.defaultVulkanImplementation; + ROC_ENABLE_PRE_VEGA = "1"; # Enable OpenCL with Polaris GPUs }; # Make rocblas and rocfft work @@ -57,5 +62,11 @@ in { "/sys/devices/virtual/kfd?" "/dev/dri/renderD128?" ]; + + nixpkgs.overlays = [(final: prev: { + # Overlay Blender to use the HIP build if we have a compatible AMD GPU + blender = final.blender-hip; + blender-prev = prev.blender; + })]; }; }