forked from easybuilders/easybuild-easyconfigs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix which patch to apply where... the filestructure was restructured …
…in the CUDA sources starting at 11.6
- Loading branch information
casparl
committed
Jul 29, 2024
1 parent
988d69a
commit 238ce2c
Showing
7 changed files
with
92 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
easybuild/easyconfigs/c/CUDA-Samples/cuda-samples-11.3_multiple-sms.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Fixes "nvcc fatal: Option '--ptx (-ptx)' is not allowed when compiling for multiple GPU architectures" | ||
# fatal compilation issue when building for multiple SM architectures | ||
# More info, see https://github.com/NVIDIA/cuda-samples/issues/289 | ||
|
||
# Author: Caspar van Leeuwen | ||
|
||
diff -Nru cuda-samples-11.3.orig/Samples/memMapIPCDrv/Makefile cuda-samples-11.3/Samples/memMapIPCDrv/Makefile | ||
--- cuda-samples-11.3.orig/Samples/memMapIPCDrv/Makefile 2024-07-29 13:17:10.330743000 +0200 | ||
+++ cuda-samples-11.3/Samples/memMapIPCDrv/Makefile 2024-07-29 13:19:13.158507504 +0200 | ||
@@ -321,6 +321,12 @@ | ||
ifneq ($(HIGHEST_SM),) | ||
GENCODE_FLAGS += -gencode arch=compute_$(HIGHEST_SM),code=compute_$(HIGHEST_SM) | ||
endif | ||
+ | ||
+# Generate the explicit PTX file for the lowest SM architecture in $(SMS), so it works on all SMS listed there | ||
+LOWEST_SM := $(firstword $(sort $(SMS))) | ||
+ifneq ($(LOWEST_SM),) | ||
+GENCODE_FLAGS_LOWEST_SM += -gencode arch=compute_$(LOWEST_SM),code=compute_$(LOWEST_SM) | ||
+endif | ||
endif | ||
|
||
ifeq ($(TARGET_OS),darwin) | ||
@@ -401,7 +407,7 @@ | ||
endif | ||
|
||
$(PTX_FILE): memMapIpc_kernel.cu | ||
- $(EXEC) $(NVCC) $(INCLUDES) $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o $@ -ptx $< | ||
+ $(EXEC) $(NVCC) $(INCLUDES) $(ALL_CCFLAGS) $(GENCODE_FLAGS_LOWEST_SM) -o $@ -ptx $< | ||
$(EXEC) mkdir -p data | ||
$(EXEC) cp -f $@ ./data | ||
$(EXEC) mkdir -p ../../bin/$(TARGET_ARCH)/$(TARGET_OS)/$(BUILD_TYPE) |
56 changes: 56 additions & 0 deletions
56
easybuild/easyconfigs/c/CUDA-Samples/cuda-samples-11.6_multiple-sms.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Fixes "nvcc fatal: Option '--ptx (-ptx)' is not allowed when compiling for multiple GPU architectures" | ||
# fatal compilation issue when building for multiple SM architectures | ||
# More info, see https://github.com/NVIDIA/cuda-samples/issues/289 | ||
|
||
# Author: Caspar van Leeuwen | ||
|
||
diff -Nru cuda-samples-12.2.orig/Samples/3_CUDA_Features/memMapIPCDrv/Makefile cuda-samples-12.2/Samples/3_CUDA_Features/memMapIPCDrv/Makefile | ||
--- cuda-samples-12.2.orig/Samples/3_CUDA_Features/memMapIPCDrv/Makefile 2024-07-29 12:14:28.538848000 +0200 | ||
+++ cuda-samples-12.2/Samples/3_CUDA_Features/memMapIPCDrv/Makefile 2024-07-29 13:02:45.134261829 +0200 | ||
@@ -313,6 +313,12 @@ | ||
ifneq ($(HIGHEST_SM),) | ||
GENCODE_FLAGS += -gencode arch=compute_$(HIGHEST_SM),code=compute_$(HIGHEST_SM) | ||
endif | ||
+ | ||
+# Generate the explicit PTX file for the lowest SM architecture in $(SMS), so it works on all SMS listed there | ||
+LOWEST_SM := $(firstword $(sort $(SMS))) | ||
+ifneq ($(LOWEST_SM),) | ||
+GENCODE_FLAGS_LOWEST_SM += -gencode arch=compute_$(LOWEST_SM),code=compute_$(LOWEST_SM) | ||
+endif | ||
endif | ||
|
||
ifeq ($(TARGET_OS),darwin) | ||
@@ -394,7 +400,7 @@ | ||
endif | ||
|
||
$(PTX_FILE): memMapIpc_kernel.cu | ||
- $(EXEC) $(NVCC) $(INCLUDES) $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o $@ -ptx $< | ||
+ $(EXEC) $(NVCC) $(INCLUDES) $(ALL_CCFLAGS) $(GENCODE_FLAGS_LOWEST_SM) -o $@ -ptx $< | ||
$(EXEC) mkdir -p data | ||
$(EXEC) cp -f $@ ./data | ||
$(EXEC) mkdir -p ../../../bin/$(TARGET_ARCH)/$(TARGET_OS)/$(BUILD_TYPE) | ||
diff -Nru cuda-samples-12.2.orig/Samples/3_CUDA_Features/ptxjit/Makefile cuda-samples-12.2/Samples/3_CUDA_Features/ptxjit/Makefile | ||
--- cuda-samples-12.2.orig/Samples/3_CUDA_Features/ptxjit/Makefile 2024-07-29 12:14:28.546771000 +0200 | ||
+++ cuda-samples-12.2/Samples/3_CUDA_Features/ptxjit/Makefile 2024-07-29 13:02:38.741961008 +0200 | ||
@@ -307,6 +307,12 @@ | ||
ifneq ($(HIGHEST_SM),) | ||
GENCODE_FLAGS += -gencode arch=compute_$(HIGHEST_SM),code=compute_$(HIGHEST_SM) | ||
endif | ||
+ | ||
+# Generate the explicit PTX file for the lowest SM architecture in $(SMS), so it works on all SMS listed there | ||
+LOWEST_SM := $(firstword $(sort $(SMS))) | ||
+ifneq ($(LOWEST_SM),) | ||
+GENCODE_FLAGS_LOWEST_SM += -gencode arch=compute_$(LOWEST_SM),code=compute_$(LOWEST_SM) | ||
+endif | ||
endif | ||
|
||
ifeq ($(TARGET_OS),darwin) | ||
@@ -390,7 +396,7 @@ | ||
endif | ||
|
||
$(PTX_FILE): ptxjit_kernel.cu | ||
- $(EXEC) $(NVCC) $(INCLUDES) $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o $@ -ptx $< | ||
+ $(EXEC) $(NVCC) $(INCLUDES) $(ALL_CCFLAGS) $(GENCODE_FLAGS_LOWEST_SM) -o $@ -ptx $< | ||
$(EXEC) mkdir -p data | ||
$(EXEC) cp -f $@ ./data | ||
$(EXEC) mkdir -p ../../../bin/$(TARGET_ARCH)/$(TARGET_OS)/$(BUILD_TYPE) |