about summary refs log tree commit diff
path: root/pkgs/development/cuda-modules/nvcc-compatibilities.nix
blob: 4af1b511a1d9dd980b8fec297fa7f31fecb83c06 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# Taken from
# https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#host-compiler-support-policy
#
#   NVCC performs a version check on the host compiler’s major version and so newer minor versions
#   of the compilers listed below will be supported, but major versions falling outside the range
#   will not be supported.
#
# NOTE: These constraints don't apply to Jetson, which uses something else.
# NOTE: NVIDIA can and will add support for newer compilers even during patch releases.
# E.g.: CUDA 12.2.1 maxxed out with support for Clang 15.0; 12.2.2 added support for Clang 16.0.
# NOTE: Because all platforms NVIDIA supports use GCC and Clang, we omit the architectures here.
# Type Aliases
# CudaVersion = String (two-part version number, e.g. "11.2")
# Platform = String (e.g. "x86_64-linux")
# CompilerCompatibilities = {
#  clangMaxMajorVersion = String (e.g. "15")
#  clangMinMajorVersion = String (e.g. "7")
#  gccMaxMajorVersion = String (e.g. "11")
#  gccMinMajorVersion = String (e.g. "6")
# }
let
  # attrs :: AttrSet CudaVersion CompilerCompatibilities
  attrs = {
    # Our baseline
    # https://docs.nvidia.com/cuda/archive/10.0/cuda-toolkit-release-notes/index.html#cuda-compiler-new-features
    "10.0" = {
      clangMaxMajorVersion = "6";
      clangMinMajorVersion = "6";
      gccMaxMajorVersion = "7";
      gccMinMajorVersion = "5";
    };

    # Added support for Clang 7 and GCC 8
    # https://docs.nvidia.com/cuda/archive/10.1/cuda-toolkit-release-notes/index.html#cuda-compiler-new-features
    "10.1" = attrs."10.0" // {
      clangMaxMajorVersion = "7";
      gccMaxMajorVersion = "8";
    };

    # Added clang 8
    # https://docs.nvidia.com/cuda/archive/10.2/cuda-toolkit-release-notes/index.html#cuda-compiler-new-features
    "10.2" = attrs."10.1" // {
      clangMaxMajorVersion = "8";
    };

    # Added support for Clang 9 and GCC 9
    # https://docs.nvidia.com/cuda/archive/11.0/cuda-toolkit-release-notes/index.html#cuda-compiler-new-features
    "11.0" = {
      clangMaxMajorVersion = "9";
      clangMinMajorVersion = "7";
      gccMaxMajorVersion = "9";
      gccMinMajorVersion = "6";
    };

    # Added support for Clang 10 and GCC 10
    # https://docs.nvidia.com/cuda/archive/11.1.1/cuda-toolkit-release-notes/index.html#cuda-compiler-new-features
    "11.1" = attrs."11.0" // {
      clangMaxMajorVersion = "10";
      gccMaxMajorVersion = "10";
    };

    # Added support for Clang 11
    # https://docs.nvidia.com/cuda/archive/11.2.2/cuda-installation-guide-linux/index.html#system-requirements
    "11.2" = attrs."11.1" // {
      clangMaxMajorVersion = "11";
    };

    # No changes from 11.2 to 11.3
    "11.3" = attrs."11.2";

    # Added support for Clang 12 and GCC 11
    # https://docs.nvidia.com/cuda/archive/11.4.4/cuda-toolkit-release-notes/index.html#cuda-general-new-features
    "11.4" = attrs."11.3" // {
      clangMaxMajorVersion = "12";
      # NOTE: There is a bug in the version of GLIBC that GCC 11 uses which causes it to fail to compile some CUDA
      # code. As such, we skip it for this release, and do the bump in 11.6 (skipping 11.5).
      # https://forums.developer.nvidia.com/t/cuda-11-5-samples-throw-multiple-error-attribute-malloc-does-not-take-arguments/192750/15
      # gccMaxMajorVersion = "11";
    };

    # No changes from 11.4 to 11.5
    "11.5" = attrs."11.4";

    # No changes from 11.5 to 11.6
    # However, as mentioned above, we add GCC 11 this release.
    "11.6" = attrs."11.5" // {
      gccMaxMajorVersion = "11";
    };

    # Added support for Clang 13
    # https://docs.nvidia.com/cuda/archive/11.7.1/cuda-toolkit-release-notes/index.html#cuda-compiler-new-features
    "11.7" = attrs."11.6" // {
      clangMaxMajorVersion = "13";
    };

    # Added support for Clang 14
    # https://docs.nvidia.com/cuda/archive/11.8.0/cuda-installation-guide-linux/index.html#system-requirements
    "11.8" = attrs."11.7" // {
      clangMaxMajorVersion = "14";
    };

    # Added support for GCC 12
    # https://docs.nvidia.com/cuda/archive/12.0.1/cuda-installation-guide-linux/index.html#system-requirements
    "12.0" = attrs."11.8" // {
      gccMaxMajorVersion = "12";
    };

    # Added support for Clang 15
    # https://docs.nvidia.com/cuda/archive/12.1.1/cuda-toolkit-release-notes/index.html#cuda-compilers-new-features
    "12.1" = attrs."12.0" // {
      clangMaxMajorVersion = "15";
    };

    # Added support for Clang 16
    # https://docs.nvidia.com/cuda/archive/12.2.2/cuda-installation-guide-linux/index.html#host-compiler-support-policy
    "12.2" = attrs."12.1" // {
      clangMaxMajorVersion = "16";
    };

    # No changes from 12.2 to 12.3
    "12.3" = attrs."12.2";
  };
in
attrs