From 4091e877bf09d15296dccdb12ac720bc7206d387 Mon Sep 17 00:00:00 2001 From: Daniel Petry Date: Thu, 16 May 2024 13:26:10 -0500 Subject: [PATCH 1/4] Don't build on s390x, it's unsupported by CUDA --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 963a697..fdf809b 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -14,7 +14,7 @@ source: build: number: 0 - skip: true # [(not linux) or cuda_compiler_version in (undefined, "None", "10.2")] + skip: true # [(not linux) or s390x or cuda_compiler_version in (undefined, "None", "10.2")] ignore_run_exports_from: # Ignore `cudatoolkit` dependency in CUDA 11 builds - {{ compiler("cuda") }} # [(cuda_compiler_version or "").startswith("11")] From 9ba7185f636fca301789fcdf9fe47ecd4b9c7b7c Mon Sep 17 00:00:00 2001 From: Daniel Petry Date: Thu, 16 May 2024 13:26:21 -0500 Subject: [PATCH 2/4] Build with CUDA v12.4 --- recipe/conda_build_config.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index 1ea99f3..f3beb68 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -6,10 +6,11 @@ # - 7.3 # [linux] # cxx_compiler_version: # [linux] # - 7.3 # [linux] -cuda_compiler: nvcc +cuda_compiler: cuda-nvcc cuda_compiler_version: - - 9.2 + #- 9.2 #- 10.0 # - 10.1 #- 10.2 - #- 11.0 \ No newline at end of file + #- 11.0 + - 12.4 From 3269d16fd2649e64d14b347a46562959fe34fe84 Mon Sep 17 00:00:00 2001 From: Daniel Petry Date: Thu, 16 May 2024 17:55:57 -0500 Subject: [PATCH 3/4] Make conda-build find the CUDA folder correctly --- recipe/build.sh | 5 +++-- recipe/meta.yaml | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/recipe/build.sh b/recipe/build.sh index ce8df31..0770377 100755 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -4,6 +4,7 @@ EXTRA_ARGS="CUDARTLIB=\"cudart_static\"" if [[ "${cuda_compiler_version}" =~ 12.* ]]; then EXTRA_ARGS="${EXTRA_ARGS} CUDA_HOME=\"${PREFIX}\" NVCC=\"${BUILD_PREFIX}/bin/nvcc\"" + export CUDA_HOME=${BUILD_PREFIX} elif [[ "${cuda_compiler_version}" != "None" ]]; then EXTRA_ARGS="${EXTRA_ARGS} CUDA_HOME=\"${CUDA_PATH}\"" fi @@ -19,8 +20,8 @@ if [[ $CONDA_BUILD_CROSS_COMPILATION == "1" ]]; then fi fi -# `eval` is needed here for proper `${...}` expansion -eval make -j${CPU_COUNT} src.lib ${EXTRA_ARGS} +# Handing CUDA_HOME to make via an environment variable works; using eval and make args doesn't. +make -j${CPU_COUNT} src.lib make install PREFIX="${PREFIX}" diff --git a/recipe/meta.yaml b/recipe/meta.yaml index fdf809b..06c2cd0 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -9,8 +9,8 @@ source: url: https://github.com/NVIDIA/nccl/archive/v{{ version }}.tar.gz sha256: 1923596984d85e310b5b6c52b2c72a1b93da57218f2bc5a5c7ac3d59297a3303 patches: - # Upstreaming w/PR: https://github.com/NVIDIA/nccl/pull/854 - - 0001-Allow-custom-NVCC-path.patch + # This isn't needed; setting CUDA_HOME sets NVCC correctly + #- 0001-Allow-custom-NVCC-path.patch build: number: 0 From c4c66c71ca2654bb42e0f8739a1e917b7de60fca Mon Sep 17 00:00:00 2001 From: Daniel Petry Date: Thu, 16 May 2024 17:56:48 -0500 Subject: [PATCH 4/4] Use conda ar rather than system one --- recipe/0002-use-conda-ar-not-system.patch | 16 ++++++++++++++++ recipe/meta.yaml | 2 ++ 2 files changed, 18 insertions(+) create mode 100644 recipe/0002-use-conda-ar-not-system.patch diff --git a/recipe/0002-use-conda-ar-not-system.patch b/recipe/0002-use-conda-ar-not-system.patch new file mode 100644 index 0000000..0399e15 --- /dev/null +++ b/recipe/0002-use-conda-ar-not-system.patch @@ -0,0 +1,16 @@ +This fixes an issue where the build fails on linux-aarch64, because a system ar +can't be found. Presumably it's using the system ar on other platforms, too, +which isn't ideal. +Index: nccl/src/Makefile +=================================================================== +--- nccl.orig/src/Makefile 2024-05-16 16:58:16.522514975 -0500 ++++ nccl/src/Makefile 2024-05-16 17:47:45.959416166 -0500 +@@ -83,7 +83,7 @@ + $(LIBDIR)/$(STATICLIBTARGET): $(LIBOBJ) $(DEVMANIFEST) + @printf "Archiving %-35s > %s\n" $(STATICLIBTARGET) $@ + mkdir -p $(LIBDIR) +- ar cr $@ $(LIBOBJ) $$(cat $(DEVMANIFEST)) ++ $(AR) cr $@ $(LIBOBJ) $$(cat $(DEVMANIFEST)) + + $(PKGDIR)/nccl.pc : nccl.pc.in + mkdir -p $(PKGDIR) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 06c2cd0..8bc8bf4 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -11,6 +11,7 @@ source: patches: # This isn't needed; setting CUDA_HOME sets NVCC correctly #- 0001-Allow-custom-NVCC-path.patch + - 0002-use-conda-ar-not-system.patch build: number: 0 @@ -28,6 +29,7 @@ requirements: - {{ compiler("cxx") }} - {{ compiler("cuda") }} - make + - patch host: - cuda-version ={{ cuda_compiler_version }} # [(cuda_compiler_version or "").startswith("11")] run: