oat
oat copied to clipboard
Fix: Properly Respect CUDA_VISIBLE_DEVICES Setting
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 Thanks for spotting the issue and suggest the fix!
- 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--collocateis set. - Please run
make formatto align the code format so that it looks nicer.