Skip to content

Commit

Permalink
build latest NCCL from source
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbyrne committed Dec 11, 2023
1 parent 6ceb2cc commit 58796b2
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 63 deletions.
11 changes: 0 additions & 11 deletions N/NCCL/build_11.0.jl

This file was deleted.

11 changes: 0 additions & 11 deletions N/NCCL/build_12.0.jl

This file was deleted.

11 changes: 0 additions & 11 deletions N/NCCL/build_12.2.jl

This file was deleted.

60 changes: 30 additions & 30 deletions N/NCCL/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
# Note that this script can accept some limited command-line arguments, run
# `julia build_tarballs.jl --help` to see a usage message
using BinaryBuilder, Pkg
using Base.BinaryPlatforms: arch, os

const YGGDRASIL_DIR = "../.."
include(joinpath(YGGDRASIL_DIR, "fancy_toys.jl"))
include(joinpath(YGGDRASIL_DIR, "platforms", "cuda.jl"))

name = "NCCL"
version = v"2.18.5"
build = 1
version = v"2.19.4"

script = raw"""
mkdir -p ${libdir} ${prefix}/include
cd ${WORKSPACE}/srcdir/nccl*
find .
# Collection of sources required to complete build
sources = [
GitSource("https://github.com/NVIDIA/nccl.git", "88d44d777f6970bdbf6610badcbd7e25a05380f0"),
]

install_license LICENSE.txt
# Bash recipe for building across all platforms
script = raw"""
cd $WORKSPACE/srcdir
mv lib/libnccl*.so* ${libdir}
mv include/* ${prefix}/include
cd nccl
make -j src.build
"""

augment_platform_block = CUDA.augment
# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
platforms = CUDA.supported_platforms()

products = [
LibraryProduct("libnccl", :libnccl),
]

dependencies = [RuntimeDependency(PackageSpec(name="CUDA_Runtime_jll"))]

# TODO: how does compatibility work here exactly? do we support 11.0-12.2?
# are we correctly selecting artifacts in that case?
builds = ["11.0", "12.0", "12.2"]
for build in builds
include("build_$(build).jl")
cuda_version = VersionNumber(build)

for (platform, sources) in platforms_and_sources
augmented_platform = Platform(arch(platform), os(platform);
cuda=CUDA.platform(cuda_version))
should_build_platform(triplet(augmented_platform)) || continue
build_tarballs(ARGS, name, version, sources, script, [augmented_platform],
products, dependencies; lazy_artifacts=true,
julia_compat="1.6", augment_platform_block,
skip_audit=true, dont_dlopen=true)
end
# Dependencies that must be installed before this package can be built
dependencies = [
Dependency(PackageSpec(name="CompilerSupportLibraries_jll", uuid="e66e0078-7015-5450-92f7-15fbd957f2ae")),
]

# Build for all supported CUDA toolkits
for platform in platforms
should_build_platform(triplet(platform)) || continue

cuda_deps = CUDA.required_dependencies(platform)

build_tarballs(ARGS, name, version, sources, script, [platform],
products, [dependencies; cuda_deps]; lazy_artifacts=true,
julia_compat="1.7", CUDA.augment,
skip_audit=true, dont_dlopen=true)
end

0 comments on commit 58796b2

Please sign in to comment.