Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Select/Isolate GPUs when Using ROCm in Python

Is their an equivalent for os.environ["CUDA_VISIBLE_DEVICES"]="0" in the os module for isolating GPUs when using AMD ROCm?

like image 538
mmcmp Avatar asked Dec 01 '25 19:12

mmcmp


1 Answers

According to this documentation, HIP_VISIBLE_DEVICES environment variable should have the same effect. So:

os.environ["HIP_VISIBLE_DEVICES"]="0"
like image 53
mmcmp Avatar answered Dec 04 '25 08:12

mmcmp



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!