Recognize 2 CPUS

This is for discussing general topics about how to use VirtualBox.
Post Reply
JCollins
Posts: 6
Joined: 22. Jul 2017, 13:44

Recognize 2 CPUS

Post by JCollins »

Hello to all.

I have a PC Intel with 2 processors and 22 cores per processor. I have a CentOS installed as a guest. When I configure the processor can I choose up to a maximum of 32 CPUs. Assuming that with two processors i have 44 cores, how do I get it to Virtualbox use the two processors?

Thanks in advance.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Recognize 2 CPUS

Post by mpack »

What is the exact processor part number?
JCollins
Posts: 6
Joined: 22. Jul 2017, 13:44

Re: Recognize 2 CPUS

Post by JCollins »

I have 2 processors with 22 cores
Attachments
WhatsApp Image 2017-09-02 at 10.43.07.jpeg
WhatsApp Image 2017-09-02 at 10.43.07.jpeg (60.45 KiB) Viewed 2069 times
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Recognize 2 CPUS

Post by mpack »

I see, well the E5-2699v4 does indeed seem to have 22 cores. Giving you 44 cores total.

As to the limit. The user manual says this:
VBox User Manual s3.4.2 wrote: On the "Processor" tab, you can set how many virtual CPU cores the guest operating systems should see. Starting with version 3.0, VirtualBox supports symmetrical multiprocessing (SMP) and can present up to 32 virtual CPU cores to each virtual machine.
So for the moment you'll have to make do with 32 cores max.

I assume you're aware that giving the VM more cores than it actually uses will slow the VM down, not speed it up, because VirtualBox still has to do a full context switch for idle cores.
JCollins
Posts: 6
Joined: 22. Jul 2017, 13:44

Re: Recognize 2 CPUS

Post by JCollins »

Ok, I understand that I have 22 cores and therefore 44 Threads. I also understand that Virtualbox only allows me to have up to 32 cores.

The doubt is that I have 2 processors, therefore there are 44 cores and 88 Threads. If Virtualbox allows me to have 32 cores, how can i do to have 16 cores of a processor and 16 other processor?

Attached also another image in which you see that only I get a CPU in green. Why can this be?
Attachments
WhatsApp Image 2017-09-03 at 12.57.58.jpeg
WhatsApp Image 2017-09-03 at 12.57.58.jpeg (109.75 KiB) Viewed 2039 times
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Recognize 2 CPUS

Post by mpack »

That is not how it works. VirtualBox lets you assign up to 32 cores to a VM, period. AFAIK VirtualBox doesn't know or care what hardware those cores are distributed over.
JCollins
Posts: 6
Joined: 22. Jul 2017, 13:44

Re: Recognize 2 CPUS

Post by JCollins »

Thank you so much for your help.

One more question. I have another VM, also with 22 cores. I have launched a job parallelized with 16 cores in a VM and 16 in another, but it goes much slower than if I launch it in a single VM. Is it possible to scale parallelizing jobs between several VM's?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Recognize 2 CPUS

Post by mpack »

I'm afraid that's something you'd have to ask on the dev mailing list. I have a quad core host, so I have no way to test an answer to that question.

Every time VirtualBox does a "world switch" i.e. between VM and host, it has to do a complete context restore of every core. This is relatively slow so you should avoid paying this penalty for idle cores. I'm not at all sure how much context preservation goes on when you switch between VMs, and in fact I'm not sure that VirtualBox actually does switch between VMs (i.e. does it switch back to host first? that would double the context switching required). The devs would be the ones to answer such questions.
Post Reply