Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3f92427
rocmPackages.rocblas: split Tensile kernels into per-arch shards
randomizedcoder Sep 28, 2026
6a0b03d
llvmPackages.openmp: build via runtimes entry point for LLVM >= 23
randomizedcoder Oct 11, 2026
72f4d36
rocmPackages.llvm: 7.2.4 -> 10.1.0, build LLVM 24 on the llvmPackages…
randomizedcoder Oct 11, 2026
3df5955
rocmPackages: 7.2.4 -> 10.1.0
randomizedcoder Oct 11, 2026
9045bd0
rocmPackages.rocm-comgr: rebase ISA-compat CCOB patch for LLVM 24
randomizedcoder Oct 11, 2026
b649366
rocmPackages.rocm-runtime: drop patches upstreamed in ROCr 1.21
randomizedcoder Oct 11, 2026
c6c3a29
rocmPackages.amdsmi: adapt to 27.0.0 ABI
randomizedcoder Oct 11, 2026
c5ea90e
rocmPackages.rocprofiler-sdk: drop patches upstreamed in therock-10.1
randomizedcoder Oct 11, 2026
c451456
rocmPackages.rocprof-trace-decoder: 0.1.7 -> 0.2.2
randomizedcoder Oct 11, 2026
dd8b0cd
rocmPackages.rccl: monorepo source, rocm_smi -> amd_smi, drop mscclpp
randomizedcoder Oct 11, 2026
a0866fb
rocmPackages.composable_kernel: adapt to ROCm 10 conv targets and cla…
randomizedcoder Oct 11, 2026
cda386e
rocmPackages.miopen: 3.6.0 (standalone build off, ISA compat, hipconv…
randomizedcoder Oct 11, 2026
f47e942
rocmPackages.hipblaslt: 1.4.1 (stinkytofu, amd_smi, nanobind)
randomizedcoder Oct 11, 2026
69f78ea
rocmPackages.hipsparselt: add hipblaslt device-library/stinkytofu sou…
randomizedcoder Oct 11, 2026
62570cb
rocmPackages.{hipsolver,rocsolver}: link openblas-backed LAPACK
randomizedcoder Oct 11, 2026
24b423c
rocmPackages.rocwmma: rocm_smi -> amd_smi, system googletest
randomizedcoder Oct 11, 2026
7ed4a84
rocmPackages.rocmlir: track rocmlirTriton for therock-10.1
randomizedcoder Oct 11, 2026
7e948fc
rocmPackages.migraphx: 7.2.4 -> 10.1.0, stub rocm_add_version_resource
randomizedcoder Oct 11, 2026
1d3f1d0
rocmPackages.hipfort: 7.2.4 -> 10.1.0
randomizedcoder Oct 11, 2026
66076f0
rocmPackages.rocgdb: 7.2.4 -> 10.1.0
randomizedcoder Oct 11, 2026
e15ea47
rocmPackages.{rocdbgapi,rocr-debug-agent}: move to rocm-systems monorepo
randomizedcoder Oct 11, 2026
1b422cc
rocmPackages.rocshmem: move to rocm-systems monorepo, fix device bitcode
randomizedcoder Oct 11, 2026
179db62
rocmPackages: document packages kept at pre-10.x versions
randomizedcoder Oct 11, 2026
f907ab4
rocmPackages.rocblas: 7.2.4 -> 10.1.0
randomizedcoder Oct 11, 2026
5680940
torch: fix ROCm 10 build and import hang
randomizedcoder Oct 11, 2026
386f847
ollama: support ROCm >= 8 (map to rocm_v7_2 backend)
randomizedcoder Oct 11, 2026
34eede4
blender: fix HIP library lookup for ROCm 10
randomizedcoder Oct 11, 2026
5b5e802
opensplat: add pkg-config and libdrm for ROCm 10
randomizedcoder Oct 11, 2026
f088acc
torchcodec: add libdrm for ROCm 10
randomizedcoder Oct 11, 2026
c68c639
nixos/doc/manual/release-notes: note ROCm 10.1 update
randomizedcoder Oct 11, 2026
dad7aff
rocmPackages.rdc: drop CXXFLAGS patch fixed upstream in therock-10.1
randomizedcoder Oct 12, 2026
468b86a
rocmPackages.rpp: fix the 10.1.0 build for both backends
randomizedcoder Oct 12, 2026
2d2884a
rocmPackages.rocm-bandwidth-test: remove
randomizedcoder Oct 14, 2026
f9b059f
rocmPackages: use the two-component therock version
randomizedcoder Oct 14, 2026
3544b89
rocmPackages.rocmUpdateScript: handle therock tags, cap at major 10
randomizedcoder Oct 14, 2026
925eadb
rocmPackages.rocprof-trace-decoder: take comgr and runtime from the s…
randomizedcoder Oct 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions nixos/doc/manual/release-notes/rl-2611.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,25 @@
authentication layer before exposing it to other users.
- `services.autobrr.secretFile` has been removed, as autobrr no longer uses a session secret since version 1.82.0. Remove the option from your configuration.

- `rocmPackages` has been updated from ROCm 7.2.4 to ROCm 10.1.0. AMD skipped
the 8.x and 9.x series. ROCm 10 breaks ABI and API:
`amdsmi` moves to the 27.0.0 ABI (`libamd_smi.so.27`, several clock/throttle
APIs removed), `rocsparse` drops `rocsparse_indextype_u16`, `hipcub` removes
its deprecated iterators and operators, and `miopen` drops its OpenCL backend.
Update out-of-tree packages that compile against `rocmPackages` for these
changes. The ROCm LLVM toolchain is now LLVM 24.

`rocmPackages.rocmlir` now builds from `ROCm/rocmlirTriton`, the rocMLIR

ghost Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have been more specific on romlir. A drop in replacement does not mean replace the nixpkgs copy with something different. rocmlir upstream is still actively being developed.

This change should be a few different things:

  • new rocmPackage
  • migraphx updated to depend on that
  • some documentation in the existing rcomlir package why it doesn't have a 10.1 version update.
  • check (and justify) if the other nixpkgs consumers should be switched

fork that AMDMIGraphX 10.1 pins, instead of `ROCm/rocMLIR`.

`rocmPackages.rocm-bandwidth-test` has been removed; upstream retired it.

`composable_kernel`, the `miopen` CK solvers, and `vllm` no longer support
`gfx900`/`gfx906` (Vega / MI25 / MI50 / Radeon VII) on ROCm 10.

ghost Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and the rocmlir are good reasons to go via rocmPackage_10 rather than a breaking change on master.

`rocblas`/`hipblas`-only consumers such as `llama-cpp` and `ollama` still
build for those targets. To stay on ROCm 7.2.x, use the NixOS 26.05
stable channel.

- Artalk has been updated to 2.10.0. Its default configuration and data
directory discovery changed; see the [upstream migration
guide](https://artalk.js.org/en/guide/releases/v2.10.0.html) when invoking
Expand Down
8 changes: 6 additions & 2 deletions pkgs/by-name/bl/blender/package.nix

ghost Oct 15, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extracted this change to #574457.

As a note: the comment added here is redundant with the commit message, and is too much about the change rather than the content. The purpose is also fairly apparently without the comment.

Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,12 @@ stdenv'.mkDerivation (finalAttrs: {
'${lib.getLib brotli}/lib/libbrotlidec.dylib'
'')
+ (lib.optionalString rocmSupport ''
substituteInPlace extern/hipew/src/hipew.c --replace-fail '"/opt/rocm/hip/lib/libamdhip64.so.${lib.versions.major rocmPackages.clr.version}"' '"${rocmPackages.clr}/lib/libamdhip64.so"'
substituteInPlace extern/hipew/src/hipew.c --replace-fail '"opt/rocm/hip/bin"' '"${rocmPackages.clr}/bin"'
# Point hipew's bare "libamdhip64.so" candidate at clr. The HIP soname
# major (libamdhip64.so.7) no longer matches the ROCm release major, so
# keying the path off clr.version breaks on ROCm 10.
substituteInPlace extern/hipew/src/hipew.c \
--replace-fail '"libamdhip64.so"' '"${rocmPackages.clr}/lib/libamdhip64.so"' \
--replace-fail '"opt/rocm/hip/bin"' '"${rocmPackages.clr}/bin"'
'')
+ (lib.optionalString oneapiSupport ''
substituteInPlace intern/cycles/kernel/device/oneapi/CMakeLists.txt \
Expand Down
18 changes: 17 additions & 1 deletion pkgs/by-name/ol/ollama/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,27 @@ goBuild (finalAttrs: {
# (cuda_v12 / cuda_v13 / rocm_v7_1 / rocm_v7_2 / vulkan / cuda_jetpack*).
rocmMajorVersion = lib.versions.major rocmPackages.clr.version;
rocmMinorVersion = lib.versions.minor rocmPackages.clr.version;
# cmake/local.cmake only defines ROCm backend labels rocm_v7_1 (Windows)
# and rocm_v7_2 (Linux); the two "currently share build settings" and the
# label is an upstream *interface tag*, deliberately decoupled from the
# actual ROCm toolchain version (which comes from rocmPackages via
# buildInputs + AMDGPU_TARGETS). Our rocmPackages is now ROCm 10, so the
# derived rocm_v10_0 would hit `Unknown ROCm backend` (no such preset).
# Map any ROCm >= 8 to the Linux rocm_v7_2 build path — the GGML_HIP
# runner it produces is version-agnostic and links our ROCm 10 libs.
# TODO: file an upstream ollama PR adding an explicit rocm_v10_0
# preset (llama/server/CMakePresets.json) + local.cmake branch, then drop
# this remap.
rocmLinuxBackend =
if lib.versionAtLeast rocmMajorVersion "8" then
"rocm_v7_2"
else
"rocm_v${rocmMajorVersion}_${rocmMinorVersion}";
llamaBackend =
Comment on lines +275 to 280

ghost Oct 15, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

conditionalizing like this makes little sense when only one rocmPackages variant is in tree

ghost Oct 23, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

 > CMake Error at cmake/local.cmake:819 (message):
┃        >   Unknown OLLAMA_LLAMA_BACKENDS entry 'rocm_v10_0'
┃        > Call Stack (most recent call first):
┃        >   CMakeLists.txt:70 (include)

ollama/ollama#18435. It may build but it's not clear if that means supported.

if enableCuda then
"cuda_v${cudaMajorVersion}"
else if enableRocm then
"rocm_v${rocmMajorVersion}_${rocmMinorVersion}"
rocmLinuxBackend
else if enableVulkan then
"vulkan"
else
Expand Down
10 changes: 9 additions & 1 deletion pkgs/by-name/op/opensplat/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
stdenv,
cmake,
ninja,
pkg-config,
libdrm,
fetchFromGitHub,
python3,
opencv,
Expand Down Expand Up @@ -81,6 +83,10 @@ stdenv'.mkDerivation (finalAttrs: {
]
++ lib.optionals rocmSupport [
rocmPackages.clr
# ROCm 10's rocm_smi-config.cmake does find_dependency(PkgConfig) (rocm-smi-lib
# now requires libdrm_amdgpu.pc), pulled in transitively via find_package(Torch)
# -> Caffe2 LoadHIP -> rocm_smi, so pkg-config must be on the host path.
Comment on lines +86 to +88

ghost Oct 15, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slop comment that isn't needed

pkg-config
]
++ lib.optionals cudaSupport [
cudaPackages.cuda_nvcc
Expand All @@ -106,8 +112,10 @@ stdenv'.mkDerivation (finalAttrs: {
rocmPackages.hipblaslt
rocmPackages.rocblas
rocmPackages.rocsolver
rocmPackages.rocsolver
rocmPackages.miopen
# rocm_smi-config.cmake (pulled via find_package(Torch)->Caffe2 LoadHIP) runs
# pkg_check_modules(libdrm) in ROCm 10, so libdrm.pc must be on PKG_CONFIG_PATH.
Comment on lines +116 to +117

ghost Oct 15, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slop comment that isn't needed

libdrm
]
++ lib.optionals cudaSupport [
cudaPackages.cuda_cudart
Expand Down
226 changes: 134 additions & 92 deletions pkgs/development/compilers/llvm/common/openmp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,98 +24,140 @@

assert lib.assertMsg (ompdGdbSupport -> ompdSupport) "OMPD GDB support requires OMPD support!";

stdenv.mkDerivation (finalAttrs: {
pname = "openmp";
inherit version;

src =
if monorepoSrc != null then
runCommand "openmp-src-${version}"
{
inherit (monorepoSrc) passthru;
strictDeps = true;
__structuredAttrs = true;
}
''
mkdir -p "$out"
cp -r ${monorepoSrc}/cmake "$out"
cp -r ${monorepoSrc}/openmp "$out"
''
else
src;

sourceRoot = "${finalAttrs.src.name}/openmp";

outputs = [
"out"
"dev"
];

patches =
lib.optional (lib.versionOlder release_version "19") (getVersionFile "openmp/fix-find-tool.patch")
++ [
(getVersionFile "openmp/run-lit-directly.patch")
let
# LLVM 23 removed the legacy standalone OpenMP build (cmake <llvm>/openmp now
# aborts with a FATAL_ERROR). OpenMP must be built through the runtimes entry
# point (cmake <llvm>/runtimes -DLLVM_ENABLE_RUNTIMES=openmp), which supplies
# the project() call and the LLVM cmake modules. Older LLVMs keep the
# standalone layout.
useRuntimesBuild = lib.versionAtLeast release_version "23";
in
stdenv.mkDerivation (
finalAttrs:

ghost Oct 15, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Undo unnecessary indenting.

{
pname = "openmp";
inherit version;

src =
if monorepoSrc != null then
runCommand "openmp-src-${version}"
{
inherit (monorepoSrc) passthru;
strictDeps = true;
__structuredAttrs = true;
}
(
if useRuntimesBuild then
''
mkdir -p "$out/llvm"
cp -r ${monorepoSrc}/cmake "$out"
cp -r ${monorepoSrc}/runtimes "$out"
cp -r ${monorepoSrc}/openmp "$out"
cp -r ${monorepoSrc}/llvm/cmake "$out/llvm/"
# openmp/runtime/unittests unconditionally pulls in gtest from
# ../third-party/unittest, so it must be present even with tests off.
cp -r ${monorepoSrc}/third-party "$out"
''
else
''
mkdir -p "$out"
cp -r ${monorepoSrc}/cmake "$out"
cp -r ${monorepoSrc}/openmp "$out"
''
)
else
src;

sourceRoot = "${finalAttrs.src.name}/${if useRuntimesBuild then "runtimes" else "openmp"}";

outputs = [
"out"
"dev"
];

nativeBuildInputs = [
cmake
python3
perl
ninja
pkg-config
lit
];

propagatedNativeBuildInputs = [
checkPhaseThreadLimitHook
];

buildInputs = [
llvm
]
++ lib.optionals (ompdSupport && ompdGdbSupport) [
python3
];

strictDeps = true;

cmakeFlags = [
(lib.cmakeBool "LIBOMP_ENABLE_SHARED" (
!stdenv.hostPlatform.isStatic && stdenv.hostPlatform.hasSharedLibraries
))
(lib.cmakeBool "LIBOMP_OMPD_SUPPORT" ompdSupport)
(lib.cmakeBool "LIBOMP_OMPD_GDB_SUPPORT" ompdGdbSupport)
(lib.cmakeFeature "CLANG_TOOL" "${clang-unwrapped}/bin/clang")
(lib.cmakeFeature "OPT_TOOL" "${llvm}/bin/opt")
(lib.cmakeFeature "LINK_TOOL" "${llvm}/bin/llvm-link")
]
++ devExtraCmakeFlags;

doCheck = false;

checkTarget = "check-openmp";

preCheck = ''
patchShebangs ../tools/archer/tests/deflake.bash
'';

__structuredAttrs = true;

meta = llvm_meta // {
homepage = "https://openmp.llvm.org/";
description = "Support for the OpenMP language";
longDescription = ''
The OpenMP subproject of LLVM contains the components required to build an
executable OpenMP program that are outside the compiler itself.
Contains the code for the runtime library against which code compiled by
"clang -fopenmp" must be linked before it can run and the library that
supports offload to target devices.
'';
# "All of the code is dual licensed under the MIT license and the UIUC
# License (a BSD-like license)":
license = with lib.licenses; [
mit
ncsa
patches =
lib.optional (lib.versionOlder release_version "19") (getVersionFile "openmp/fix-find-tool.patch")
++ [
(getVersionFile "openmp/run-lit-directly.patch")
];

nativeBuildInputs = [
cmake
python3
perl
ninja
pkg-config
lit
];

propagatedNativeBuildInputs = [
checkPhaseThreadLimitHook
];

buildInputs = [
llvm
]
++ lib.optionals (ompdSupport && ompdGdbSupport) [
python3
];
};
})

strictDeps = true;

cmakeFlags = [
(lib.cmakeBool "LIBOMP_ENABLE_SHARED" (
!stdenv.hostPlatform.isStatic && stdenv.hostPlatform.hasSharedLibraries
))
(lib.cmakeBool "LIBOMP_OMPD_SUPPORT" ompdSupport)
(lib.cmakeBool "LIBOMP_OMPD_GDB_SUPPORT" ompdGdbSupport)
(lib.cmakeFeature "CLANG_TOOL" "${clang-unwrapped}/bin/clang")
(lib.cmakeFeature "OPT_TOOL" "${llvm}/bin/opt")
(lib.cmakeFeature "LINK_TOOL" "${llvm}/bin/llvm-link")
]
++ lib.optionals useRuntimesBuild [
# Build through the runtimes entry point (see useRuntimesBuild above).
(lib.cmakeFeature "LLVM_ENABLE_RUNTIMES" "openmp")
# We disable tests (doCheck = false); avoid pulling in third-party/unittest,
# which the trimmed source tree does not contain.
(lib.cmakeBool "LLVM_INCLUDE_TESTS" false)
]
++ devExtraCmakeFlags;

doCheck = false;

checkTarget = "check-openmp";

preCheck = ''
patchShebangs ../tools/archer/tests/deflake.bash
'';

__structuredAttrs = true;

meta = llvm_meta // {
homepage = "https://openmp.llvm.org/";
description = "Support for the OpenMP language";
longDescription = ''
The OpenMP subproject of LLVM contains the components required to build an
executable OpenMP program that are outside the compiler itself.
Contains the code for the runtime library against which code compiled by
"clang -fopenmp" must be linked before it can run and the library that
supports offload to target devices.
'';
# "All of the code is dual licensed under the MIT license and the UIUC
# License (a BSD-like license)":
license = with lib.licenses; [
mit
ncsa
];
};
}
# Kept conditional so that derivations for older LLVMs stay unchanged.

ghost Oct 15, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rebuild avoidance should typically be a TODO and get fixed on staging as a followup in our usual dev process

ghost Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/llvm/llvm-project/blob/llvmorg-20.1.8/openmp/runtime/cmake/LibompExports.cmake#L49
Logic and fix for this issue seems wrong. Writing to src/../exports was present as far back as at least 20.1.8.

ghost Oct 19, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the runtimes change is a problem on master. https://hydra.nixos.org/build/339813014. The exports problem is something specific to rocm as that code path is normally disabled. https://github.com/llvm/llvm-project/blob/03e570bd8d3b3a7947ab2d89a0943d48a99abcef/openmp/runtime/CMakeLists.txt#L160

ghost Oct 19, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ghost Oct 19, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#575951 Has the non rocm specific changes.

ghost Oct 19, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// lib.optionalAttrs useRuntimesBuild {
# The runtimes build writes generated headers (omp.h, ...) back into the
# openmp/ source tree, which is a sibling of sourceRoot and therefore left
# read-only by unpackPhase (only sourceRoot gets `chmod u+w`). Make the whole
# checkout writable.
preConfigure = ''
chmod -R u+w ..
'';
}
)
18 changes: 18 additions & 0 deletions pkgs/development/python-modules/torch/source/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
openssl,
numactl,
llvmPackages,
libdrm,

# dependencies
filelock,
Expand Down Expand Up @@ -399,6 +400,16 @@ buildPythonPackage.override { inherit stdenv; } (finalAttrs: {
--replace-fail "list(APPEND ATen_HIP_INCLUDE \''${CMAKE_CURRENT_SOURCE_DIR}/../../../third_party/composable_kernel/include)" "" \
--replace-fail "list(APPEND ATen_HIP_INCLUDE \''${CMAKE_CURRENT_SOURCE_DIR}/../../../third_party/composable_kernel/library/include)" ""
''
+ lib.optionalString rocmSupport ''
# ROCm 10's rocprofiler-sdk ships an OMPT plugin whose one-time init dlopens a
# library while libomp holds its (non-recursive) init ticket lock: OpenBLAS's
# constructor queries the CPU count -> libomp __kmp_middle_initialize ->
# ompt_pre_init -> rocprofiler-sdk -> dlopen -> OpenBLAS ctor -> libomp again,
# busy-waiting on the held lock forever, so `import torch` hangs (surfaced as a
# pythonImportsCheck hang; also hits runtime, e.g. vllm). Disable the OMPT tool
# interface by default (setdefault, so a user wanting rocprofv3 can override).
sed -i '/^ if USE_GLOBAL_DEPS:$/i\ os.environ.setdefault("OMP_TOOL", "disabled")' torch/__init__.py

ghost Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be a patch or a use of substituteInPlace and shouldn't be modifying the runtime environment via source code changes.

ghost Oct 23, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

''
# Remove PyTorch's FindCUDAToolkit.cmake and use CMake's default.
# NOTE: Parts of pytorch rely on unmaintained FindCUDA.cmake with custom patches to support e.g.
# newer architectures (sm_90a). We do want to delete vendored patches, but have to keep them
Expand Down Expand Up @@ -625,6 +636,13 @@ buildPythonPackage.override { inherit stdenv; } (finalAttrs: {
++ lib.optionals rocmSupport [
rocmtoolkit_joined
rocmPackages.clr # Added separately so setup hook applies
# ROCm 10's rocm-smi exports a rocm_smi-config.cmake that does
# pkg_check_modules(_ROCM_SMI_DRM REQUIRED libdrm) (its public headers pull in
# libdrm/drm.h via kfd_ioctl.h). rocm-smi propagates libdrm, but torch consumes
# it through the rocmtoolkit_joined symlinkJoin, which drops propagatedBuildInputs
# -> libdrm.pc is off PKG_CONFIG_PATH and torch's LoadHIP find_package(rocm_smi)
# fails at configure. Add libdrm directly so the pkg-config hook finds libdrm.pc.
Comment on lines +639 to +644

ghost Oct 15, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unneeded slop comment

libdrm
];

dependencies = [
Expand Down
8 changes: 7 additions & 1 deletion pkgs/development/python-modules/torchcodec/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
libjpeg,
libpng,
libwebp,
libdrm,

# build-system
cmake,
Expand Down Expand Up @@ -113,7 +114,12 @@ buildPythonPackage.override { inherit (torch) stdenv; } (finalAttrs: {
libnpp # nppicc
libnvjpeg # nvjpeg.h
]
);
)
++ lib.optionals rocmSupport [
# find_package(Torch) -> Caffe2 LoadHIP -> find_package(rocm_smi), whose ROCm 10
# rocm_smi-config.cmake runs pkg_check_modules(libdrm), so libdrm.pc must be present.
libdrm
];

build-system = [
cmake
Expand Down
Loading