From 16dc7b316560037dc353673f68b6be09eb22228f Mon Sep 17 00:00:00 2001 From: caubet_m Date: Mon, 23 May 2022 16:37:32 +0200 Subject: [PATCH] Fix libnvidia-ml --- Programming/cuda/build | 9 +++++++++ Programming/cuda/modulefile | 10 ++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Programming/cuda/build b/Programming/cuda/build index c727b69..417baa6 100755 --- a/Programming/cuda/build +++ b/Programming/cuda/build @@ -18,3 +18,12 @@ 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 +} diff --git a/Programming/cuda/modulefile b/Programming/cuda/modulefile index 0db4a07..07b2aed 100644 --- a/Programming/cuda/modulefile +++ b/Programming/cuda/modulefile @@ -11,6 +11,12 @@ by NVIDIA. It enables dramatic increases in computing performance by harnessing the power of the graphics processing unit (GPU). " -prepend-path LIBRARY_PATH "$PREFIX/lib/stubs" -prepend-path LD_LIBRARY_PATH "$PREFIX/lib/stubs" 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" + +# 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 it +# prepend-path LD_LIBRARY_PATH "$PREFIX/lib/stubs"