Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CUDA: Introduce arm64 subarchitecture. #8622

Merged
merged 4 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions C/CUDA/CUDA_Runtime/build_10.2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ if [[ ${target} == *-linux-gnu ]]; then
# CUDA Random Number Generation Library
mv lib64/libcurand.so* ${libdir}

# NVIDIA Optimizing Compiler Library
mv nvvm/lib64/libnvvm.so* ${libdir}

# NVIDIA Common Device Math Functions Library
mkdir ${prefix}/share/libdevice
mv nvvm/libdevice/libdevice.10.bc ${prefix}/share/libdevice
Expand Down Expand Up @@ -77,9 +74,6 @@ elif [[ ${target} == x86_64-w64-mingw32 ]]; then
# CUDA Random Number Generation Library
mv bin/curand64_*.dll ${bindir}

# NVIDIA Optimizing Compiler Library
mv nvvm/bin/nvvm64_*.dll ${bindir}

# NVIDIA Common Device Math Functions Library
mkdir ${prefix}/share/libdevice
mv nvvm/libdevice/libdevice.10.bc ${prefix}/share/libdevice
Expand Down
37 changes: 27 additions & 10 deletions C/CUDA/CUDA_Runtime/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ augment_platform_block = """

platforms = [Platform("x86_64", "linux"),
Platform("powerpc64le", "linux"),
Platform("aarch64", "linux"),
Platform("aarch64", "linux"; cuda_platform="jetson"),
Platform("aarch64", "linux"; cuda_platform="sbsa"),
Platform("x86_64", "windows")]

script = raw"""
Expand Down Expand Up @@ -132,20 +133,36 @@ for version in CUDA.cuda_full_versions
augmented_platform["cuda"] = CUDA.platform(version)

should_build_platform(triplet(augmented_platform)) || continue

if arch(platform) == "aarch64"
# CUDA 10.x: our CUDA 10.2 build recipe for arm64 only provides jetson binaries
if thisminor(version) == "10.2" && platform["cuda_platform"] != "jetson"
continue
end

# CUDA 11.x: only 11.8 has jetson binaries on the redist server
if v"11.0" <= thisminor(version) < v"11.8" && platform["cuda_platform"] == "jetson"
continue
end

# CUDA 12.x: the jetson binaries for 12.3 seem to be missing
if thisminor(version) == v"12.3" && platform["cuda_platform"] == "jetson"
continue
end
end

