#!/bin/bash #SBATCH -c 8 # number of cores, here are 8 requested. #SBATCH --gres=gpu:1 # number of gpus, here is 1 requested. #SBATCH --mail-type=END,FAIL # email status changes # diagnostic information # display node name echo "nodename :" hostname # check if gpu are assigned, if not create empty list if [ -z "$CUDA_VISIBLE_DEVICES" ]; then export CUDA_VISIBLE_DEVICES="" fi # display which gpu's we are allowed to use echo "CUDA_VISIBLE_DEVICES = '"$CUDA_VISIBLE_DEVICES"'" # load nvidia cuda toolkit(s) module load nvidia/cuda-11.3 module load nvidia/cuda-11.3_cudnn-8.2 module load nvidia/cuda-11.3_tensorrt-8.0 # run tensorflow echo "Starting Tensorflow: " python3 mycode.py