8000 Fix ray import error when both ROCR_VISIBLE_DEVICES and HIP_VISIBLE_DEVICES are set by 2niuhe · Pull Request #53757 · ray-project/ray · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 20, 2025

Conversation

2niuhe
Copy link
Contributor
@2niuhe 2niuhe commented Jun 12, 2025

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

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

…EVICES are set

Signed-off-by: 2niuhe <carlton2tang@gmail.com>
@vickytsang
Copy link
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
Member

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

@jjyao
Copy link
Collaborator
jjyao commented Jun 18, 2025

@vickytsang for review

@2niuhe
Copy link
Contributor Author
2niuhe commented Jun 19, 2025

@kevin85421 All CI tests have passed. Please review.

2niuhe added 2 commits June 20, 2025 12:42
Signed-off-by: niu_he <carlton2tang@gmail.com>
Signed-off-by: niu_he <carlton2tang@gmail.com>
@jjyao jjyao merged commit d1c665e into ray-project:master Jun 20, 2025
5 checks passed
minerharry pushed a commit to minerharry/ray that referenced this pull request Jun 27, 2025
…SIBLE_DEVICES are set (ray-project#53757)

Signed-off-by: 2niuhe <carlton2tang@gmail.com>
Signed-off-by: niu_he <carlton2tang@gmail.com>
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
0