Merge branch '286-cuda-yaml-config-and-install-on-gh' into 'master'

Resolve "cuda: YAML config and install on GH"

Closes #286

See merge request Pmodules/buildblocks!451
This commit is contained in:
2025-03-13 10:26:17 +01:00
3 changed files with 134 additions and 33 deletions

View File

@@ -1,29 +1,14 @@
#!/usr/bin/env modbuild
pbuild::add_to_group 'Programming'
pbuild::prep() {
:
}
pbuild::configure() {
:
}
pbuild::compile() {
:
}
pbuild::install() {
:
}
# install with
# bash ./cuda_12.8.1_570.124.06_linux.run --silent --toolkit --installpath=/opt/psi/Programming/cuda/12.8.1/ --no-opengl-libs --no-man-page
#
pbuild::post_install() {
if [ -f "/opt/psi/Programming/cuda/${V_PKG}/lib64/stubs/libnvidia-ml.so" ]
then
if [ ! -f "/opt/psi/Programming/cuda/${V_PKG}/lib64/stubs/libnvidia-ml.so.1" ]
then
ln -s /opt/psi/Programming/cuda/$V/lib64/stubs/libnvidia-ml.so /opt/psi/Programming/cuda/${V_PKG}/lib64/stubs/libnvidia-ml.so.1
fi
fi
cd "${PREFIX}/lib64/stubs"
for lib in lib*; do
local soname="$(patchelf --print-soname "${lib}" 2>/dev/null)" || continue
if [[ ! -e "${soname}" ]]; then
ln -s "${lib}" "${soname}"
fi
done
}

View File

