According to this documentation, HIP_VISIBLE_DEVICES environment variable should have the same effect. So:
HIP_VISIBLE_DEVICES
os.environ["HIP_VISIBLE_DEVICES"]="0"