# Run DD-PPO in multiple GPUs

**URL:** <https://discuss.ray.io/t/run-dd-ppo-in-multiple-gpus/2563>\
**Category:** RLlib\
**Created:** [June 17, 2021, 10:47pm UTC](https://discuss.ray.io/t/run-dd-ppo-in-multiple-gpus/2563 "2021-06-17T22:47:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fot](https://avatars.discourse-cdn.com/v4/letter/f/b2d939/32.png) [@Fot](https://discuss.ray.io/u/Fot)\
**Post date:** [June 17, 2021, 10:47pm UTC](https://discuss.ray.io/t/run-dd-ppo-in-multiple-gpus/2563/1 "2021-06-17T22:47:31Z")

</div>

Hi all!

I am trying to run the DD-PPO algorithm, providing 1 GPU/worker, using this configuration file:  
[https://github.com/ray-project/ray/blob/master/rllib/tuned\_examples/ppo/atari-ddppo.yaml](https://github.com/ray-project/ray/blob/master/rllib/tuned_examples/ppo/atari-ddppo.yaml)  
I have a machine with 4 GPUs, thus I set num\_workers: 4.

The problem is, that all 4 workers use 1 GPU, instead of using 1 each.  
When I print the resources for the workers, I get the following output for each of them:

{‘CPU\_group\_05d7394261ee785f26194bc7e08bb664’: [(0, 1.0)], ‘GPU\_group\_05d7394261ee785f26194bc7e08bb664’: [(0, 1.0)]}

I understand that Ray then sets CUDA\_VISIBLE\_DEVICES=0 for all workers, and this might be why they all use GPU 0.

Why is the GPU\_group showing always GPU 0, for each worker? Is this expected behavior?

Thanks!

---

<div class="post-metadata">

**Author:** ![michaelzhiluo](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@michaelzhiluo](https://discuss.ray.io/u/michaelzhiluo)\
**Post date:** [July 1, 2021, 7:31am UTC](https://discuss.ray.io/t/run-dd-ppo-in-multiple-gpus/2563/2 "2021-07-01T07:31:20Z")

</div>

Yes, this is expected behavior. It is the models that get distributed across GPUs.

---

<div class="post-metadata">

**Author:** ![jiyoonlim123](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/jiyoonlim123/32/1560_2.png) [@jiyoonlim123](https://discuss.ray.io/u/jiyoonlim123)\
**Post date:** [September 30, 2021, 3:39am UTC](https://discuss.ray.io/t/run-dd-ppo-in-multiple-gpus/2563/3 "2021-09-30T03:39:33Z")

</div>

Then, how to distribute multiple workers to multiple GPUs?
