Skip to content

Commit 31e2f45

Browse files
authored
Merge pull request #21031 from sara-nl/20240722171932_new_pr_CUDA-Samples118
{lang}[GCC/11.3.0] CUDA-Samples v11.8, CUDA-Samples v12.2 w/ CUDA 11.7.0, CUDA 12.2.0
2 parents 35e3a19 + e99bfd0 commit 31e2f45

7 files changed

Lines changed: 227 additions & 6 deletions

easybuild/easyconfigs/c/CUDA-Samples/CUDA-Samples-11.3-GCC-10.3.0-CUDA-11.3.1.eb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ toolchain = {'name': 'GCC', 'version': '10.3.0'}
1111

1212
source_urls = ['https://github.com/NVIDIA/cuda-samples/archive/']
1313
sources = ['v%(version)s.tar.gz']
14-
checksums = ['2bee5f7c89347259aaab75aa6df6e10375059bdbbaf04cc7936f5db7d54fa3ac']
14+
patches = ['cuda-samples-11.3_multiple-sms.patch']
15+
checksums = [
16+
{'v11.3.tar.gz': '2bee5f7c89347259aaab75aa6df6e10375059bdbbaf04cc7936f5db7d54fa3ac'},
17+
{'cuda-samples-11.3_multiple-sms.patch': 'b31613f4160456f0d0abf82999c7fb7eee781f0efadc8b9bbb5a02ef0f37e21d'},
18+
]
1519

