Skip to content

Commit

Permalink
Merge pull request #109 from danpetry/dpetry/fixes
Browse files Browse the repository at this point in the history
Various fixes
  • Loading branch information
leofang authored Oct 22, 2024
2 parents c117822 + 5dd7aa5 commit a43b3e7
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 40 deletions.
4 changes: 2 additions & 2 deletions .scripts/build_steps.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 27 additions & 2 deletions azure-pipelines.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 0 additions & 25 deletions recipe/0001-Allow-custom-NVCC-path.patch

This file was deleted.

16 changes: 16 additions & 0 deletions recipe/0001-use-conda-ar-not-system.patch
Original file line number Diff line number Diff line change
@@ -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)
13 changes: 5 additions & 8 deletions recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
#!/bin/bash

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}\""
export CUDA_HOME=${CUDA_PATH}
fi

if [[ $CONDA_BUILD_CROSS_COMPILATION == "1" ]]; then
if [[ $target_platform == linux-aarch64 ]]; then
EXTRA_ARGS="${EXTRA_ARGS} CUDA_LIB=\"${CUDA_HOME}/targets/sbsa-linux/lib/\""
export CUDA_LIB=${CUDA_HOME}/targets/sbsa-linux/lib/
elif [[ $target_platform == linux-ppc64le ]]; then
EXTRA_ARGS="${EXTRA_ARGS} CUDA_LIB=\"${CUDA_HOME}/targets/ppc64le-linux/lib/\""
export CUDA_LIB=${CUDA_HOME}/targets/ppc64le-linux/lib/
else
echo "not supported"
exit -1
fi
fi

# `eval` is needed here for proper `${...}` expansion
eval make -j${CPU_COUNT} src.lib ${EXTRA_ARGS}
make -j${CPU_COUNT} src.lib

make install PREFIX="${PREFIX}"

Expand Down
5 changes: 2 additions & 3 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ source:
url: https://github.com/NVIDIA/nccl/archive/v{{ version }}.tar.gz
sha256: 6b946b70a9d2d01871842cbd15ec56488d358abe9a0f3767e372fddc3e241ba7
patches:
# Upstreaming w/PR: https://github.com/NVIDIA/nccl/pull/854
- 0001-Allow-custom-NVCC-path.patch
- 0001-use-conda-ar-not-system.patch

build:
number: 0
number: 1
skip: true # [(not linux) or cuda_compiler_version in (undefined, "None", "10.2")]
ignore_run_exports_from:
# Ignore `cudatoolkit` dependency in CUDA 11 builds
Expand Down

0 comments on commit a43b3e7

Please sign in to comment.