GPU Jobs
To make use of a GPU you need to submit a job request specifying the gpu partition and the number of gpus you require with the --gpus=<number> argument.
sbatch -p gpu --gpus=1 --account=<GroupName> ... srun -p gpu --gpus=1 --account=<GroupName> ...NOTE: Ensure you use the lowercase version of your GroupName. For example instead of using Pro0012345 you should use pro0012345. Otherwise you may receive an error like srun: error: Your account (Pro0012345) does not have permission to use partition gpu. The logic that verifies gpu access requires a lowercase Slurm Account name.
Example Interactive GPU Job
The following commands show how to start an interactive job with gpu support and run the nvidia-smi command.
Start Interactive Job
The following command will start an interactive job running on a gpu node requesting 1 GPU.
srun --pty --account=<GroupName> -p gpu --gpus=1 bashThe above command starts a job with the CUDA_VISIBLE_DEVICES environment variable will be set to the allocated GPUs. This environment variable allows programs to determine which of the available GPUs to use.
Run gpu-enabled command
nvidia-smiExit Interactive Job
exit
Next: Software