oat icon indicating copy to clipboard operation
oat copied to clipboard

Fix: Properly Respect CUDA_VISIBLE_DEVICES Setting

Open LeonGuertler opened this issue 1 year ago • 1 comments

This ensures that setting CUDA_VISIBLE_DEVICES correctly restricts execution to the specified GPU. Previously, even when assigning a specific GPU ID (e.g., CUDA_VISIBLE_DEVICES=1), the code would still run on gpu:0. This fix ensures that the selected GPU is properly honored.

✅ Tested on a single-GPU setup – this allows running multiple experiments in parallel across different GPUs. ⚠️ Multi-GPU setups haven't been tested yet.

LeonGuertler avatar Apr 24 '25 03:04 LeonGuertler

@LeonGuertler Thanks for spotting the issue and suggest the fix!

  1. Could you also consider multi-gpu cases, where e.g., the user specify CUDA_VISIBLE_DEVICES="4,5,6,7", so the actors should take devices 4,5 and learners take devices 6,7 (without --collocate), or both actors and learners take devices 4,5,6,7 if --collocate is set.
  2. Please run make format to align the code format so that it looks nicer.

lkevinzc avatar Apr 24 '25 15:04 lkevinzc