From 3eb4f1b56feb3a0ee83d0cfc2871e708d456d298 Mon Sep 17 00:00:00 2001 From: stefan Date: Sat, 16 May 2026 21:13:59 -0700 Subject: [PATCH] python3Packages.torch: gate CUDAToolkit_VERSION cmake flag on cudaSupport Fix a cache miss when `cudaSupport = false` but `cudaPackages.cudaMajorMinorVersion` is not the default (as could be the case with an overlay like `cudaPackages = cudaPackages_13_1;`) --- pkgs/development/python-modules/torch/source/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/torch/source/default.nix b/pkgs/development/python-modules/torch/source/default.nix index 1936a0c89abd..c83efca823d4 100644 --- a/pkgs/development/python-modules/torch/source/default.nix +++ b/pkgs/development/python-modules/torch/source/default.nix @@ -493,9 +493,9 @@ buildPythonPackage.override { inherit stdenv; } (finalAttrs: { cmakeFlags = [ (lib.cmakeFeature "PYTHON_SIX_SOURCE_DIR" "${six.src}") # (lib.cmakeBool "CMAKE_FIND_DEBUG_MODE" true) - (lib.cmakeFeature "CUDAToolkit_VERSION" cudaPackages.cudaMajorMinorVersion) ] ++ lib.optionals cudaSupport [ + (lib.cmakeFeature "CUDAToolkit_VERSION" cudaPackages.cudaMajorMinorVersion) # Unbreaks version discovery in enable_language(CUDA) when wrapping nvcc with ccache # Cf. https://gitlab.kitware.com/cmake/cmake/-/issues/26363 (lib.cmakeFeature "CMAKE_CUDA_COMPILER_TOOLKIT_VERSION" cudaPackages.cudaMajorMinorVersion)