From ef76df3a07c53657c425850338443a470d2a6d07 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Thu, 21 Nov 2024 15:37:15 +0100 Subject: [PATCH 1/3] cuda: review and YAML config file --- Programming/cuda/build | 32 +++------- Programming/cuda/files/config.yaml | 95 ++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+), 25 deletions(-) create mode 100644 Programming/cuda/files/config.yaml diff --git a/Programming/cuda/build b/Programming/cuda/build index 417baa6..b04936f 100755 --- a/Programming/cuda/build +++ b/Programming/cuda/build @@ -1,29 +1,11 @@ #!/usr/bin/env modbuild -pbuild::add_to_group 'Programming' - -pbuild::prep() { - : -} - -pbuild::configure() { - : -} - -pbuild::compile() { - : -} - -pbuild::install() { - : -} - 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 } diff --git a/Programming/cuda/files/config.yaml b/Programming/cuda/files/config.yaml new file mode 100644 index 0000000..1afd260 --- /dev/null +++ b/Programming/cuda/files/config.yaml @@ -0,0 +1,95 @@ +--- +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_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.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.2.2: + variants: + - target_cpus: [aarch64] + systems: [gpu.*.merlin7.psi.ch] + relstage: unstable + overlay: PSI + urls: + - *cuda-12_2_2-aarch64 + - target_cpus: [x86_64] + systems: [.*.merlin7.psi.ch] + relstage: unstable + overlay: PSI + urls: + - *cuda-12_2_2-x86_64 + - target_cpus: [x86_64] + relstage: unstable + urls: + - *cuda-12_2_2-x86_64 + + 12.2.0: + variants: + - target_cpus: [aarch64] + systems: [gpu.*.merlin7.psi.ch] + relstage: unstable + urls: + - *cuda-12_2_0-aarch64 + - target_cpus: [x86_64] + systems: [.*.merlin7.psi.ch] + relstage: unstable + overlay: PSI + urls: + - *cuda-12_2_0-x86_64 + - target_cpus: [x86_64] + relstage: unstable + 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 From c9bda4b5eee43673754a81156f9b35066bc211a1 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Fri, 22 Nov 2024 10:44:34 +0100 Subject: [PATCH 2/3] cuda: set library pathes on non-gpu systems --- Programming/cuda/modulefile | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Programming/cuda/modulefile b/Programming/cuda/modulefile index b626491..69c68ce 100644 --- a/Programming/cuda/modulefile +++ b/Programming/cuda/modulefile @@ -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" From 20f9945dbb27b3767f0b9d2d29b0ea945bde9e51 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Thu, 13 Mar 2025 10:23:47 +0100 Subject: [PATCH 3/3] cuda: new versions and YAML config --- Programming/cuda/build | 3 +++ Programming/cuda/files/config.yaml | 38 ++++++++++++++++++++++++------ 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/Programming/cuda/build b/Programming/cuda/build index b04936f..9684585 100755 --- a/Programming/cuda/build +++ b/Programming/cuda/build @@ -1,5 +1,8 @@ #!/usr/bin/env modbuild +# 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() { cd "${PREFIX}/lib64/stubs" for lib in lib*; do diff --git a/Programming/cuda/files/config.yaml b/Programming/cuda/files/config.yaml index 1afd260..8e03246 100644 --- a/Programming/cuda/files/config.yaml +++ b/Programming/cuda/files/config.yaml @@ -11,7 +11,14 @@ cuda: compile: [] install: [pbuild::post_install] urls: - - &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 + - &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 @@ -30,6 +37,8 @@ cuda: 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 @@ -38,22 +47,40 @@ cuda: cuda_12.1.1_530.30.02_linux_sbsa.run: 45ea4cd860f0a26d3db8ce032530f2ee0b55abdd587545213d395a73623b4278 versions: - 12.2.2: + 12.8.1: variants: - target_cpus: [aarch64] systems: [gpu.*.merlin7.psi.ch] relstage: unstable overlay: PSI urls: - - *cuda-12_2_2-aarch64 + - *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: unstable + relstage: stable urls: - *cuda-12_2_2-x86_64 @@ -61,17 +88,14 @@ cuda: variants: - target_cpus: [aarch64] systems: [gpu.*.merlin7.psi.ch] - relstage: unstable urls: - *cuda-12_2_0-aarch64 - target_cpus: [x86_64] systems: [.*.merlin7.psi.ch] - relstage: unstable overlay: PSI urls: - *cuda-12_2_0-x86_64 - target_cpus: [x86_64] - relstage: unstable urls: - *cuda-12_2_0-x86_64