From e4ad566bd8c3da0b6bc048946540cb8458433bf5 Mon Sep 17 00:00:00 2001 From: Alexandre DEVELY <12896316+alexandredevely@users.noreply.github.com> Date: Wed, 1 May 2024 15:18:27 +0200 Subject: [PATCH] add NVIDIA_VISIBLE_DEVICES --- composer/appli-docker-entrypoint.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/composer/appli-docker-entrypoint.sh b/composer/appli-docker-entrypoint.sh index b096da4..f17efd9 100755 --- a/composer/appli-docker-entrypoint.sh +++ b/composer/appli-docker-entrypoint.sh @@ -89,6 +89,22 @@ if [ -x /usr/bin/dbus-launch ]; then fi log "end of init" +log "start nvidia settings" +if [ -d /proc/driver/nvidia ]; then + log "/proc/driver/nvidia exists" + if [ -x /usr/bin/nvidia-smi ]; then + log "command line /usr/bin/nvidia-smi found" + # Read the GPU UUID + GPU_UUID=$(nvidia-smi --query-gpu=gpu_uuid --format=csv,noheader) + log "the GPU_UUID is $GPU_UUID" + # Set NVIDIA_VISIBLE_DEVICES + export NVIDIA_VISIBLE_DEVICES=$GPU_UUID + log "NVIDIA_VISIBLE_DEVICES=$NVIDIA_VISIBLE_DEVICES" + fi +fi +echo NVIDIA_VISIBLE_DEVICES=$NVIDIA_VISIBLE_DEVICES +log "end of nvidia settings" + # change current dir to homedir # to fix ntlm_auth load for firefox on alpine distribution # firefox does not support SSO, does not execute ntlm_auth if ntlm_auth not in current dir or in $PATH