From 3ff6d70d2ea5788d873a58d853c74b89c5d6dfaa Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Tue, 9 Sep 2025 11:20:49 -0400 Subject: [PATCH] blender: build hip kernels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without this, things need to be built at runtime. This matches what is done for CUDA. Technically we are only using `hipcc` (gotten here via `clr`) at build time, however it is complicated in that Blender assumes all ROCm things are together, and so *just* having `hipcc` causes it to get confused a bit (especially later when we add hiprt support). While setting `HIP_ROOT_DIR` might help a bit, it’s all a bit fragile and we have `clr` in the closure already anyway so it doesn’t seem worth it to over-optimize. Using `clr` brings libraries and such, so add it to buildInputs instead of nativeBuildInputs to be a bit safe. --- pkgs/by-name/bl/blender/package.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/by-name/bl/blender/package.nix b/pkgs/by-name/bl/blender/package.nix index 236fa7985fd8..4d708eed8a1e 100644 --- a/pkgs/by-name/bl/blender/package.nix +++ b/pkgs/by-name/bl/blender/package.nix @@ -194,6 +194,9 @@ stdenv'.mkDerivation (finalAttrs: { "-DOPTIX_ROOT_DIR=${optix}" "-DWITH_CYCLES_CUDA_BINARIES=ON" ] + ++ lib.optionals hipSupport [ + "-DWITH_CYCLES_HIP_BINARIES=ON" + ] ++ lib.optionals waylandSupport [ "-DWITH_GHOST_WAYLAND=ON" "-DWITH_GHOST_WAYLAND_DBUS=ON" @@ -268,6 +271,7 @@ stdenv'.mkDerivation (finalAttrs: { zstd ] ++ lib.optional embreeSupport embree + ++ lib.optional hipSupport rocmPackages.clr ++ lib.optional openImageDenoiseSupport (openimagedenoise.override { inherit cudaSupport tbb; }) ++ ( if (!stdenv.hostPlatform.isDarwin) then