I am trying to use task spooler to schedule CI/CD testing tasks for a CUDA project. The system contains multiple GPUs, and a single task uses most of the memory of one GPU, so I want to avoid giving a single GPU multiple tasks. tsp allows "MULTI-SLOT" mode, where it can have multiple active slots that can pull from the queue, rather than just one. However, I so far see no way for the task itself to deduce which slot it has been assigned, which means that I don't know which GPU to run the task on. I could check with something like nvidia-smi which GPUs are being utilized, but that might cause race conditions if multiple items are pulled from the queue in a small amount of time.
Is there a way to deduce this slot number, or send it to the process somehow?