Feedback [ + ]
Using GPUs on Roar Collab
GPUs are available on RC to users that are added to paid GPU compute accounts. To use GPUs, add the --gpus
resource directive:
#!/bin/bash
#SBATCH --job-name=apythonjob # give the job a name
#SBATCH --account=<gpu_acct> # specify the account
#SBATCH --partition=sla-prio # specify the partition
#SBATCH --nodes=1 # request a node
#SBATCH --ntasks=1 # request a task / cpu
#SBATCH --mem=1G # request the memory required per node
#SBATCH --gpus=1 # request a gpu
#SBATCH --time=00:01:00 # set a limit on the total run time
python pyscript.py
Only software that has been explicitly written to run on GPUs can take advantage of GPUs. Adding the --gpus
option to a Slurm script for a CPU-only program will not speed up the execution time and will just waste resources and increase the queue time. Furthermore, some codes are only written to use a single GPU, so avoid requesting multiple GPUs unless the program can use them.