···32 }});
33in callPackage { inherit cudaPackages; };
34```
35+36+The CUDA NVCC compiler requires flags to determine which hardware you
37+want to target for in terms of SASS (real hardware) or PTX (JIT kernels).
38+39+Nixpkgs tries to target support real architecture defaults based on the
40+CUDA toolkit version with PTX support for future hardware. Experienced
41+users may optmize this configuration for a variety of reasons such as
42+reducing binary size and compile time, supporting legacy hardware, or
43+optimizing for specific hardware.
44+45+You may provide capabilities to add support or reduce binary size through
46+`config` using `cudaCapabilities = [ "6.0" "7.0" ];` and
47+`cudaForwardCompat = true;` if you want PTX support for future hardware.
48+49+Please consult [GPUs supported](https://en.wikipedia.org/wiki/CUDA#GPUs_supported)
50+for your specific card(s).
51+52+Library maintainers should consult [NVCC Docs](https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/)
53+and release notes for their software package.
···22, tensorboardSupport ? true
23# XLA without CUDA is broken
24, xlaSupport ? cudaSupport
25-# Default from ./configure script
26-, cudaCapabilities ? [ "sm_35" "sm_50" "sm_60" "sm_70" "sm_75" "compute_80" ]
27, sse42Support ? stdenv.hostPlatform.sse4_2Support
28, avx2Support ? stdenv.hostPlatform.avx2Support
29, fmaSupport ? stdenv.hostPlatform.fmaSupport
···32}:
3334let
35- inherit (cudaPackages) cudatoolkit cudnn nccl;
36in
3738assert cudaSupport -> cudatoolkit != null
···305 TF_CUDA_PATHS = lib.optionalString cudaSupport "${cudatoolkit_joined},${cudnn},${nccl}";
306 GCC_HOST_COMPILER_PREFIX = lib.optionalString cudaSupport "${cudatoolkit_cc_joined}/bin";
307 GCC_HOST_COMPILER_PATH = lib.optionalString cudaSupport "${cudatoolkit_cc_joined}/bin/gcc";
308- TF_CUDA_COMPUTE_CAPABILITIES = lib.concatStringsSep "," cudaCapabilities;
309310 postPatch = ''
311 # bazel 3.3 should work just as well as bazel 3.1
···22, tensorboardSupport ? true
23# XLA without CUDA is broken
24, xlaSupport ? cudaSupport
0025, sse42Support ? stdenv.hostPlatform.sse4_2Support
26, avx2Support ? stdenv.hostPlatform.avx2Support
27, fmaSupport ? stdenv.hostPlatform.fmaSupport
···30}:
3132let
33+ inherit (cudaPackages) cudatoolkit cudaFlags cudnn nccl;
34in
3536assert cudaSupport -> cudatoolkit != null
···303 TF_CUDA_PATHS = lib.optionalString cudaSupport "${cudatoolkit_joined},${cudnn},${nccl}";
304 GCC_HOST_COMPILER_PREFIX = lib.optionalString cudaSupport "${cudatoolkit_cc_joined}/bin";
305 GCC_HOST_COMPILER_PATH = lib.optionalString cudaSupport "${cudatoolkit_cc_joined}/bin/gcc";
306+ TF_CUDA_COMPUTE_CAPABILITIES = builtins.concatStringsSep "," cudaFlags.cudaRealArchs;
307308 postPatch = ''
309 # bazel 3.3 should work just as well as bazel 3.1
+2-62
pkgs/development/python-modules/torch/default.nix
···3 mklDnnSupport ? true, useSystemNccl ? true,
4 MPISupport ? false, mpi,
5 buildDocs ? false,
6- cudaArchList ? null,
78 # Native build inputs
9 cmake, util-linux, linkFarm, symlinkJoin, which, pybind11, removeReferencesTo,
···33 isPy3k, pythonOlder }:
3435let
36- inherit (cudaPackages) cudatoolkit cudnn nccl;
37in
3839# assert that everything needed for cuda is present and that the correct cuda versions are used
···52 paths = [ cudatoolkit.out cudatoolkit.lib nccl.dev nccl.out ];
53 };
5455- # Give an explicit list of supported architectures for the build, See:
56- # - pytorch bug report: https://github.com/pytorch/pytorch/issues/23573
57- # - pytorch-1.2.0 build on nixpks: https://github.com/NixOS/nixpkgs/pull/65041
58- #
59- # This list was selected by omitting the TORCH_CUDA_ARCH_LIST parameter,
60- # observing the fallback option (which selected all architectures known
61- # from cudatoolkit_10_0, pytorch-1.2, and python-3.6), and doing a binary
62- # searching to find offending architectures.
63- #
64- # NOTE: Because of sandboxing, this derivation can't auto-detect the hardware's
65- # cuda architecture, so there is also now a problem around new architectures
66- # not being supported until explicitly added to this derivation.
67- #
68- # FIXME: CMake is throwing the following warning on python-1.2:
69- #
70- # ```
71- # CMake Warning at cmake/public/utils.cmake:172 (message):
72- # In the future we will require one to explicitly pass TORCH_CUDA_ARCH_LIST
73- # to cmake instead of implicitly setting it as an env variable. This will
74- # become a FATAL_ERROR in future version of pytorch.
75- # ```
76- # If this is causing problems for your build, this derivation may have to strip
77- # away the standard `buildPythonPackage` and use the
78- # [*Adjust Build Options*](https://github.com/pytorch/pytorch/tree/v1.2.0#adjust-build-options-optional)
79- # instructions. This will also add more flexibility around configurations
80- # (allowing FBGEMM to be built in pytorch-1.1), and may future proof this
81- # derivation.
82- brokenArchs = [ "3.0" ]; # this variable is only used as documentation.
83-84- cudaCapabilities = rec {
85- cuda9 = [
86- "3.5"
87- "5.0"
88- "5.2"
89- "6.0"
90- "6.1"
91- "7.0"
92- "7.0+PTX" # I am getting a "undefined architecture compute_75" on cuda 9
93- # which leads me to believe this is the final cuda-9-compatible architecture.
94- ];
95-96- cuda10 = cuda9 ++ [
97- "7.5"
98- "7.5+PTX" # < most recent architecture as of cudatoolkit_10_0 and pytorch-1.2.0
99- ];
100-101- cuda11 = cuda10 ++ [
102- "8.0"
103- "8.0+PTX" # < CUDA toolkit 11.0
104- "8.6"
105- "8.6+PTX" # < CUDA toolkit 11.1
106- ];
107- };
108- final_cudaArchList =
109- if !cudaSupport || cudaArchList != null
110- then cudaArchList
111- else cudaCapabilities."cuda${lib.versions.major cudatoolkit.version}";
112-113 # Normally libcuda.so.1 is provided at runtime by nvidia-x11 via
114 # LD_LIBRARY_PATH=/run/opengl-driver/lib. We only use the stub
115 # libcuda.so from cudatoolkit for running tests, so that we don’t have
···153 ];
154155 preConfigure = lib.optionalString cudaSupport ''
156- export TORCH_CUDA_ARCH_LIST="${lib.strings.concatStringsSep ";" final_cudaArchList}"
157 export CC=${cudatoolkit.cc}/bin/gcc CXX=${cudatoolkit.cc}/bin/g++
158 '' + lib.optionalString (cudaSupport && cudnn != null) ''
159 export CUDNN_INCLUDE_DIR=${cudnn}/include
···308309 passthru = {
310 inherit cudaSupport cudaPackages;
311- cudaArchList = final_cudaArchList;
312 # At least for 1.10.2 `torch.fft` is unavailable unless BLAS provider is MKL. This attribute allows for easy detection of its availability.
313 blasProvider = blas.provider;
314 };
···3 mklDnnSupport ? true, useSystemNccl ? true,
4 MPISupport ? false, mpi,
5 buildDocs ? false,
067 # Native build inputs
8 cmake, util-linux, linkFarm, symlinkJoin, which, pybind11, removeReferencesTo,
···32 isPy3k, pythonOlder }:
3334let
35+ inherit (cudaPackages) cudatoolkit cudaFlags cudnn nccl;
36in
3738# assert that everything needed for cuda is present and that the correct cuda versions are used
···51 paths = [ cudatoolkit.out cudatoolkit.lib nccl.dev nccl.out ];
52 };
53000000000000000000000000000000000000000000000000000000000054 # Normally libcuda.so.1 is provided at runtime by nvidia-x11 via
55 # LD_LIBRARY_PATH=/run/opengl-driver/lib. We only use the stub
56 # libcuda.so from cudatoolkit for running tests, so that we don’t have
···94 ];
9596 preConfigure = lib.optionalString cudaSupport ''
97+ export TORCH_CUDA_ARCH_LIST="${cudaFlags.cudaCapabilitiesSemiColonString}"
98 export CC=${cudatoolkit.cc}/bin/gcc CXX=${cudatoolkit.cc}/bin/g++
99 '' + lib.optionalString (cudaSupport && cudnn != null) ''
100 export CUDNN_INCLUDE_DIR=${cudnn}/include
···249250 passthru = {
251 inherit cudaSupport cudaPackages;
0252 # At least for 1.10.2 `torch.fft` is unavailable unless BLAS provider is MKL. This attribute allows for easy detection of its availability.
253 blasProvider = blas.provider;
254 };
···89buildGoModule rec {
10 pname = "fastly";
11- version = "4.4.1";
1213 src = fetchFromGitHub {
14 owner = "fastly";
15 repo = "cli";
16 rev = "refs/tags/v${version}";
17- hash = "sha256-82OZwO6r+wPq6AMm27M9U6dQyE3iOpAzW31HzRji5Fo=";
18 # The git commit is part of the `fastly version` original output;
19 # leave that output the same in nixpkgs. Use the `.git` directory
20 # to retrieve the commit SHA, and remove the directory afterwards,
···31 "cmd/fastly"
32 ];
3334- vendorHash = "sha256-zilgzfPD7HmHt0/u94JLaY6NPvn1JjXFu1K2YO0tF9M=";
3536 nativeBuildInputs = [
37 installShellFiles
···89buildGoModule rec {
10 pname = "fastly";
11+ version = "4.5.0";
1213 src = fetchFromGitHub {
14 owner = "fastly";
15 repo = "cli";
16 rev = "refs/tags/v${version}";
17+ hash = "sha256-l/EnlyrSofuk4/69R2VUdP6MyKOVAOI7cIOW1TLeBww=";
18 # The git commit is part of the `fastly version` original output;
19 # leave that output the same in nixpkgs. Use the `.git` directory
20 # to retrieve the commit SHA, and remove the directory afterwards,
···31 "cmd/fastly"
32 ];
3334+ vendorHash = "sha256-cXO5zhc9RZlweoU6pva2sBvcjNWBeFSUz+k9BbQpUX0=";
3536 nativeBuildInputs = [
37 installShellFiles