SOLVED Bhyve sockets, cores and thread counts

Alex98234

Dabbler
Joined
Aug 18, 2015
Messages
23
Hello FreeNAS community,

Bhyve appears to be assigning CPU cores configured in the FreeNAS VM GUI as individual CPU sockets with 1 CPU/core per socket. I have observed this problem in Windows Server 2012 R2 and Ubuntu Server 16.04.02. I am using an Intel Xeon E3-1240L v5 2.1 GHz (4 cores, 8 threads). Is this by design or is additional configuration required that is not available in the FreeNAS VM GUI?
 

Alex98234

Dabbler
Joined
Aug 18, 2015
Messages
23
Here is a snippet:
To fix this the following sysctl must be set in /boot/loader.conf (and a reboot to take effect):

hw.vmm.topology.cores_per_package=4


Here is the link to the whole article.

https://www.ateamsystems.com/tech-blog/howto-windows-10-bhyve-w-freebsd-11/

Hi Allan,

Thank you for your response. I followed the instructions and restarted my FreeNAS system but the issue remains.

Here is a screenshot after restart of my /boot/loader.conf

gubq3l8.png
 

Zwck

Patron
Joined
Oct 27, 2016
Messages
371
mhh what are the consequences of this?
 

Alex98234

Dabbler
Joined
Aug 18, 2015
Messages
23

yottabit

Contributor
Joined
Apr 15, 2012
Messages
192
In FreeNAS 11, I set this as a tunable in the Loader config. I set mine to 32, and gave the VM 16. Worked like a champ. Windows 10 only allows 2 sockets, but allows up to 256 cores per socket (x64 version). Marketing. ::eyeroll::
09b26816c3ea39a8fec7249e294ff5f7.jpg


Sent from my Pixel XL using Tapatalk
 

shamo316

Dabbler
Joined
Jun 21, 2016
Messages
30
In FreeNAS 11, I set this as a tunable in the Loader config. I set mine to 32, and gave the VM 16. Worked like a champ. Windows 10 only allows 2 sockets, but allows up to 256 cores per socket (x64 version). Marketing. ::eyeroll::
09b26816c3ea39a8fec7249e294ff5f7.jpg


Sent from my Pixel XL using Tapatalk

are you experiencing any issues with running that many cores?? my VM with 10 cores seems slow and laggy
 

yottabit

Contributor
Joined
Apr 15, 2012
Messages
192
are you experiencing any issues with running that many cores?? my VM with 10 cores seems slow and laggy
Nope, running fine. I wanted the max cores available to render living photos in Lytro Desktop. It cut the time by half compared to my 4-thread i7 NUC of higher clock speed. All 16 threads ran at 100% for 2 hours. The bhyve process was running around 1600% as you'd expect, too.

Sent from my Pixel XL using Tapatalk
 

Alex98234

Dabbler
Joined
Aug 18, 2015
Messages
23
I still can't get my cores to appear on a single socket/package. Is the cores per package sysctl set at the FreeNAS level or a VM level?
 

yottabit

Contributor
Joined
Apr 15, 2012
Messages
192
I still can't get my cores to appear on a single socket/package. Is the cores per package sysctl set at the FreeNAS level or a VM level?
Seems to be a setting for the whole host. I set mine in the tunables section of the FreeNAS 11 GUI, and rebooted just for good measure.

Sent from my Pixel XL using Tapatalk
 

Alex98234

Dabbler
Joined
Aug 18, 2015
Messages
23
Seems to be a setting for the whole host. I set mine in the tunables section of the FreeNAS 11 GUI, and rebooted just for good measure.

Sent from my Pixel XL using Tapatalk

Thank you so much! I followed your instructions and now my cores appear on a single socket/package. I was adding the tunables manually through a terminal session to /boot/loader.conf not realizing I could do it through the UI *facepalm*.
 

Peter Cheong

Cadet
Joined
Dec 20, 2018
Messages
7
In FreeNAS 11, I set this as a tunable in the Loader config. I set mine to 32, and gave the VM 16. Worked like a champ. Windows 10 only allows 2 sockets, but allows up to 256 cores per socket (x64 version). Marketing. ::eyeroll::
09b26816c3ea39a8fec7249e294ff5f7.jpg


Sent from my Pixel XL using Tapatalk


Hi,
It is great. would you mind to share with us, how you did it specifically? thanks
 

yottabit

Contributor
Joined
Apr 15, 2012
Messages
192
Add this in System -> Tunables, then reboot.

Variable: hw.vmm.topology.cores_per_package
Value: 32 (or number of cores to show per CPU socket)
Type: loader
Enabled: yes
 
Top