Skip to content

Fix ray import error when both ROCR_VISIBLE_DEVICES and HIP_VISIBLE_DEVICES are set - #53757

Merged
jjyao merged 3 commits into
ray-project:masterfrom
2niuhe:rocm_env_fix
Jun 20, 2025
Merged

jjyao merged 3 commits into
ray-project:masterfrom
2niuhe:rocm_env_fix

Conversation

@2niuhe

@2niuhe 2niuhe commented Jun 12, 2025

Copy link
Copy Markdown
Contributor

Why are these changes needed?

When both ROCR_VISIBLE_DEVICES=0 and HIP_VISIBLE_DEVICES=0 are set (as default settings added to .bashrc during ROCm installation), importing ray in Python 3.11.12 results in a RuntimeError indicating that HIP_VISIBLE_DEVICES should be used instead of ROCR_VISIBLE_DEVICES.

Expected Behavior:
Ray should ignore ROCR_VISIBLE_DEVICES if HIP_VISIBLE_DEVICES is set

Related issue number

#53737

Checks

@vickytsang

Copy link
Copy Markdown
Contributor

@2niuhe This looks good. The runtime error was added to mitigate an issue with Pytorch which has been resolved by pytorch/pytorch#144026.

cc: @jjyao @kevin85421

@kevin85421 kevin85421 added the go add ONLY when ready to merge, run all tests label Jun 18, 2025
@kevin85421

Copy link
Copy Markdown
Member

@2niuhe please ping me when all CI tests pass.

@jjyao

jjyao commented Jun 18, 2025

Copy link
Copy Markdown
Contributor

@vickytsang for review

@2niuhe

2niuhe commented Jun 19, 2025

Copy link
Copy Markdown
Contributor Author

@kevin85421 All CI tests have passed. Please review.

@jjyao
jjyao merged commit d1c665e into ray-project:master Jun 20, 2025
minerharry pushed a commit to minerharry/ray that referenced this pull request Jun 27, 2025
elliot-barn pushed a commit that referenced this pull request Jul 2, 2025
…SIBLE_DEVICES are set (#53757)

Signed-off-by: 2niuhe <[email protected]>
Signed-off-by: niu_he <[email protected]>
Signed-off-by: elliot-barn <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants