Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:15:48

0001 #!/bin/bash
0002 
0003 LOCALTOP=$1
0004 DEVICE=$2
0005 
0006 # the test is not possible if:
0007 
0008 # 1. GPU not available (only if GPU test requested) / avx instructions not supported (needed for singularity on CPU)
0009 # 1b. Nvidia drivers not available
0010 # 2. wrong architecture (not amd64)
0011 # 3. apptainer/singularity not found or not usable
0012 # 4. inside apptainer/singularity container w/o unprivileged user namespace enabled (needed for nested containers)
0013 # so just return true in those cases
0014 
0015 if [ "$DEVICE" = "GPU" ]; then
0016         if nvidia-smi -L; then
0017                 echo "has GPU"
0018         else
0019                 echo "missing GPU"
0020                 exit 0
0021         fi
0022 
0023         if cmsTriton check; then
0024                 echo "has NVIDIA driver"
0025         else
0026                 echo "missing current or compatible NVIDIA driver"
0027                 exit 0
0028         fi
0029 else
0030         if grep -q avx /proc/cpuinfo; then
0031                 echo "has avx"
0032         else
0033                 echo "missing avx"
0034                 exit 0
0035         fi
0036 fi
0037 
0038 THIS_ARCH=$(echo $SCRAM_ARCH | cut -d'_' -f2)
0039 if [ "$THIS_ARCH" == "amd64" ]; then
0040         echo "has amd64"
0041 else
0042         echo "missing amd64"
0043         exit 0
0044 fi
0045 
0046 if ! apptainer-check.sh; then
0047         echo "missing apptainer/singularity or missing unprivileged user namespace support"
0048         exit 0
0049 fi
0050 
0051 fallbackName=triton_server_instance_${DEVICE}
0052 tmpFile=$(mktemp -p ${LOCALTOP} SonicTritonTestXXXXXXXX.log)
0053 cmsRun ${LOCALTOP}/src/HeterogeneousCore/SonicTriton/test/tritonTest_cfg.py --modules TritonGraphProducer TritonGraphFilter TritonGraphAnalyzer --maxEvents 2 --unittest --verbose --device ${DEVICE} --testother --fallbackName ${fallbackName} >& $tmpFile
0054 CMSEXIT=$?
0055 
0056 cat $tmpFile
0057 
0058 if grep -q "Socket closed" $tmpFile; then
0059         echo "Transient server error (not caused by client code)"
0060         CMSEXIT=0
0061 fi
0062 
0063 rm $tmpFile
0064 exit $CMSEXIT