GPU not used Ray 2.7.1

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!

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

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