Skip to content

Commit

Permalink
Merge pull request cupy#8928 from kmaehashi/fix-min-cuda-version
Browse files Browse the repository at this point in the history
Fix minimum CUDA version check and update comments
  • Loading branch information
asi1024 authored and chainer-ci committed Feb 10, 2025
1 parent 83f3ccc commit f979839
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
38 changes: 22 additions & 16 deletions install/cupy_builder/_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,25 @@ def _nvcc_gencode_options(cuda_version: int) -> List[str]:
# architectures:
#
# https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#options-for-steering-gpu-code-generation
#
# CuPy utilizes CUDA Minor Version Compatibility to support all CUDA
# minor versions in a single binary package (e.g., `cupy-cuda12x`). To
# achieve this, CUBIN must be generated for all supported compute
# capabilities instead of PTX. This is because executing PTX requires
# CUDA driver newer than the one used to compile the code, and we often
# use the latest CUDA Driver to build our binary package. See also:
#
# https://docs.nvidia.com/deploy/cuda-compatibility/index.html#application-considerations-for-minor-version-compatibility
#
# In addition, to allow running CuPy with future (not yet released)
# GPUs, PTX for the latest architecture is also included as a
# fallback. c.f.:
#
# https://forums.developer.nvidia.com/t/software-migration-guide-for-nvidia-blackwell-rtx-gpus-a-guide-to-cuda-12-8-pytorch-tensorrt-and-llama-cpp/321330
#
# Jetson platforms are also targetted when built under aarch64. c.f.:
#
# https://docs.nvidia.com/cuda/cuda-for-tegra-appnote/index.html#deployment-considerations-for-cuda-upgrade-package

aarch64 = (platform.machine() == 'aarch64')
if cuda_version >= 12000:
Expand All @@ -75,11 +94,8 @@ def _nvcc_gencode_options(cuda_version: int) -> List[str]:
('compute_90', 'sm_90'),
'compute_90']
if aarch64:
# Jetson TX1/TX2 are excluded as they don't support JetPack 5
# (CUDA 11.4).
# JetPack 5 (CUDA 12.0-12.2) or JetPack 6 (CUDA 12.2+)
arch_list += [
# ('compute_53', 'sm_53'), # Jetson (TX1 / Nano)
# ('compute_62', 'sm_62'), # Jetson (TX2)
('compute_72', 'sm_72'), # Jetson (Xavier)
('compute_87', 'sm_87'), # Jetson (Orin)
]
Expand All @@ -98,19 +114,12 @@ def _nvcc_gencode_options(cuda_version: int) -> List[str]:
('compute_90', 'sm_90'),
'compute_90']
if aarch64:
# Jetson TX1/TX2 are excluded as they don't support JetPack 5
# (CUDA 11.4).
# JetPack 5 (CUDA 11.4/11.8)
arch_list += [
# ('compute_53', 'sm_53'), # Jetson (TX1 / Nano)
# ('compute_62', 'sm_62'), # Jetson (TX2)
('compute_72', 'sm_72'), # Jetson (Xavier)
('compute_87', 'sm_87'), # Jetson (Orin)
]
elif cuda_version >= 11040:
# To utilize CUDA Minor Version Compatibility (`cupy-cuda11x`),
# CUBIN must be generated for all supported compute capabilities
# instead of PTX:
# https://docs.nvidia.com/deploy/cuda-compatibility/index.html#application-considerations
arch_list = [('compute_35', 'sm_35'),
('compute_37', 'sm_37'),
('compute_50', 'sm_50'),
Expand All @@ -123,11 +132,8 @@ def _nvcc_gencode_options(cuda_version: int) -> List[str]:
('compute_86', 'sm_86'),
'compute_86']
if aarch64:
# Jetson TX1/TX2 are excluded as they don't support JetPack 5
# (CUDA 11.4).
# JetPack 5 (CUDA 11.4/11.8)
arch_list += [
# ('compute_53', 'sm_53'), # Jetson (TX1 / Nano)
# ('compute_62', 'sm_62'), # Jetson (TX2)
('compute_72', 'sm_72'), # Jetson (Xavier)
('compute_87', 'sm_87'), # Jetson (Orin)
]
Expand Down
4 changes: 2 additions & 2 deletions install/cupy_builder/_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ def get_features(ctx: Context) -> Dict[str, Feature]:


class CUDA_cuda(Feature):
minimum_cuda_version = 10020
minimum_cuda_version = 11020

def __init__(self, ctx: Context):
super().__init__(ctx)
Expand Down Expand Up @@ -484,6 +484,6 @@ def configure(self, compiler: Any, settings: Any) -> bool:
if self._version < self.minimum_cuda_version:
utils.print_warning(
'CUDA version is too old: %d' % self._version,
'CUDA 10.2 or newer is required')
'CUDA 11.2 or newer is required')
return False
return True

0 comments on commit f979839

Please sign in to comment.