From d001cf04cb32cb4cd3e325368b9c6afa445a97c6 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 23 Mar 2026 20:40:01 +0000 Subject: [PATCH] python3Packages.torchvision: 0.25.0 -> 0.26.0 Diff: https://github.com/pytorch/vision/compare/v0.25.0...v0.26.0 Changelog: https://github.com/pytorch/vision/releases/tag/v0.26.0 --- .../python-modules/torchvision/default.nix | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/torchvision/default.nix b/pkgs/development/python-modules/torchvision/default.nix index c3a3d2cb9346..e57eadd789ec 100644 --- a/pkgs/development/python-modules/torchvision/default.nix +++ b/pkgs/development/python-modules/torchvision/default.nix @@ -26,16 +26,16 @@ let inherit (torch) cudaCapabilities cudaPackages cudaSupport; in -buildPythonPackage.override { stdenv = torch.stdenv; } (finalAttrs: { +buildPythonPackage.override { inherit (torch) stdenv; } (finalAttrs: { pname = "torchvision"; - version = "0.25.0"; + version = "0.26.0"; pyproject = true; src = fetchFromGitHub { owner = "pytorch"; repo = "vision"; tag = "v${finalAttrs.version}"; - hash = "sha256-oktJHcT6T4f58pUO+HSBpbyS1ISH3zDlTsXQh6PcMy4="; + hash = "sha256-FOdDGY3v8yWBhtNo9tZP79/xwrc7AoIY5Y1ZABzWe6g="; }; nativeBuildInputs = [ @@ -63,6 +63,18 @@ buildPythonPackage.override { stdenv = torch.stdenv; } (finalAttrs: { TORCHVISION_LIBRARY = "${libjpeg_turbo}/lib/"; } // lib.optionalAttrs cudaSupport { + # At of 2026-03-27, the default `cudaPackages` version is 12.9.1 + # According to Nvidia, it should support GCC versions up to 14.x: + # -> https://docs.nvidia.com/cuda/archive/12.9.1/cuda-installation-guide-linux/index.html#host-compiler-support-policy + # However, PyTorch's *strict* upper bound is 14.0: + # -> https://github.com/pytorch/pytorch/blob/v2.11.0/torch/utils/cpp_extension.py#L75 + # Hence, the build fails with: + # RuntimeError: The current installed version of g++ (14.3.0) is greater than the maximum + # required version by CUDA 12.9. Please make sure to use an adequate version of g++ + # (>=6.0.0, <14.0). + # Hence, we disable the version check to silence the error: + TORCH_DONT_CHECK_COMPILER_ABI = 1; + TORCH_CUDA_ARCH_LIST = "${lib.concatStringsSep ";" cudaCapabilities}"; FORCE_CUDA = 1; };