From 16eeaaede212ddeb1c062bf3e92b693e36958811 Mon Sep 17 00:00:00 2001 From: Kopatz <7265381+Kropatz@users.noreply.github.com> Date: Wed, 16 Apr 2025 15:44:58 +0200 Subject: [PATCH] update mesa --- modules/hardware/amd-gpu.nix | 41 ++++++++++++++------------ modules/hardware/opencl.patch | 54 +++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 19 deletions(-) create mode 100644 modules/hardware/opencl.patch diff --git a/modules/hardware/amd-gpu.nix b/modules/hardware/amd-gpu.nix index 2ac950b..2a7b49e 100644 --- a/modules/hardware/amd-gpu.nix +++ b/modules/hardware/amd-gpu.nix @@ -7,14 +7,17 @@ in { config = let - mesa-new = pkgs.mesa.overrideAttrs (oldAttrs: { + mesa-new = pkgs.mesa.overrideAttrs (old: { src = pkgs.fetchFromGitLab { domain = "gitlab.freedesktop.org"; owner = "mesa"; repo = "mesa"; - rev = "f23b376e847602d4fe7976f3bbb877dfd9d8b417"; - hash = "sha256-prPhezquh63OFkFdYNCRN1OkdwA+CTu88hUoHQD5kCw="; + rev = "93547d45ceb0a59f429f6029b339c044f8aaabaa"; + hash = "sha256-u5Lksclv0+cMfO02Ilp6v/7UCoTdm5veIvf1uejWlgQ="; }; + patches = [ + ./opencl.patch + ]; }); #mesa-new = pkgs.mesa-git.mesa.overrideAttrs (oldAttrs: { @@ -34,9 +37,9 @@ in { hardware.graphics = { enable = true; enable32Bit = true; - package = lib.mkForce mesa-new.drivers; + package = lib.mkForce mesa-new; #extraPackages = with pkgs; [ mesa-git.amdvlk ]; - #extraPackages = with pkgs; [ rocmPackages.clr.icd ]; + #extraPackages = with pkgs; [ rocmPackages.clr.icd ]; }; hardware.amdgpu.initrd.enable = lib.mkDefault true; @@ -50,19 +53,19 @@ in { systemd.packages = with pkgs; [ lact ]; systemd.services.lactd.wantedBy = [ "multi-user.target" ]; #rocm - #systemd.tmpfiles.rules = - # let - # rocmEnv = pkgs.symlinkJoin { - # name = "rocm-combined"; - # paths = with pkgs.rocmPackages; [ - # rocblas - # hipblas - # clr - # ]; - # }; - # in - # [ - # "L+ /opt/rocm - - - - ${rocmEnv}" - # ]; + #systemd.tmpfiles.rules = + # let + # rocmEnv = pkgs.symlinkJoin { + # name = "rocm-combined"; + # paths = with pkgs.rocmPackages; [ + # rocblas + # hipblas + # clr + # ]; + # }; + # in + # [ + # "L+ /opt/rocm - - - - ${rocmEnv}" + # ]; }; } diff --git a/modules/hardware/opencl.patch b/modules/hardware/opencl.patch new file mode 100644 index 0000000..bdd2109 --- /dev/null +++ b/modules/hardware/opencl.patch @@ -0,0 +1,54 @@ +diff --git a/meson.build b/meson.build +index c150bff74ff..37fa7f0531b 100644 +--- a/meson.build ++++ b/meson.build +@@ -1850,7 +1850,7 @@ endif + + dep_clang = null_dep + if with_clc or with_gallium_clover +- llvm_libdir = dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir') ++ llvm_libdir = get_option('clang-libdir') + + dep_clang = cpp.find_library('clang-cpp', dirs : llvm_libdir, required : false) + +diff --git a/meson.options b/meson.options +index 82324617884..4bde97a8568 100644 +--- a/meson.options ++++ b/meson.options +@@ -738,3 +738,10 @@ option( + 'none', 'dri2' + ], + ) ++ ++option( ++ 'clang-libdir', ++ type : 'string', ++ value : '', ++ description : 'Locations to search for clang libraries.' ++) +diff --git a/src/gallium/targets/opencl/meson.build b/src/gallium/targets/opencl/meson.build +index ab2c83556a8..a59e88e122f 100644 +--- a/src/gallium/targets/opencl/meson.build ++++ b/src/gallium/targets/opencl/meson.build +@@ -56,7 +56,7 @@ if with_opencl_icd + configuration : _config, + input : 'mesa.icd.in', + output : 'mesa.icd', +- install : true, ++ install : false, + install_tag : 'runtime', + install_dir : join_paths(get_option('sysconfdir'), 'OpenCL', 'vendors'), + ) +diff --git a/src/gallium/targets/rusticl/meson.build b/src/gallium/targets/rusticl/meson.build +index 35833dc7423..41a95927cab 100644 +--- a/src/gallium/targets/rusticl/meson.build ++++ b/src/gallium/targets/rusticl/meson.build +@@ -63,7 +63,7 @@ configure_file( + configuration : _config, + input : 'rusticl.icd.in', + output : 'rusticl.icd', +- install : true, ++ install : false, + install_tag : 'runtime', + install_dir : join_paths(get_option('sysconfdir'), 'OpenCL', 'vendors'), + )