@@ -0,0 +1,119 @@
---
format: 1
cuda:
defaults:
group: Programming
overlay: base
relstage: stable
build_variants: first_match
build_functions:
configure: []
compile: []
install: [pbuild::post_install]
urls:
- &cuda-12_8_1-aarch64
url: https://developer.download.nvidia.com/compute/cuda/12.8.1/local_installers/cuda_12.8.1_570.124.06_linux_sbsa.run
unpacker: none
- &cuda-12_8_1-x86_64
url: https://developer.download.nvidia.com/compute/cuda/12.8.1/local_installers/cuda_12.8.1_570.124.06_linux.run
unpacker: none
- &cuda-12_2_2-aarch64
url: https://developer.download.nvidia.com/compute/cuda/12.2.2/local_installers/cuda_12.2.2_535.104.05_linux_sbsa.run
unpacker: none
- &cuda-12_2_2-x86_64
url: https://developer.download.nvidia.com/compute/cuda/12.2.2/local_installers/cuda_12.2.2_535.104.05_linux.run
unpacker: none
- &cuda-12_2_0-aarch64
url: https://developer.download.nvidia.com/compute/cuda/12.2.0/local_installers/cuda_12.2.0_535.54.03_linux_sbsa.run
unpacker: none
- &cuda-12_2_0-x86_64
url: https://developer.download.nvidia.com/compute/cuda/12.2.0/local_installers/cuda_12.2.0_535.54.03_linux.run
unpacker: none
- &cuda-12_1_1-aarch64
url: https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda_12.1.1_530.30.02_linux_sbsa.run
unpacker: none
- &cuda-12_1_1-x86_64
url: https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda_12.1.1_530.30.02_linux.run
unpacker: none
shasums:
cuda_12.8.1_570.124.06_linux.run: 228f6bcaf5b7618d032939f431914fc92d0e5ed39ebe37098a24502f26a19797
cuda_12.8.1_570.124.06_linux_sbsa.run: 353cbab1b57282a1001071796efd95c1e40ec27a3375e854d12637eaa1c6107c
cuda_12.2.2_535.104.05_linux.run: 2b39aae3e7618d9f59a3c8fa1f1bc61f29c0b0e0df75fb05076badb352952ef2
cuda_12.2.2_535.104.05_linux_sbsa.run: 4113a15e6b27a02638c72edeb5f89de4c9ea312febba12fc4cefff2edc882268
cuda_12.2.0_535.54.03_linux.run: ecf3d2afadcbac029f0f4505785810d52d006e4b87ba79ff3f984336a2bbf518
cuda_12.2.0_535.54.03_linux_sbsa.run: 9c90d79bb63952cd30f1f57f9f8fe11e7a8967bba6f824df45d3464b5d37e5d8
cuda_12.1.1_530.30.02_linux.run: d74022d41d80105319dfa21beea39b77a5b9919539c0487a05caaf2446d6a70e
cuda_12.1.1_530.30.02_linux_sbsa.run: 45ea4cd860f0a26d3db8ce032530f2ee0b55abdd587545213d395a73623b4278
versions:
12.8.1:
variants:
- target_cpus: [aarch64]
systems: [gpu.*.merlin7.psi.ch]
relstage: unstable
overlay: PSI
urls:
- *cuda-12_8_1-aarch64
- target_cpus: [x86_64]
systems: [.*.merlin7.psi.ch]
relstage: unstable
overlay: PSI
urls:
- *cuda-12_8_1-x86_64
- target_cpus: [x86_64]
relstage: stable
urls:
- *cuda-12_8_1-x86_64
12.2.2:
variants:
- target_cpus: [aarch64]
systems: [gpu.*.merlin7.psi.ch]
relstage: stable
overlay: PSI
urls:
- *cuda-12_2_2-aarch64
- target_cpus: [x86_64]
systems: [.*.merlin7.psi.ch]
relstage: stable
overlay: PSI
urls:
- *cuda-12_2_2-x86_64
- target_cpus: [x86_64]
relstage: stable
urls:
- *cuda-12_2_2-x86_64
12.2.0:
variants:
- target_cpus: [aarch64]
systems: [gpu.*.merlin7.psi.ch]
urls:
- *cuda-12_2_0-aarch64
- target_cpus: [x86_64]
systems: [.*.merlin7.psi.ch]
overlay: PSI
urls:
- *cuda-12_2_0-x86_64
- target_cpus: [x86_64]
urls:
- *cuda-12_2_0-x86_64
12.1.1:
variants:
- target_cpus: [aarch64]
systems: [gpu.*.merlin7.psi.ch]
overlay: PSI
relstage: unstable
urls:
- *cuda-12_1_1-aarch64
- target_cpus: [x86_64]
systems: [.*.merlin7.psi.ch]
overlay: PSI
urls:
- *cuda-12_1_1-x86_64
- target_cpus: [x86_64]
urls:
- *cuda-12_1_1-x86_64

View File

@@ -13,15 +13,12 @@ harnessing the power of the graphics processing unit (GPU).
prepend-path CUDA_PATH "$PREFIX"
# libnvidia-ml.so in GDK package is a stub library that is attached only for build purposes
prepend-path LIBRARY_PATH "$PREFIX/lib64/stubs"
prepend-path LIBRARY_PATH "$PREFIX/targets/x86_64-linux/lib/stubs"
if {[catch {exec /usr/sbin/modinfo -d nvidia} result]} {
# add if the module is *not* loaded => we are on a system without GPU
prepend-path LIBRARY_PATH "$PREFIX/lib64/stubs"
prepend-path LD_LIBRARY_PATH "$PREFIX/lib/stubs"
}
prepend-path C_INCLUDE_PATH "$PREFIX/targets/x86_64-linux/include"
prepend-path CPLUS_INCLUDE_PATH "$PREFIX/targets/x86_64-linux/include"
# We should always run with libnvidia-ml.so that is installed with your NVIDIA Display Driver.
# By default it's installed in /usr/lib and /usr/lib64.
# Therefore, LD_LIBRARY_PATH must not contain any libnvidia-ml.so reference in the GDK package
# prepend-path LD_LIBRARY_PATH "$PREFIX/lib/stubs"
# prepend-path LD_LIBRARY_PATH "$PREFIX/targets/x86_64-linux/lib/stubs"