1620
dependencies = [
1721
('CUDA', '11.3.1', '', SYSTEM),
@@ -32,7 +36,7 @@ local_filters += "Samples/simpleVulkan/Makefile "
3236
local_filters += "Samples/simpleVulkanMMAP/Makefile "
3337
local_filters += "Samples/streamOrderedAllocationIPC/Makefile "
3438
local_filters += "Samples/vulkanImageCUDA/Makefile"
35-
buildopts = "HOST_COMPILER=g++ FILTER_OUT='%s'" % local_filters
39+
buildopts = "HOST_COMPILER=g++ SMS='%%(cuda_cc_space_sep_no_period)s' FILTER_OUT='%s'" % local_filters
3640

3741
files_to_copy = [
3842
(['bin/%s/linux/release/*' % ARCH], 'bin'),

easybuild/easyconfigs/c/CUDA-Samples/CUDA-Samples-11.6-GCC-11.3.0-CUDA-11.7.0.eb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ toolchain = {'name': 'GCC', 'version': '11.3.0'}
1111

1212
source_urls = ['https://github.com/NVIDIA/cuda-samples/archive/']
1313
sources = ['v%(version)s.tar.gz']
14-
checksums = ['75b858bcf9e534eaa0f129c418e661b83872d743de218df8a5278cc429f9ea98']
14+
patches = ['cuda-samples-11.6_multiple-sms.patch']
15+
checksums = [
16+
{'v11.6.tar.gz': '75b858bcf9e534eaa0f129c418e661b83872d743de218df8a5278cc429f9ea98'},
17+
{'cuda-samples-11.6_multiple-sms.patch': '8849e4882d797d155d6ebb71377fa1409205361776ade8da699452a4ecb94a0a'},
18+
]
1519

1620
dependencies = [
1721
('CUDA', '11.7.0', '', SYSTEM),
@@ -33,7 +37,7 @@ local_filters += "Samples/simpleVulkanMMAP/Makefile "
3337
local_filters += "Samples/streamOrderedAllocationIPC/Makefile "
3438
local_filters += "Samples/vulkanImageCUDA/Makefile"
3539

36-
buildopts = "HOST_COMPILER=g++ FILTER_OUT='%s'" % local_filters
40+
buildopts = "HOST_COMPILER=g++ SMS='%%(cuda_cc_space_sep_no_period)s' FILTER_OUT='%s'" % local_filters
3741

3842
files_to_copy = [
3943
(['bin/%s/linux/release/*' % ARCH], 'bin'),
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
easyblock = 'MakeCp'
2+
3+
name = 'CUDA-Samples'
4+
version = '11.8'
5+
versionsuffix = '-CUDA-%(cudaver)s'
6+
7+
homepage = 'https://github.com/NVIDIA/cuda-samples'
8+
description = "Samples for CUDA Developers which demonstrates features in CUDA Toolkit"
9+
10+
toolchain = {'name': 'GCC', 'version': '11.3.0'}
11+
12+
source_urls = ['https://github.com/NVIDIA/cuda-samples/archive/']
13+
sources = ['v%(version)s.tar.gz']
14+
patches = ['cuda-samples-11.6_multiple-sms.patch']
15+
checksums = [
16+
{'v11.8.tar.gz': '1bc02c0ca42a323f3c7a05b5682eae703681a91e95b135bfe81f848b2d6a2c51'},
17+
{'cuda-samples-11.6_multiple-sms.patch': '8849e4882d797d155d6ebb71377fa1409205361776ade8da699452a4ecb94a0a'},
18+
]
19+
20+
dependencies = [
21+
('CUDA', '11.7.0', '', SYSTEM),
22+
]
23+
24+
# Get rid of pre-built Windows DLLs and only build deviceQuery for now.
25+
prebuildopts = "rm -r bin/win64 && "
26+
27+
# Filter out samples that require extensive dependencies.
28+
local_filters = "Samples/2_Concepts_and_Techniques/EGLStream_CUDA_Interop/Makefile "
29+
local_filters += "Samples/4_CUDA_Libraries/boxFilterNPP/Makefile "
30+
local_filters += "Samples/4_CUDA_Libraries/cannyEdgeDetectorNPP/Makefile "
31+
local_filters += "Samples/4_CUDA_Libraries/cudaNvSci/Makefile "
32+
local_filters += "Samples/4_CUDA_Libraries/cudaNvSciNvMedia/Makefile "
33+
local_filters += "Samples/5_Domain_Specific/simpleGL/Makefile "
34+
local_filters += "Samples/3_CUDA_Features/warpAggregatedAtomicsCG/Makefile "
35+
local_filters += "Samples/5_Domain_Specific/simpleVulkan/Makefile "
36+
local_filters += "Samples/5_Domain_Specific/simpleVulkanMMAP/Makefile "
37+
local_filters += "Samples/2_Concepts_and_Techniques/streamOrderedAllocationIPC/Makefile "
38+
local_filters += "Samples/5_Domain_Specific/vulkanImageCUDA/Makefile "
39+
local_filters += "Samples/6_Performance/LargeKernelParameter/Makefile "
40+
41+
buildopts = "HOST_COMPILER=g++ SMS='%%(cuda_cc_space_sep_no_period)s' FILTER_OUT='%s'" % local_filters
42+
43+
files_to_copy = [
44+
(['bin/%s/linux/release/*' % ARCH], 'bin'),
45+
'LICENSE',
46+
]
47+
48+
local_binaries = ['deviceQuery', 'matrixMul', 'bandwidthTest', 'cudaOpenMP']
49+
50+
# Only paths are used for sanity checks.
51+
# Commands may fail due to missing compatibility libraries that might be needed
52+
# to be able to use this specific CUDA version in combination with the available
53+
# NVIDIA drivers.
54+
sanity_check_paths = {
55+
'files': ['bin/%s' % x for x in local_binaries],
56+
'dirs': [],
57+
}
58+
59+
moduleclass = 'lang'

easybuild/easyconfigs/c/CUDA-Samples/CUDA-Samples-12.1-GCC-12.3.0-CUDA-12.1.1.eb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ toolchain = {'name': 'GCC', 'version': '12.3.0'}
1111

1212
source_urls = ['https://github.com/NVIDIA/cuda-samples/archive/']
1313
sources = ['v%(version)s.tar.gz']
14-
checksums = ['f758160645b366d79c2638d8dfd389f01029b8d179ab0c11726b9ef58aecebd9']
14+
patches = ['cuda-samples-11.6_multiple-sms.patch']
15+
checksums = [
16+
{'v12.1.tar.gz': 'f758160645b366d79c2638d8dfd389f01029b8d179ab0c11726b9ef58aecebd9'},
17+
{'cuda-samples-11.6_multiple-sms.patch': '8849e4882d797d155d6ebb71377fa1409205361776ade8da699452a4ecb94a0a'},
18+
]
1519

1620
dependencies = [
1721
('CUDA', '12.1.1', '', SYSTEM),
@@ -58,7 +62,7 @@ if ARCH == 'aarch64':
5862
local_filters += "Samples/3_CUDA_Features/cdpQuadtree/Makefile "
5963
local_filters += "Samples/3_CUDA_Features/cdpAdvancedQuicksort/Makefile "
6064

61-
buildopts = "HOST_COMPILER=g++ FILTER_OUT='%s'" % local_filters
65+
buildopts = "HOST_COMPILER=g++ SMS='%%(cuda_cc_space_sep_no_period)s' FILTER_OUT='%s'" % local_filters
6266

6367
# Remove libraries in the bin dir after a successful 'make'
6468
buildopts += " && rm bin/*/linux/release/lib*.so.*"
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
easyblock = 'MakeCp'
2+
3+
name = 'CUDA-Samples'
4+
version = '12.2'
5+
versionsuffix = '-CUDA-%(cudaver)s'
6+
7+
homepage = 'https://github.com/NVIDIA/cuda-samples'
8+
description = "Samples for CUDA Developers which demonstrates features in CUDA Toolkit"
9+
10+
toolchain = {'name': 'GCC', 'version': '11.3.0'}
11+
12+
source_urls = ['https://github.com/NVIDIA/cuda-samples/archive/']
13+
sources = ['v%(version)s.tar.gz']
14+
patches = ['cuda-samples-11.6_multiple-sms.patch']
15+
checksums = [
16+
{'v12.2.tar.gz': '1823cfe28e97a9230107aa72b231f78952c0f178b71a920f036d360518480bdc'},
17+
{'cuda-samples-11.6_multiple-sms.patch': '8849e4882d797d155d6ebb71377fa1409205361776ade8da699452a4ecb94a0a'},
18+
]
19+
20+
builddependencies = [
21+
('CMake', '3.24.3'),
22+
]
23+
24+
dependencies = [
25+
('CUDA', '12.2.0', '', SYSTEM),
26+
]
27+
28+
# Get rid of pre-built Windows DLLs and only build deviceQuery for now.
29+
prebuildopts = "rm -r bin/win64 && "
30+
31+
# Filter out samples that require extensive dependencies.
32+
local_filters = "Samples/2_Concepts_and_Techniques/EGLStream_CUDA_Interop/Makefile "
33+
local_filters += "Samples/4_CUDA_Libraries/boxFilterNPP/Makefile "
34+
local_filters += "Samples/4_CUDA_Libraries/cannyEdgeDetectorNPP/Makefile "
35+
local_filters += "Samples/4_CUDA_Libraries/cudaNvSci/Makefile "
36+
local_filters += "Samples/4_CUDA_Libraries/cudaNvSciNvMedia/Makefile "
37+
local_filters += "Samples/5_Domain_Specific/simpleGL/Makefile "
38+
local_filters += "Samples/3_CUDA_Features/warpAggregatedAtomicsCG/Makefile "
39+
local_filters += "Samples/5_Domain_Specific/simpleVulkan/Makefile "
40+
local_filters += "Samples/5_Domain_Specific/simpleVulkanMMAP/Makefile "
41+
local_filters += "Samples/2_Concepts_and_Techniques/streamOrderedAllocationIPC/Makefile "
42+
local_filters += "Samples/5_Domain_Specific/vulkanImageCUDA/Makefile "
43+
local_filters += "Samples/6_Performance/LargeKernelParameter/Makefile "
44+
45+
buildopts = "HOST_COMPILER=g++ SMS='%%(cuda_cc_space_sep_no_period)s' FILTER_OUT='%s'" % local_filters
46+
47+
files_to_copy = [
48+
(['bin/%s/linux/release/*' % ARCH], 'bin'),
49+
'LICENSE',
50+
]
51+
52+
local_binaries = ['deviceQuery', 'matrixMul', 'bandwidthTest', 'cudaOpenMP']
53+
54+
# Only paths are used for sanity checks.
55+
# Commands may fail due to missing compatibility libraries that might be needed
56+
# to be able to use this specific CUDA version in combination with the available
57+
# NVIDIA drivers.
58+
sanity_check_paths = {
59+
'files': ['bin/%s' % x for x in local_binaries],
60+
'dirs': [],
61+
}
62+
63+
moduleclass = 'lang'
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Fixes "nvcc fatal: Option '--ptx (-ptx)' is not allowed when compiling for multiple GPU architectures"
2+
# fatal compilation issue when building for multiple SM architectures
3+
# More info, see https://github.com/NVIDIA/cuda-samples/issues/289
4+
5+
# Author: Caspar van Leeuwen
6+
7+
diff -Nru cuda-samples-11.3.orig/Samples/memMapIPCDrv/Makefile cuda-samples-11.3/Samples/memMapIPCDrv/Makefile
8+
--- cuda-samples-11.3.orig/Samples/memMapIPCDrv/Makefile 2024-07-29 13:17:10.330743000 +0200
9+
+++ cuda-samples-11.3/Samples/memMapIPCDrv/Makefile 2024-07-29 13:19:13.158507504 +0200
10+
@@ -321,6 +321,12 @@
11+
ifneq ($(HIGHEST_SM),)
12+
GENCODE_FLAGS += -gencode arch=compute_$(HIGHEST_SM),code=compute_$(HIGHEST_SM)
13+
endif
14+
+
15+
+# Generate the explicit PTX file for the lowest SM architecture in $(SMS), so it works on all SMS listed there
16+
+LOWEST_SM := $(firstword $(sort $(SMS)))
17+
+ifneq ($(LOWEST_SM),)
18+
+GENCODE_FLAGS_LOWEST_SM += -gencode arch=compute_$(LOWEST_SM),code=compute_$(LOWEST_SM)
19+
+endif
20+
endif
21+
22+
ifeq ($(TARGET_OS),darwin)
23+
@@ -401,7 +407,7 @@
24+
endif
25+
26+
$(PTX_FILE): memMapIpc_kernel.cu
27+
- $(EXEC) $(NVCC) $(INCLUDES) $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o $@ -ptx $<
28+
+ $(EXEC) $(NVCC) $(INCLUDES) $(ALL_CCFLAGS) $(GENCODE_FLAGS_LOWEST_SM) -o $@ -ptx $<
29+
$(EXEC) mkdir -p data
30+
$(EXEC) cp -f $@ ./data
31+
$(EXEC) mkdir -p ../../bin/$(TARGET_ARCH)/$(TARGET_OS)/$(BUILD_TYPE)
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Fixes "nvcc fatal: Option '--ptx (-ptx)' is not allowed when compiling for multiple GPU architectures"
2+
# fatal compilation issue when building for multiple SM architectures
3+
# More info, see https://github.com/NVIDIA/cuda-samples/issues/289
4+
5+
# Author: Caspar van Leeuwen
6+
7+
diff -Nru cuda-samples-12.2.orig/Samples/3_CUDA_Features/memMapIPCDrv/Makefile cuda-samples-12.2/Samples/3_CUDA_Features/memMapIPCDrv/Makefile
8+
--- cuda-samples-12.2.orig/Samples/3_CUDA_Features/memMapIPCDrv/Makefile 2024-07-29 12:14:28.538848000 +0200
9+
+++ cuda-samples-12.2/Samples/3_CUDA_Features/memMapIPCDrv/Makefile 2024-07-29 13:02:45.134261829 +0200
10+
@@ -313,6 +313,12 @@
11+
ifneq ($(HIGHEST_SM),)
12+
GENCODE_FLAGS += -gencode arch=compute_$(HIGHEST_SM),code=compute_$(HIGHEST_SM)
13+
endif
14+
+
15+
+# Generate the explicit PTX file for the lowest SM architecture in $(SMS), so it works on all SMS listed there
16+
+LOWEST_SM := $(firstword $(sort $(SMS)))
17+
+ifneq ($(LOWEST_SM),)
18+
+GENCODE_FLAGS_LOWEST_SM += -gencode arch=compute_$(LOWEST_SM),code=compute_$(LOWEST_SM)
19+
+endif
20+
endif
21+
22+
ifeq ($(TARGET_OS),darwin)
23+
@@ -394,7 +400,7 @@
24+
endif
25+
26+
$(PTX_FILE): memMapIpc_kernel.cu
27+
- $(EXEC) $(NVCC) $(INCLUDES) $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o $@ -ptx $<
28+
+ $(EXEC) $(NVCC) $(INCLUDES) $(ALL_CCFLAGS) $(GENCODE_FLAGS_LOWEST_SM) -o $@ -ptx $<
29+
$(EXEC) mkdir -p data
30+
$(EXEC) cp -f $@ ./data
31+
$(EXEC) mkdir -p ../../../bin/$(TARGET_ARCH)/$(TARGET_OS)/$(BUILD_TYPE)
32+
diff -Nru cuda-samples-12.2.orig/Samples/3_CUDA_Features/ptxjit/Makefile cuda-samples-12.2/Samples/3_CUDA_Features/ptxjit/Makefile
33+
--- cuda-samples-12.2.orig/Samples/3_CUDA_Features/ptxjit/Makefile 2024-07-29 12:14:28.546771000 +0200
34+
+++ cuda-samples-12.2/Samples/3_CUDA_Features/ptxjit/Makefile 2024-07-29 13:02:38.741961008 +0200
35+
@@ -307,6 +307,12 @@
36+
ifneq ($(HIGHEST_SM),)
37+
GENCODE_FLAGS += -gencode arch=compute_$(HIGHEST_SM),code=compute_$(HIGHEST_SM)
38+
endif
39+
+
40+
+# Generate the explicit PTX file for the lowest SM architecture in $(SMS), so it works on all SMS listed there
41+
+LOWEST_SM := $(firstword $(sort $(SMS)))
42+
+ifneq ($(LOWEST_SM),)
43+
+GENCODE_FLAGS_LOWEST_SM += -gencode arch=compute_$(LOWEST_SM),code=compute_$(LOWEST_SM)
44+
+endif
45+
endif
46+
47+
ifeq ($(TARGET_OS),darwin)
48+
@@ -390,7 +396,7 @@
49+
endif
50+
51+
$(PTX_FILE): ptxjit_kernel.cu
52+
- $(EXEC) $(NVCC) $(INCLUDES) $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o $@ -ptx $<
53+
+ $(EXEC) $(NVCC) $(INCLUDES) $(ALL_CCFLAGS) $(GENCODE_FLAGS_LOWEST_SM) -o $@ -ptx $<
54+
$(EXEC) mkdir -p data
55+
$(EXEC) cp -f $@ ./data
56+
$(EXEC) mkdir -p ../../../bin/$(TARGET_ARCH)/$(TARGET_OS)/$(BUILD_TYPE)

0 commit comments

Comments
 (0)