# How to enable custom Gym environment access GPUs?

**URL:** <https://discuss.ray.io/t/how-to-enable-custom-gym-environment-access-gpus/12296>\
**Category:** RLlib\
**Created:** [September 29, 2023, 4:13am UTC](https://discuss.ray.io/t/how-to-enable-custom-gym-environment-access-gpus/12296 "2023-09-29T04:13:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravlur](https://avatars.discourse-cdn.com/v4/letter/r/58956e/32.png) [@ravlur](https://discuss.ray.io/u/ravlur)\
**Post date:** [September 29, 2023, 4:13am UTC](https://discuss.ray.io/t/how-to-enable-custom-gym-environment-access-gpus/12296/1 "2023-09-29T04:13:14Z")

</div>

**How severe does this issue affect your experience of using Ray?**

- Medium: It contributes to significant difficulty in completing my task, but I can work around it.

Hi, I have a custom Gym environment defined which needs access to GPUs as the reward function is estimated by a pre-trained model. How can I go about doing this in RLlib? I think this is a pretty common need but I’ve not been able to find any resource to do this.

I’ve tried to use @ray.remote but it throws up errors. Any help is appreciated.

Thanks!
