# Ray not scaling over multiple GPU in the same node

**URL:** https://discuss.ray.io/t/ray-not-scaling-over-multiple-gpu-in-the-same-node/14196
**Category:** Configure Algorithm, Training, Evaluation, Scaling
**Created:** [March 29, 2024, 4:24am UTC](https://discuss.ray.io/t/ray-not-scaling-over-multiple-gpu-in-the-same-node/14196 "2024-03-29T04:24:04Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Abhay\_Goyal](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/abhay_goyal/32/5121_2.png) [@Abhay\_Goyal](https://discuss.ray.io/u/Abhay_Goyal)
#### Post date: [March 29, 2024, 4:24am UTC](https://discuss.ray.io/t/ray-not-scaling-over-multiple-gpu-in-the-same-node/14196/1 "2024-03-29T04:24:04Z")

</div>

Hi,  
I am currently working on using SAC for my work and have a GPU node with 4 GPUs in it. But, when I run my code (below), it does not seem to scale.

Could you please tell why?

```auto
ray.init(num_gpus=4)
config = SACConfig().training(gamma=0.9, lr=0.01, train_batch_size=64)

config = config.resources(
  num_gpus_per_learner_worker=1, 
  num_learner_workers=torch.cuda.device_count())

# config = config.resources(num_gpus=torch.cuda.device_count())
config = config.rollouts(num_rollout_workers=100)

# Build a Algorithm object from the config and run 1 training iteration.
algo = config.build(env= MineEnv200x150)
algo.train(num_workers=100, use_gpu=True)
# model = ray.train.torch.prepare_model(model)

```

Here, MineEnv200x150 is my custom environment for a single agent. The program executes but does not scale over multiple GPUs.
