From 454cbd7ef787433b4ad8fb6514205361458f5694 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jens=20Henrik=20G=C3=B6bbert?= <goebbert1@jwlogin23.juwels>
Date: Thu, 31 Mar 2022 17:55:21 +0200
Subject: [PATCH] unload mpi-settings for CUDA if no GPU

---
 bin/launch_paraview.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/bin/launch_paraview.sh b/bin/launch_paraview.sh
index c37ed74..486ce2d 100755
--- a/bin/launch_paraview.sh
+++ b/bin/launch_paraview.sh
@@ -19,11 +19,19 @@ NVGPU=$(lspci -nnk | grep -i nvidia | grep -i "in use" | cut -d ' ' -f 5)
 if [ -S /tmp/.X11-unix/X0 ] && [ ! -z "${NVGPU}" ]; then
   echo >&2 "         -- hardware accelerated"
 
+  # ensure we use CUDA
+  module load mpi-settings/CUDA
+
   module load VirtualGL
   vglrun +v -d :0 paraview --mpi
 
 else
   echo >&2 "         -- software rendering"
+
+  # ensure we do not try to use CUDA
+  module load UCX-settings/RC
+  module load mpi-settings/UCX
+
   paraview --mpi
 fi
 
-- 
GitLab