# GPU not used Ray 2.7.1

**URL:** <https://discuss.ray.io/t/gpu-not-used-ray-2-7-1/12514>\
**Category:** Uncategorized\
**Created:** [October 19, 2023, 8:19am UTC](https://discuss.ray.io/t/gpu-not-used-ray-2-7-1/12514 "2023-10-19T08:19:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![d31fs0m](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@d31fs0m](https://discuss.ray.io/u/d31fs0m)\
**Post date:** [October 19, 2023, 8:19am UTC](https://discuss.ray.io/t/gpu-not-used-ray-2-7-1/12514/1 "2023-10-19T08:19:31Z")

</div>

Hi everyone,

I worked with Ray 2.4.0 to run my RL code. Everything worked fine. Below is a toy example to show how I use Ray.  
The problem is that after I upgraded to Ray 2.7.1 the GPU is not used anymore. When I run the toy example with version 2.4.0 the trial status and the Ray Dashboard show that the GPU is used. On version 2.7.1 that is not the case. The code runs without error but only on CPUs.  
Is there an additional configuration in version 2.7.1 that I have to set? Or something else I forgot to consider?

Thank you in advance!

```auto
import ray
from ray.rllib.algorithms.ppo import PPOConfig, PPO
from ray.air import RunConfig
from ray import tune

config = PPOConfig()
config.framework(framework='torch')
config.resources(num_gpus=1)
config.environment(env="CartPole-v1")
config.training(lr=tune.grid_search([5e-05, 4e-05]))

ray.init()
tuner = tune.Tuner(
    trainable=PPO,
    param_space=config.to_dict(),
    run_config=RunConfig(stop=tune.stopper.MaximumIterationStopper(5))
)
tuner.fit()
ray.shutdown()

```

I work with Windows 11, NVIDIA GeForce RTX 3080 Ti, PyTorch 2.1.0, CUDA 12.1

---

<div class="post-metadata">

**Author:** ![PhilippWillms](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/philippwillms/32/3885_2.png) [@PhilippWillms](https://discuss.ray.io/u/PhilippWillms)\
**Post date:** [November 5, 2023, 4:31pm UTC](https://discuss.ray.io/t/gpu-not-used-ray-2-7-1/12514/2 "2023-11-05T16:31:25Z")

</div>

Have a look at Resource specifications for tune. They work a bit differently that for the RLModule or Algo API.
