The error occurs because Slurm requires either --gpus or --ntasks (or -n) to be specified when using --gpus-per-task or --tres-per-task. The --wrap option does not implicitly set --ntasks, so you need to explicitly define the number of tasks.
Add --ntasks=1 (or -n 1) to your command to specify that each array job should run as a single task. This resolves the validation error.
bashsbatch --array 1-2 --ntasks=1 --gpus-per-task 1 --cpus-per-task 32 --wrap 'bash -c "echo $SLURM_ARRAY_TASK_ID"'
--ntasks=1: Explicitly sets the number of tasks per job to 1, which is required when using --gpus-per-task.--gpus-per-task, --cpus-per-task, --wrap) remain unchanged.This should now submit your array job without errors.
Vibe can make mistakes. Check answers. Learn more