CUDA compiler conflicts for Linux (#10460)

* CUDA compiler conflicts for Linux.

* Add Volta and Turing GPUs.

* Add mandatory conflict for Volta and Turing GPUs.

* Revert "CUDA compiler conflicts for Linux."

This reverts commit 7d4ff654ac.

* Compiler conflicts introduced from previous commit into CUDA packaged moved and integrated into CUDA build system.

* More conversative with compiler conflicts for cuda 10.0.130, since I don't know what will happen with future cuda 10.x releases.

* Correct off-by-one errors in clang conflicts for x86_64 Linux.

* No restrictions on Apple Clang compiler until we are able to distinguish Xcode clang from github clang more easily. Note to fix this in the future.

* Change comment to clarify that github clang refers to LLVM clang.

* Fix and simplify index range.

* Fix overlapping conflicts for CUDA 10.0.130

* Removed extra ^cuda from conflict.
This commit is contained in:
Nichols A. Romero 2019-02-06 10:09:52 -06:00 committed by Axel Huebl
parent 548e6736c4
commit 5394f0016a

View File

@ -6,8 +6,6 @@
from spack.package import PackageBase
from spack.directives import depends_on, variant, conflicts
import platform
import spack.variant
@ -26,7 +24,7 @@ class CudaPackage(PackageBase):
description='CUDA architecture',
values=spack.variant.any_combination_of(
'20', '30', '32', '35', '50', '52', '53', '60', '61',
'62', '70'
'62', '70', '72', '75'
))
# see http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#nvcc-examples
@ -44,23 +42,78 @@ def cuda_flags(arch_list):
depends_on("cuda@8:", when='cuda_arch=61')
depends_on("cuda@8:", when='cuda_arch=62')
depends_on("cuda@9:", when='cuda_arch=70')
depends_on("cuda@9:", when='cuda_arch=72')
depends_on("cuda@10:", when='cuda_arch=75')
depends_on('cuda@:8', when='cuda_arch=20')
# Compiler conflicts:
# There are at least three cases to be aware of for compiler conflicts
# 1. Linux x86_64
# 2. Linux ppc64le
# 3. Mac OS X
# Linux x86_64 compiler conflicts from here:
# https://gist.github.com/ax3l/9489132
conflicts('%gcc@5:', when='+cuda ^cuda@:7.5')
conflicts('%gcc@6:', when='+cuda ^cuda@:8')
conflicts('%gcc@7:', when='+cuda ^cuda@:9.1')
conflicts('%gcc@8:', when='+cuda ^cuda@:9.99')
if (platform.system() != "Darwin"):
conflicts('%clang@:3.4,3.7:', when='+cuda ^cuda@7.5')
conflicts('%clang@:3.7,4:', when='+cuda ^cuda@8:9.0')
conflicts('%clang@:3.7,5:', when='+cuda ^cuda@9.1')
conflicts('%clang@:3.7,6:', when='+cuda ^cuda@9.2')
arch_platform = ' arch=x86_64 platform=linux'
conflicts('%gcc@5:', when='+cuda ^cuda@:7.5' + arch_platform)
conflicts('%gcc@6:', when='+cuda ^cuda@:8' + arch_platform)
conflicts('%gcc@7:', when='+cuda ^cuda@:9.1' + arch_platform)
conflicts('%gcc@8:', when='+cuda ^cuda@10.0.130' + arch_platform)
conflicts('%pgi@:14.8', when='+cuda ^cuda@:7.0.27' + arch_platform)
conflicts('%pgi@:15.3,15.5:', when='+cuda ^cuda@7.5' + arch_platform)
conflicts('%pgi@:16.2,16.0:16.3', when='+cuda ^cuda@8' + arch_platform)
conflicts('%pgi@:15,18:', when='+cuda ^cuda@9.0:9.1' + arch_platform)
conflicts('%pgi@:16', when='+cuda ^cuda@9.2.88:10' + arch_platform)
conflicts('%clang@:3.4', when='+cuda ^cuda@:7.5' + arch_platform)
conflicts('%clang@:3.7,4:',
when='+cuda ^cuda@8.0:9.0' + arch_platform)
conflicts('%clang@:3.7,4.1:',
when='+cuda ^cuda@9.1' + arch_platform)
conflicts('%clang@:3.7,5.1:', when='+cuda ^cuda@9.2' + arch_platform)
conflicts('%clang@:3.7,6.1:', when='+cuda ^cuda@10.0.130' + arch_platform)
# x86_64 vs. ppc64le differ according to NVidia docs
# Linux ppc64le compiler conflicts from Table from the docs below:
# https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html
# https://docs.nvidia.com/cuda/archive/9.2/cuda-installation-guide-linux/index.html
# https://docs.nvidia.com/cuda/archive/9.1/cuda-installation-guide-linux/index.html
# https://docs.nvidia.com/cuda/archive/9.0/cuda-installation-guide-linux/index.html
# https://docs.nvidia.com/cuda/archive/8.0/cuda-installation-guide-linux/index.html
arch_platform = ' arch=ppc64le platform=linux'
# information prior to CUDA 9 difficult to find
conflicts('%gcc@6:', when='+cuda ^cuda@:9' + arch_platform)
conflicts('%gcc@8:', when='+cuda ^cuda@10.0.130' + arch_platform)
conflicts('%pgi', when='+cuda ^cuda@:8' + arch_platform)
conflicts('%pgi@:16', when='+cuda ^cuda@:9.1.185' + arch_platform)
conflicts('%pgi@:17', when='+cuda ^cuda@:10' + arch_platform)
conflicts('%clang@4:', when='+cuda ^cuda@:9.0.176' + arch_platform)
conflicts('%clang@5:', when='+cuda ^cuda@:9.1' + arch_platform)
conflicts('%clang@6:', when='+cuda ^cuda@:9.2' + arch_platform)
conflicts('%clang@7:', when='+cuda ^cuda@10.0.130' + arch_platform)
# Intel is mostly relevant for x86_64 Linux, even though it also
# exists for Mac OS X.
conflicts('%intel@:14,16:', when='+cuda ^cuda@7.5')
conflicts('%intel@:14,17:', when='+cuda ^cuda@8.0.44')
conflicts('%intel@:14,18:', when='+cuda ^cuda@8.0.61:9')
conflicts('%intel@:14,18:', when='+cuda ^cuda@8.0.61:9.1')
conflicts('%intel@17:18:', when='+cuda ^cuda@9.2:')
conflicts('%intel@19:', when='+cuda')
# XL is mostly relevant for ppc64le Linux
conflicts('%xl@:12,14:', when='+cuda ^cuda@:9.1')
conflicts('%xl@:12,14:15,17:', when='+cuda ^cuda@9.2')
conflicts('%xl@17:', when='+cuda ^cuda@10.0.130')
# Mac OS X
# platform = ' platform=darwin'
# Apple XCode clang vs. LLVM clang are difficult to specify
# with spack syntax. Xcode clang name is `clang@x.y.z-apple`
# which precludes ranges being specified. We have proposed
# rename XCode clang to `clang@apple-x.y.z` or even
# `clang-apple@x.y.z as a possible fix.
# Compiler conflicts will be eventual taken from here:
# https://docs.nvidia.com/cuda/cuda-installation-guide-mac-os-x/index.html#abstract
# Make sure cuda_arch can not be used without +cuda
conflicts('~cuda', when='cuda_arch=20')
@ -74,3 +127,5 @@ def cuda_flags(arch_list):
conflicts('~cuda', when='cuda_arch=61')
conflicts('~cuda', when='cuda_arch=62')
conflicts('~cuda', when='cuda_arch=70')
conflicts('~cuda', when='cuda_arch=72')
conflicts('~cuda', when='cuda_arch=75')