bhyve Ryzen 7 Boost

Hello,

I just installed FreeBSD 13.1 with Bhyve and vm-bhyve.
I, somehow, managed to get Windows 10 vm running ok.
My CPU is a Ryzen 7 4800U witch has 8 cores / 16 threads.
This Ryzen frequency is 1.8 GHz base and 4.2 GHz boost.
I try hard to get any boost on the Windows vm but cant manage to go past 1.8 GHz :(
Here what I put in rc.conf for power management :
performance_cpu_freq="HIGH"
powerd_enable="YES"
powerd_flags="-a adaptive -b adaptive -n adaptive"

And I issued :
sysrc performance_cx_lowest=Cmax & sysrc economy_cx_lowest=Cmax
But I cant go past 1.8 GHz at any time.
I understand it will never go to 4.2 GHz with 4 cores but it should get to 3.2 GHz (all cores) depending heat and cTDP.
Is it possible (I hope yes) and how ?
 
I changed my setup a little :
powerd_enable="YES"
powerd_flags="-a hiadaptive -b hiadaptive -n hiadaptive -m 1800 -M 4200 -i 30 -r 50"
performance_cpu_freq="NONE"
performance_cx_lowest="LOW"
economy_cpu_freq="NONE"
economy_cx_lowest="LOW"

and in loader.conf :
hint.apic.0.clock=0
hint.atrtc.0.clock=0

But so far no improvement :
sysctl dev.cpu.0.freq_levels
dev.cpu.0.freq_levels: 1800/2193 1700/1615 1400/1277

As you can see no 1801 there.
Could it be related to a bios option or that I follow Intel boost tips instead of specific AMD ?
 
Disclaimer: I have zero experience with AMD CPUs.

One thing tho: You're setting the AC mode to "(hi)adaptive" in your powerd flags.
Did you try setting it to "maximum"?
Are you actually hitting the threshold specified with the -r option?

Are you able to observe the higher boost clock within the realms of your baremetal OS (FreeBSD)? If it doesn't work there, it most likely makes no sense to investigate via the VM.
There are several stress test utilities available which you can use to run the actual tests. Some of them also provide options to stress only N amounts of cores which should allow you to more easily test the different boost clocks.
Run some tests, change ONE thing, run tests again. Changing multiple settings at once is usually not an efficient way of tuning a system.

And to round this off: Is the system appropriately cooled? What are your CPU temperatures during idle & sustained max-load?
 
I looked carefully in bios and saw only 'enable cpu boost' set to 'auto' (out of 'auto' or 'disable'). No specific other boost parameter.
I will do as you advice, try to change one thing, try to stress test the OS and then do with the next parameter.
And no, never seen boost in the OS itself so I was already in the process to get boost there and see after that in bhyve. I grab some tips to stress the cpu, all cores or one by one but didn't had time to test it.
But I'm still thinking that so long that I see max frequency level 1800/2193 and not 1801/2193 I can do whatever I want but never will get past 1800. I may be wrong here.
 
Some very basic research brings up this: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=249889

When you run your stress tests, be sure to run tests that are CPU-only. i.e. tests that do not do any I/O other than memory. Especially no filesystem I/O in case you're running ZFS as ZFS is heavily (?) multi-threaded so any filesystem I/O will likely involves multiple CPU cores "being active" which can result in turbo not reaching max frequency as it's no longer a single-core load.

I've never used this but just came across it: sysutils/turbostat.
Seems to be ported from Linux so I don't know how well it will work but maybe that helps you to further investigate.
 
Back
Top