From a3c401f35e2a6d887c7dded993ede77c2e59d09c Mon Sep 17 00:00:00 2001 From: Sebastian Neubauer Date: Fri, 19 Aug 2022 21:01:57 +0200 Subject: [PATCH] blender-hip: add blender with hip support (#187241) --- pkgs/applications/misc/blender/default.nix | 7 ++++++- pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/misc/blender/default.nix b/pkgs/applications/misc/blender/default.nix index 83e25a37e5d3..ea59e9bd108f 100644 --- a/pkgs/applications/misc/blender/default.nix +++ b/pkgs/applications/misc/blender/default.nix @@ -6,6 +6,7 @@ , zlib, zstd, fftw, opensubdiv, freetype, jemalloc, ocl-icd, addOpenGLRunpath , jackaudioSupport ? false, libjack2 , cudaSupport ? config.cudaSupport or false, cudaPackages ? {} +, hipSupport ? false, hip # comes with a significantly larger closure size , colladaSupport ? true, opencollada , spaceNavSupport ? stdenv.isLinux, libspnav , makeWrapper @@ -86,7 +87,11 @@ stdenv.mkDerivation rec { '${python310Packages.numpy}/${python.sitePackages}/numpy' '' else '' substituteInPlace extern/clew/src/clew.c --replace '"libOpenCL.so"' '"${ocl-icd}/lib/libOpenCL.so"' - ''); + '') + + (if hipSupport then '' + substituteInPlace extern/hipew/src/hipew.c --replace '"/opt/rocm/hip/lib/libamdhip64.so"' '"${hip}/lib/libamdhip64.so"' + substituteInPlace extern/hipew/src/hipew.c --replace '"opt/rocm/hip/bin"' '"${hip}/bin"' + '' else ""); cmakeFlags = [ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1572af1314c8..6f8786a40cf4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -26344,6 +26344,8 @@ with pkgs; blender-with-packages = callPackage ../applications/misc/blender/wrapper.nix {}; + blender-hip = blender.override { hipSupport = true; }; + blflash = callPackage ../tools/misc/blflash { }; blogc = callPackage ../applications/misc/blogc { };