From d03e760ce9d58ffe90645aef3860e643689afe30 Mon Sep 17 00:00:00 2001 From: Junji Hashimoto Date: Wed, 10 Nov 2021 00:26:10 +0000 Subject: [PATCH] python3Packages.torchvision-bin: 0.10.1 -> 0.11.1 --- .../python-modules/torchvision/bin.nix | 8 +++++++- .../torchvision/binary-hashes.nix | 20 +++++++++---------- .../python-modules/torchvision/prefetch.sh | 13 ++++++------ 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/pkgs/development/python-modules/torchvision/bin.nix b/pkgs/development/python-modules/torchvision/bin.nix index a69531f2d062..f7041dbb519d 100644 --- a/pkgs/development/python-modules/torchvision/bin.nix +++ b/pkgs/development/python-modules/torchvision/bin.nix @@ -15,7 +15,7 @@ let pyVerNoDot = builtins.replaceStrings [ "." ] [ "" ] python.pythonVersion; srcs = import ./binary-hashes.nix version; unsupported = throw "Unsupported system"; - version = "0.10.1"; + version = "0.11.1"; in buildPythonPackage { inherit version; @@ -36,6 +36,9 @@ in buildPythonPackage { pytorch-bin ]; + # The wheel-binary is not stripped to avoid the error of `ImportError: libtorch_cuda_cpp.so: ELF load command address/offset not properly aligned.`. + dontStrip = true; + pythonImportsCheck = [ "torchvision" ]; postFixup = let @@ -52,6 +55,9 @@ in buildPythonPackage { description = "PyTorch vision library"; homepage = "https://pytorch.org/"; changelog = "https://github.com/pytorch/vision/releases/tag/v${version}"; + # Includes CUDA and Intel MKL, but redistributions of the binary are not limited. + # https://docs.nvidia.com/cuda/eula/index.html + # https://www.intel.com/content/www/us/en/developer/articles/license/onemkl-license-faq.html license = licenses.bsd3; platforms = platforms.linux; maintainers = with maintainers; [ junjihashimoto ]; diff --git a/pkgs/development/python-modules/torchvision/binary-hashes.nix b/pkgs/development/python-modules/torchvision/binary-hashes.nix index 239db8bdb864..b608bab24409 100644 --- a/pkgs/development/python-modules/torchvision/binary-hashes.nix +++ b/pkgs/development/python-modules/torchvision/binary-hashes.nix @@ -6,21 +6,21 @@ # To add a new version, run "prefetch.sh 'new-version'" to paste the generated file as follows. version : builtins.getAttr version { - "0.10.1" = { + "0.11.1" = { x86_64-linux-37 = { - name = "torchvision-0.10.1-cp37-cp37m-linux_x86_64.whl"; - url = "https://download.pytorch.org/whl/cu111/torchvision-0.10.1%2Bcu111-cp37-cp37m-linux_x86_64.whl"; - hash = "sha256-1MdsCrOLGkYpfbtv011/b6QG+yKaE+O0jUKeUVj2BJY="; + name = "torchvision-0.11.1-cp37-cp37m-linux_x86_64.whl"; + url = "https://download.pytorch.org/whl/cu113/torchvision-0.11.1%2Bcu113-cp37-cp37m-linux_x86_64.whl"; + hash = "sha256-2xKWqWNKqmOMyVJnPfbtF+B9PQ7z4S66J1T3P8EvM0I="; }; x86_64-linux-38 = { - name = "torchvision-0.10.1-cp38-cp38-linux_x86_64.whl"; - url = "https://download.pytorch.org/whl/cu111/torchvision-0.10.1%2Bcu111-cp38-cp38-linux_x86_64.whl"; - hash = "sha256-LtmsnNSa9g3tCdjW1jhu7AZlGgfyYIVh5/2R+WwcxSo="; + name = "torchvision-0.11.1-cp38-cp38-linux_x86_64.whl"; + url = "https://download.pytorch.org/whl/cu113/torchvision-0.11.1%2Bcu113-cp38-cp38-linux_x86_64.whl"; + hash = "sha256-bFxvJaNEomytXXANHng+oU8YSLGkuO/TSzkoDskkaIE="; }; x86_64-linux-39 = { - name = "torchvision-0.10.1-cp39-cp39-linux_x86_64.whl"; - url = "https://download.pytorch.org/whl/cu111/torchvision-0.10.1%2Bcu111-cp39-cp39-linux_x86_64.whl"; - hash = "sha256-ZOC/angyiLeOhe+7dAs0W6XlQRKK00T/iI+aBgFNpA0="; + name = "torchvision-0.11.1-cp39-cp39-linux_x86_64.whl"; + url = "https://download.pytorch.org/whl/cu113/torchvision-0.11.1%2Bcu113-cp39-cp39-linux_x86_64.whl"; + hash = "sha256-ysN3LmSKR+FVKYGnCGQJqa8lVApVT5rPMO+NHmmazAc="; }; }; } diff --git a/pkgs/development/python-modules/torchvision/prefetch.sh b/pkgs/development/python-modules/torchvision/prefetch.sh index f57ac96bdb63..686d1b3e6200 100755 --- a/pkgs/development/python-modules/torchvision/prefetch.sh +++ b/pkgs/development/python-modules/torchvision/prefetch.sh @@ -1,18 +1,19 @@ #!/usr/bin/env nix-shell #!nix-shell -i bash -p nix-prefetch-scripts +set -eou pipefail + version=$1 -bucket="https://download.pytorch.org/whl/cu111" +bucket="https://download.pytorch.org/whl/cu113" url_and_key_list=( -"x86_64-linux-37 $bucket/torchvision-${version}%2Bcu111-cp37-cp37m-linux_x86_64.whl torchvision-${version}-cp37-cp37m-linux_x86_64.whl" -"x86_64-linux-38 $bucket/torchvision-${version}%2Bcu111-cp38-cp38-linux_x86_64.whl torchvision-${version}-cp38-cp38-linux_x86_64.whl" -"x86_64-linux-39 $bucket/torchvision-${version}%2Bcu111-cp39-cp39-linux_x86_64.whl torchvision-${version}-cp39-cp39-linux_x86_64.whl" + "x86_64-linux-37 $bucket/torchvision-${version}%2Bcu113-cp37-cp37m-linux_x86_64.whl torchvision-${version}-cp37-cp37m-linux_x86_64.whl" + "x86_64-linux-38 $bucket/torchvision-${version}%2Bcu113-cp38-cp38-linux_x86_64.whl torchvision-${version}-cp38-cp38-linux_x86_64.whl" + "x86_64-linux-39 $bucket/torchvision-${version}%2Bcu113-cp39-cp39-linux_x86_64.whl torchvision-${version}-cp39-cp39-linux_x86_64.whl" ) -hashfile=binary-hashes-"$version".nix -rm -f $hashfile +hashfile="binary-hashes-$version.nix" echo " \"$version\" = {" >> $hashfile for url_and_key in "${url_and_key_list[@]}"; do