From 4448efbdd742abc2cea4f1ae733bb98b6dfc7cba Mon Sep 17 00:00:00 2001 From: Luna Nova Date: Sat, 7 Mar 2026 19:57:44 -0800 Subject: [PATCH] rocmPackages.rocm-comgr: fix failure to find code object when xnack any variant should match Fixes No compatible code objects found for: gfx90a:sramecc+:xnack- in /nix/store/klazf7j7i5642cyjwi125fx4fdwx82f3-python3.13-torch-2.10.0-lib/lib/libtorch_hip.so, value of HIP_FORCE_SPIRV_CODEOBJECT: 0. Available code objects: [amdgcn-amd-amdhsa--gfx90a] Failed to load fat binary for function '_ZN2at6native29vectorized_elementwise_kernelILi4ENS0_11FillFunctorIiEESt5arrayIPcLm1EEEEviT0_T1_' (error 200) --- pkgs/development/rocm-modules/rocm-comgr/default.nix | 3 +++ .../rocm-comgr/fix-ccob-compat-output-filename.patch | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 pkgs/development/rocm-modules/rocm-comgr/fix-ccob-compat-output-filename.patch diff --git a/pkgs/development/rocm-modules/rocm-comgr/default.nix b/pkgs/development/rocm-modules/rocm-comgr/default.nix index 4e1d5432a178..0a49cb0a24fa 100644 --- a/pkgs/development/rocm-modules/rocm-comgr/default.nix +++ b/pkgs/development/rocm-modules/rocm-comgr/default.nix @@ -40,6 +40,9 @@ stdenv.mkDerivation (finalAttrs: { url = "https://github.com/GZGavinZhao/rocm-llvm-project/commit/2c1e44fc3eacadcafdd4ada3e3184a092b6f26c5.patch"; relative = "amd/comgr"; }) + # Fix: CCOB compat patch used coerced (featureless) name for output filename, + # causing CLR's code_obj_map key to miss when looking up device ISA with features + ./fix-ccob-compat-output-filename.patch ]; postPatch = '' diff --git a/pkgs/development/rocm-modules/rocm-comgr/fix-ccob-compat-output-filename.patch b/pkgs/development/rocm-modules/rocm-comgr/fix-ccob-compat-output-filename.patch new file mode 100644 index 000000000000..813f419ef3a9 --- /dev/null +++ b/pkgs/development/rocm-modules/rocm-comgr/fix-ccob-compat-output-filename.patch @@ -0,0 +1,11 @@ +--- a/src/comgr-compiler.cpp ++++ b/src/comgr-compiler.cpp +@@ -1425,7 +1425,7 @@ + // Add an output file for each target + SmallString<128> OutputFilePath = OutputDir; + sys::path::append(OutputFilePath, +- OutputPrefix + "-" + CompatEntry + "." + FileExtension); ++ OutputPrefix + "-" + Entry + "." + FileExtension); + + BundlerConfig.TargetNames.emplace_back(CompatEntry); + BundlerConfig.OutputFileNames.emplace_back(OutputFilePath);