GPUs are a type of resource only available on GPU capable nodes (the gpu partition). They are reserved using the –gres parameter. For example, the command below can be used to request an interactive node with 2 cores and access to one of the GPUs available on that node.
srun --partition gpu --ntasks 1 --nodes 1 --cpus-per-task 2 --gres=gpu:1 --pty /bin/bash
Note that if you want a gpu processor, you must explicitly request it with a gres option. If you request a gpu node without also including a gres parameter, you'll be allocated access to only the cpu cores on the gpu node.