revert select_device#9559
Conversation
There was a problem hiding this comment.
Code Review
This pull request replaces the custom select_device utility with direct assignments to os.environ['CUDA_VISIBLE_DEVICES'] across numerous test files. The review feedback identifies several key improvement opportunities: first, CUDA_VISIBLE_DEVICES should be set before importing torch to avoid premature CUDA initialization; second, environment variables should be set at the module level rather than inside if __name__ == '__main__': blocks so they are properly configured when run via test runners like pytest; and third, using os.environ.setdefault is recommended to allow command-line overrides in local or CI/CD environments.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Pre-initializing CUDA causes environment variables to become ineffective.