# Ray on a local machine with 2 CPUs

**URL:** <https://discuss.ray.io/t/ray-on-a-local-machine-with-2-cpus/398>\
**Category:** Ray Core\
**Created:** [January 7, 2021, 9:36am UTC](https://discuss.ray.io/t/ray-on-a-local-machine-with-2-cpus/398 "2021-01-07T09:36:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kai2357](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/kai2357/32/223_2.png) [@Kai2357](https://discuss.ray.io/u/Kai2357)\
**Post date:** [January 7, 2021, 9:36am UTC](https://discuss.ray.io/t/ray-on-a-local-machine-with-2-cpus/398/1 "2021-01-07T09:36:04Z")

</div>

Hi, I am a mechanical engineer and using rllib for RL control of rocket engines for my phd research. I am using rllib locally on my windows machine just with ray.init() and go. We further have a workstation with 2 CPUs and on this machine ray is only using 1 CPU and the second CPU is idling. Is there an easy way to use both CPUs?

---

<div class="post-metadata">

**Author:** ![Peter\_Pirog](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/peter_pirog/32/234_2.png) [@Peter\_Pirog](https://discuss.ray.io/u/Peter_Pirog)\
**Post date:** [January 7, 2021, 1:38pm UTC](https://discuss.ray.io/t/ray-on-a-local-machine-with-2-cpus/398/2 "2021-01-07T13:38:41Z")

</div>

If you use python try at first:

> ray.init(num\_cpus=2)

Maybe this page will be useful:  
[https://docs.ray.io/en/master/rllib-training.html](https://docs.ray.io/en/master/rllib-training.html)

Peter

---

<div class="post-metadata">

**Author:** ![Kai2357](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/kai2357/32/223_2.png) [@Kai2357](https://discuss.ray.io/u/Kai2357)\
**Post date:** [January 7, 2021, 1:58pm UTC](https://discuss.ray.io/t/ray-on-a-local-machine-with-2-cpus/398/3 "2021-01-07T13:58:09Z")

</div>

Hello, thank you for your reply and your time.  
I think that by “CPUs” we mean something different.  
We have a workstation with 2 separate Intel xxxx CPUs with 18 cores each.

Now if I use ray.init as before, ray.available\_resources tells me that I have 36 cores. But if I spawn e.g. a RL training with Tune, I can only use the 18 cores of the first processor. The second one is simply chilling and noot motivated to work:D

---

<div class="post-metadata">

**Author:** ![sangcho](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sangcho/32/425_2.png) [@sangcho](https://discuss.ray.io/u/sangcho)\
**Post date:** [January 7, 2021, 10:38pm UTC](https://discuss.ray.io/t/ray-on-a-local-machine-with-2-cpus/398/4 "2021-01-07T22:38:28Z")

</div>

This sounds definitely weird. Is it possible to create a script (self-running script so that I can try) that can reproduce the issue?

---

<div class="post-metadata">

**Author:** ![sangcho](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sangcho/32/425_2.png) [@sangcho](https://discuss.ray.io/u/sangcho)\
**Post date:** [January 7, 2021, 10:38pm UTC](https://discuss.ray.io/t/ray-on-a-local-machine-with-2-cpus/398/5 "2021-01-07T22:38:49Z")

</div>

It will be great if you can create an issue to our Github issue [Issues · ray-project/ray · GitHub](https://github.com/ray-project/ray/issues)

---

<div class="post-metadata">

**Author:** ![Kai2357](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/kai2357/32/223_2.png) [@Kai2357](https://discuss.ray.io/u/Kai2357)\
**Post date:** [February 17, 2021, 11:28am UTC](https://discuss.ray.io/t/ray-on-a-local-machine-with-2-cpus/398/6 "2021-02-17T11:28:07Z")

</div>

Thank you for your time. I finally created the issue on Github

> <https://github.com/ray-project/ray/issues/14153>
>
> Hi, I am using RLlib for RL control of rocket engines for my PhD research. I am using rllib locally on...
