From 512ba6f4547f6f461544f652d9c5ac6e4ac1191e Mon Sep 17 00:00:00 2001 From: Luna Nova Date: Mon, 29 Sep 2025 08:06:15 -0700 Subject: [PATCH 1/3] rocmPackages.hiprt: use lib.cmake* functions --- pkgs/development/rocm-modules/6/hiprt/default.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/development/rocm-modules/6/hiprt/default.nix b/pkgs/development/rocm-modules/6/hiprt/default.nix index 22622612b0fb..bca1da365c71 100644 --- a/pkgs/development/rocm-modules/6/hiprt/default.nix +++ b/pkgs/development/rocm-modules/6/hiprt/default.nix @@ -36,13 +36,13 @@ stdenv.mkDerivation (finalAttrs: { ]; cmakeFlags = [ - "-D CMAKE_BUILD_TYPE=Release" - "-D BAKE_KERNEL=OFF" - "-D BAKE_COMPILED_KERNEL=OFF" - "-D BITCODE=ON" - "-D PRECOMPILE=ON" - "-D NO_UNITTEST=ON" - "-D FORCE_DISABLE_CUDA=ON" + (lib.cmakeBool "BAKE_KERNEL" false) + (lib.cmakeBool "BAKE_COMPILED_KERNEL" false) + (lib.cmakeBool "BITCODE" true) + (lib.cmakeBool "PRECOMPILE" true) + # needs accelerator + (lib.cmakeBool "NO_UNITTEST" true) + (lib.cmakeBool "FORCE_DISABLE_CUDA" true) ]; postInstall = '' From d51e74bd5107155b99354a23c7fc9b346cf92fd2 Mon Sep 17 00:00:00 2001 From: Luna Nova Date: Mon, 29 Sep 2025 08:06:19 -0700 Subject: [PATCH 2/3] rocmPackages.hiprt: add rocm team --- pkgs/development/rocm-modules/6/hiprt/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/rocm-modules/6/hiprt/default.nix b/pkgs/development/rocm-modules/6/hiprt/default.nix index bca1da365c71..e9bff45a7d72 100644 --- a/pkgs/development/rocm-modules/6/hiprt/default.nix +++ b/pkgs/development/rocm-modules/6/hiprt/default.nix @@ -58,6 +58,7 @@ stdenv.mkDerivation (finalAttrs: { maintainers = with lib.maintainers; [ mksafavi ]; + teams = [ lib.teams.rocm ]; platforms = lib.platforms.linux; }; }) From 882158afe0f6fe1a965d83f971bf217587d49082 Mon Sep 17 00:00:00 2001 From: Luna Nova Date: Mon, 29 Sep 2025 08:06:22 -0700 Subject: [PATCH 3/3] rocmPackages.hiprt: disable kernel encryption support Per upstream encryption of kernels was a holdover from when hiprt was closed source. Let's disable it and drop the need to rebuild easy-encryption. https://github.com/GPUOpen-LibrariesAndSDKs/HIPRT/issues/11#issuecomment-2105410458 --- pkgs/development/rocm-modules/6/hiprt/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/rocm-modules/6/hiprt/default.nix b/pkgs/development/rocm-modules/6/hiprt/default.nix index e9bff45a7d72..d856477a01cc 100644 --- a/pkgs/development/rocm-modules/6/hiprt/default.nix +++ b/pkgs/development/rocm-modules/6/hiprt/default.nix @@ -4,7 +4,6 @@ fetchFromGitHub, cmake, clr, - gcc, python3, }: @@ -20,13 +19,12 @@ stdenv.mkDerivation (finalAttrs: { }; postPatch = '' - g++ contrib/easy-encryption/cl.cpp -o contrib/easy-encryption/bin/linux/ee64 #replacing prebuilt binary + rm -rf contrib/easy-encrypt # contains prebuilt easy-encrypt binaries, we disable encryption substituteInPlace contrib/Orochi/contrib/hipew/src/hipew.cpp --replace-fail '"/opt/rocm/hip/lib/' '"${clr}/lib' substituteInPlace hiprt/hiprt_libpath.h --replace-fail '"/opt/rocm/hip/lib/' '"${clr}/lib/' ''; nativeBuildInputs = [ - gcc # required for replacing easy-encryption binary cmake python3 ]; @@ -42,6 +40,8 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeBool "PRECOMPILE" true) # needs accelerator (lib.cmakeBool "NO_UNITTEST" true) + # we have no need to support baking encrypted kernels into object files + (lib.cmakeBool "NO_ENCRYPT" true) (lib.cmakeBool "FORCE_DISABLE_CUDA" true) ];