From 761908ffd7acac342fcb34633ceb982ddbe2042f Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Mon, 12 Oct 2026 22:09:14 -0700 Subject: [PATCH] cudaPackages.cccl: backport cuda::make_tma_descriptor fix cuda::make_tma_descriptor reverses the box sizes into driver order (innermost first), then checks the last element, the outermost dimension, against the 16-byte requirement of tma_interleave_layout::none. It rejects valid descriptors whose outermost box dimension isn't 16-byte aligned and accepts invalid ones whose innermost isn't. Fixed in CCCL 3.5.0; CUDA 13.4 ships 3.3.4. The upstream commit applies cleanly only to CUDA 13.4's CCCL, so the backport is limited to it. Assisted-by: Claude Code (Claude Opus 5.5, claude-opus-5-5) --- pkgs/development/cuda-modules/packages/cccl.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/development/cuda-modules/packages/cccl.nix b/pkgs/development/cuda-modules/packages/cccl.nix index 7b86ad2e0aec..292920bf0762 100644 --- a/pkgs/development/cuda-modules/packages/cccl.nix +++ b/pkgs/development/cuda-modules/packages/cccl.nix @@ -47,6 +47,18 @@ buildRedist { extraPrefix = "include/"; hash = "sha256-eko1GSD2NPSLtbQ3diwgKMbuS6wU9lHDOajLJy5lBwM="; }) + ] + ++ lib.optionals (cudaAtLeast "13.4" && cudaOlder "13.5") [ + # cuda::make_tma_descriptor checks the outermost box dimension instead of the innermost against the 16-byte + # requirement, rejecting valid descriptors; fixed in CCCL 3.5.0. + # Backport: https://github.com/NVIDIA/cccl/pull/10546 + (fetchpatch { + name = "fix-make_tma_descriptor"; + url = "https://github.com/NVIDIA/cccl/commit/c95095c8d5faf1d8e978057a4f5cc0c27bccab70.patch"; + relative = "libcudacxx/include"; + extraPrefix = "include/"; + hash = "sha256-QmbzcRMHNX2PuUihaXNrbB2kWwAOUArC4OZ6v9+Tf/g="; + }) ]; # NVIDIA, in their wisdom, expect CCCL to be a directory inside include.