if Base.thisminor(version) == v"10.2"
push!(builds,
(; dependencies=[
Dependency("CUDA_Driver_jll"; compat="0.8"),
BuildDependency(PackageSpec(name="CUDA_SDK_jll", version=v"10.2.89")),
],
script=get_script(), platforms=[augmented_platform], products=get_products(platform),
sources=[]
(; dependencies=[Dependency("CUDA_Driver_jll"; compat="0.8"),
BuildDependency(PackageSpec(name="CUDA_SDK_jll", version=v"10.2.89"))],
script=get_script(), platforms=[augmented_platform], products=get_products(platform),
sources=[]
))
else
push!(builds,
(; dependencies=[Dependency("CUDA_Driver_jll"; compat="0.8")],
script, platforms=[augmented_platform], products=get_products(platform),
sources=get_sources("cuda", components; version, platform)
script, platforms=[augmented_platform], products=get_products(platform),
sources=get_sources("cuda", components; version, platform)
))
end
end
Expand All @@ -162,5 +179,5 @@ for (i,build) in enumerate(builds)
build_tarballs(i == lastindex(builds) ? non_platform_ARGS : non_reg_ARGS,
name, version, build.sources, build.script,
build.platforms, build.products, build.dependencies;
julia_compat="1.6",lazy_artifacts=true, augment_platform_block)
julia_compat="1.6", lazy_artifacts=true, augment_platform_block)
end
20 changes: 20 additions & 0 deletions C/CUDA/CUDA_Runtime/platform_augmentation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,17 @@ function cuda_comparison_strategy(a::String, b::String, a_requested::Bool, b_req
return a == b
end

function is_tegra()
if isfile("/etc/nv_tegra_release")
return true
end
if isfile("/proc/device-tree/compatible") &&
contains(read("/proc/device-tree/compatible", String), "tegra")
return true
end
return false
end

function augment_platform!(platform::Platform)
if !haskey(platform, "cuda")
platform["cuda"] = something(cuda_toolkit_tag(), "none")
Expand All @@ -303,5 +314,14 @@ function augment_platform!(platform::Platform)
# query it from CUDA.jl without having to parse the preference again.
platform["cuda_local"] = string(local_preference !== missing && local_preference)

# if we're on an arm64 platform, identify the CUDA subplatform
if Sys.islinux() && arch(platform) == "aarch64"
platform["cuda_platform"] = if is_tegra()
"jetson"
else
"sbsa"
end
end

return platform
end
5 changes: 2 additions & 3 deletions C/CUDA/CUDA_SDK@10.2/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ include(joinpath(YGGDRASIL_DIR, "platforms", "cuda.jl"))
name = "CUDA_SDK"
version = CUDA.full_version(v"10.2")

platforms = [Platform("aarch64", "linux"),
platforms = [Platform("x86_64", "linux"),
Platform("powerpc64le", "linux"),
Platform("x86_64", "linux"),
Platform("x86_64", "macos"),
Platform("aarch64", "linux"; cuda_platform="jetson"),
Platform("x86_64", "windows")]

build_sdk(name, version, platforms; static=false)
2 changes: 1 addition & 1 deletion C/CUDA/CUDA_SDK@11.4/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ version = CUDA.full_version(v"11.4")

platforms = [Platform("x86_64", "linux"),
Platform("powerpc64le", "linux"),
Platform("aarch64", "linux"),
Platform("aarch64", "linux"; cuda_platform="sbsa"),
Platform("x86_64", "windows")]

build_sdk(name, version, platforms; static=false)
Expand Down
2 changes: 1 addition & 1 deletion C/CUDA/CUDA_SDK@11.5/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ version = CUDA.full_version(v"11.5")

platforms = [Platform("x86_64", "linux"),
Platform("powerpc64le", "linux"),
Platform("aarch64", "linux"),
Platform("aarch64", "linux"; cuda_platform="sbsa"),
Platform("x86_64", "windows")]

build_sdk(name, version, platforms; static=false)
Expand Down
2 changes: 1 addition & 1 deletion C/CUDA/CUDA_SDK@11.6/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ version = CUDA.full_version(v"11.6")

platforms = [Platform("x86_64", "linux"),
Platform("powerpc64le", "linux"),
Platform("aarch64", "linux"),
Platform("aarch64", "linux"; cuda_platform="sbsa"),
Platform("x86_64", "windows")]

build_sdk(name, version, platforms; static=false)
Expand Down
2 changes: 1 addition & 1 deletion C/CUDA/CUDA_SDK@11.7/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ version = CUDA.full_version(v"11.7")

platforms = [Platform("x86_64", "linux"),
Platform("powerpc64le", "linux"),
Platform("aarch64", "linux"),
Platform("aarch64", "linux"; cuda_platform="sbsa"),
Platform("x86_64", "windows")]

build_sdk(name, version, platforms; static=false)
Expand Down
5 changes: 2 additions & 3 deletions C/CUDA/CUDA_SDK@11.8/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ version = CUDA.full_version(v"11.8")

platforms = [Platform("x86_64", "linux"),
Platform("powerpc64le", "linux"),
Platform("aarch64", "linux"),
Platform("aarch64", "linux"; cuda_platform="jetson"),
Platform("aarch64", "linux"; cuda_platform="sbsa"),
Platform("x86_64", "windows")]

build_sdk(name, version, platforms; static=false)

# bump
5 changes: 2 additions & 3 deletions C/CUDA/CUDA_SDK@12.0/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ version = CUDA.full_version(v"12.0")

platforms = [Platform("x86_64", "linux"),
Platform("powerpc64le", "linux"),
Platform("aarch64", "linux"),
Platform("aarch64", "linux"; cuda_platform="jetson"),
Platform("aarch64", "linux"; cuda_platform="sbsa"),
Platform("x86_64", "windows")]

build_sdk(name, version, platforms; static=false)

# bump
5 changes: 2 additions & 3 deletions C/CUDA/CUDA_SDK@12.1/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ version = CUDA.full_version(v"12.1")

platforms = [Platform("x86_64", "linux"),
Platform("powerpc64le", "linux"),
Platform("aarch64", "linux"),
Platform("aarch64", "linux"; cuda_platform="jetson"),
Platform("aarch64", "linux"; cuda_platform="sbsa"),
Platform("x86_64", "windows")]

build_sdk(name, version, platforms; static=false)

# bump
5 changes: 2 additions & 3 deletions C/CUDA/CUDA_SDK@12.2/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ version = CUDA.full_version(v"12.2")

platforms = [Platform("x86_64", "linux"),
Platform("powerpc64le", "linux"),
Platform("aarch64", "linux"),
Platform("aarch64", "linux"; cuda_platform="jetson"),
Platform("aarch64", "linux"; cuda_platform="sbsa"),
Platform("x86_64", "windows")]

build_sdk(name, version, platforms; static=false)

# bump
4 changes: 1 addition & 3 deletions C/CUDA/CUDA_SDK@12.3/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ version = CUDA.full_version(v"12.3")

platforms = [Platform("x86_64", "linux"),
Platform("powerpc64le", "linux"),
Platform("aarch64", "linux"),
Platform("aarch64", "linux"; cuda_platform="sbsa"),
Platform("x86_64", "windows")]

build_sdk(name, version, platforms; static=false)

# Bump for 12.3.2 build
5 changes: 2 additions & 3 deletions C/CUDA/CUDA_SDK@12.4/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ version = CUDA.full_version(v"12.4")

platforms = [Platform("x86_64", "linux"),
Platform("powerpc64le", "linux"),
Platform("aarch64", "linux"),
Platform("aarch64", "linux"; cuda_platform="jetson"),
Platform("aarch64", "linux"; cuda_platform="sbsa"),
Platform("x86_64", "windows")]

build_sdk(name, version, platforms; static=false)

# bump
5 changes: 2 additions & 3 deletions C/CUDA/CUDA_SDK_static@10.2/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ include(joinpath(YGGDRASIL_DIR, "platforms", "cuda.jl"))
name = "CUDA_SDK_static"
version = CUDA.full_version(v"10.2")

platforms = [Platform("aarch64", "linux"),
platforms = [Platform("x86_64", "linux"),
Platform("powerpc64le", "linux"),
Platform("x86_64", "linux"),
Platform("x86_64", "macos"),
Platform("aarch64", "linux"; cuda_platform="jetson"),
Platform("x86_64", "windows")]

build_sdk(name, version, platforms; static=true)
4 changes: 1 addition & 3 deletions C/CUDA/CUDA_SDK_static@11.4/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ version = CUDA.full_version(v"11.4")

platforms = [Platform("x86_64", "linux"),
Platform("powerpc64le", "linux"),
Platform("aarch64", "linux"),
Platform("aarch64", "linux"; cuda_platform="sbsa"),
Platform("x86_64", "windows")]

build_sdk(name, version, platforms; static=true)

# bump
4 changes: 1 addition & 3 deletions C/CUDA/CUDA_SDK_static@11.5/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ version = CUDA.full_version(v"11.5")

platforms = [Platform("x86_64", "linux"),
Platform("powerpc64le", "linux"),
Platform("aarch64", "linux"),
Platform("aarch64", "linux"; cuda_platform="sbsa"),
Platform("x86_64", "windows")]

build_sdk(name, version, platforms; static=true)

# bump
4 changes: 1 addition & 3 deletions C/CUDA/CUDA_SDK_static@11.6/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ version = CUDA.full_version(v"11.6")

platforms = [Platform("x86_64", "linux"),
Platform("powerpc64le", "linux"),
Platform("aarch64", "linux"),
Platform("aarch64", "linux"; cuda_platform="sbsa"),
Platform("x86_64", "windows")]

build_sdk(name, version, platforms; static=true)

# bump
4 changes: 1 addition & 3 deletions C/CUDA/CUDA_SDK_static@11.7/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ version = CUDA.full_version(v"11.7")

platforms = [Platform("x86_64", "linux"),
Platform("powerpc64le", "linux"),
Platform("aarch64", "linux"),
Platform("aarch64", "linux"; cuda_platform="sbsa"),
Platform("x86_64", "windows")]

build_sdk(name, version, platforms; static=true)

# bump
3 changes: 2 additions & 1 deletion C/CUDA/CUDA_SDK_static@11.8/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ version = CUDA.full_version(v"11.8")

platforms = [Platform("x86_64", "linux"),
Platform("powerpc64le", "linux"),
Platform("aarch64", "linux"),
Platform("aarch64", "linux"; cuda_platform="jetson"),
Platform("aarch64", "linux"; cuda_platform="sbsa"),
Platform("x86_64", "windows")]

build_sdk(name, version, platforms; static=true)
Expand Down
3 changes: 2 additions & 1 deletion C/CUDA/CUDA_SDK_static@12.0/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ version = CUDA.full_version(v"12.0")

platforms = [Platform("x86_64", "linux"),
Platform("powerpc64le", "linux"),
Platform("aarch64", "linux"),
Platform("aarch64", "linux"; cuda_platform="jetson"),
Platform("aarch64", "linux"; cuda_platform="sbsa"),
Platform("x86_64", "windows")]

build_sdk(name, version, platforms; static=true)
Expand Down
3 changes: 2 additions & 1 deletion C/CUDA/CUDA_SDK_static@12.1/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ version = CUDA.full_version(v"12.1")

platforms = [Platform("x86_64", "linux"),
Platform("powerpc64le", "linux"),
Platform("aarch64", "linux"),
Platform("aarch64", "linux"; cuda_platform="jetson"),
Platform("aarch64", "linux"; cuda_platform="sbsa"),
Platform("x86_64", "windows")]

build_sdk(name, version, platforms; static=true)
Expand Down
3 changes: 2 additions & 1 deletion C/CUDA/CUDA_SDK_static@12.2/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ version = CUDA.full_version(v"12.2")

platforms = [Platform("x86_64", "linux"),
Platform("powerpc64le", "linux"),
Platform("aarch64", "linux"),
Platform("aarch64", "linux"; cuda_platform="jetson"),
Platform("aarch64", "linux"; cuda_platform="sbsa"),
Platform("x86_64", "windows")]

build_sdk(name, version, platforms; static=true)
Expand Down
4 changes: 1 addition & 3 deletions C/CUDA/CUDA_SDK_static@12.3/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ version = CUDA.full_version(v"12.3")

platforms = [Platform("x86_64", "linux"),
Platform("powerpc64le", "linux"),
Platform("aarch64", "linux"),
Platform("aarch64", "linux"; cuda_platform="sbsa"),
Platform("x86_64", "windows")]

build_sdk(name, version, platforms; static=true)

# Bump for 12.3.2 build
5 changes: 2 additions & 3 deletions C/CUDA/CUDA_SDK_static@12.4/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ version = CUDA.full_version(v"12.4")

platforms = [Platform("x86_64", "linux"),
Platform("powerpc64le", "linux"),
Platform("aarch64", "linux"),
Platform("aarch64", "linux"; cuda_platform="jetson"),
Platform("aarch64", "linux"; cuda_platform="sbsa"),
Platform("x86_64", "windows")]

build_sdk(name, version, platforms; static=true)

# bump
Loading