Opened 8 years ago
Last modified 7 years ago
#15774 new defect
VirtualBox incorrectly counts processors on AMD products
Reported by: | Kriston | Owned by: | |
---|---|---|---|
Component: | other | Version: | VirtualBox 5.1.2 |
Keywords: | Cc: | ||
Guest type: | Linux | Host type: | Windows |
Description
VirtualBox incorrectly counts processors on AMD products. I have an AMD CPU with 8 physical processors. This processor has 8 full processor cores. Evidently, VirtualBox assumes this processor is an Intel product with Hyper-Threading, but this assumption is not correct.
Attachments (1)
Change History (11)
by , 8 years ago
Attachment: | virtualbox-processor-count-bug.png added |
---|
comment:1 by , 8 years ago
Replying to Kriston:
I have an AMD CPU with 8 physical processors.
Model? Remember that AMD is being sued for lying about this very issue, so I wouldn't be 100% sure.
From ArsTechnica's article on 2015-11-06:
A class action lawsuit has been filed against chip-maker AMD for allegedly tricking consumers into buying its Bulldozer processors by overstating the number of cores contained in the chips. The suit claims that while Bulldozer was advertised as having eight cores, functionally it actually only had four.
comment:2 by , 8 years ago
Thanks socratis.
VirtualBox uses a Windows function to determine the number of physical processor cores. It is known that Microsoft and AMD disagree on the definition of processor cores.
comment:3 by , 8 years ago
Unfortunately the information posted by @socratis and @frank are flawed and I will explain why in the following paragraphs. I will also put empirical proof, clearly showing, why it is better to use the core count given by AMD. If you want to counter-argue this, please provide solid facts with numbers clearly showing why and how one gets better results/performance by using number of modules as number of cores. To be fair, suggestions without numbers are just opinions and usually do not reflect an optimal solution.
But first one must understand the significance of core count suggested by VirtualBox. Reason is, if you set too many virtual cores then you will have performance degradation (or maybe crashes even). So VirtualBox should suggest the maximum core count which is most efficient and works. Soon we will look at which core count is most efficient for a module, one or two :)
@socratis That article is incorrect (based on real life results) and also irrelevant because performance is mostly what matters.
About the lawsuit, while it is bogus, plus it does not have a verdict, AND it is also irrelevant. Because I have doubts that lawyers are the best experts to decide what is best to call a "core" :)
But I hope you are not telling me that you put them as proof of concept. Because they are results of actions of random people on "internet".
@frank What AMD or Microsoft thinks is somewhat irrelevant here. Because virtualbox should make a suggestion which performs best, independent of what X thinks about it. So the numbers are what matters here.
Numbers show clearly that it is wrong that that VirtualBox gets this information from Windows and causes a bug/defect in VirtualBox. Because the core count suggested by VirtualBox is simply suboptimal.
Tools such as CPU-Z and VMWARE correctly identify the core counts. (correctly in a sense which gives best results). So, relying on what Windows says is no excuse for not fixing the problem. Especially considering simplistic tools like cpu-z can get it right...
@socratis and @frank I have recently performed tests on my 2 module AMD system, I used windows host and linux guest with sysbench and stress-ng for a quick result on CPU core performance. I am posting my sysbench results here but you can find the full info/outputs at the forum thread I created: https://forums.virtualbox.org/viewtopic.php?f=9&t=79731
For example in my system virtualbox tells that if I use more than 2 virtual cores, it will degrade the performance. However I ran tests with 1,2,4 core VM machine settings using 1,2,4 threads and the results speak for themselves. Using 4 cores improve the performance 4 times and most efficient way to run the VM.
So instead of arguing what constitutes a CORE maybe we can agree that using all cores give the best performance on AMD processors which is number of modules x 2, which is indeed the number of cores reported by AMD.
So, if you want to make a counter argument. Please show us clearly why it is better to use 'number of modules' as core count.
1 Core VM 1 thread 158s 2 thread 159s 4 thread 154s 2 Core VM 1 thread 155s 2 thread 61s 4 thread 60s 4 Core VM 1 thread 152s 2 thread 64s 4 thread 27s
Numbers do not lie. What Virtualbox is suggesting is suboptimal. Therefore it is a bug/defect and it must be fixed.
Thanks,
comment:4 by , 8 years ago
Here is a worst case scenario for a module. Encoding video with handbrake. Because encoding process uses heavily AVX and floating point operations (very specific to this task) and therefore will abuse the shared floating point units. Yet, going from 2 cores to 4 cores improve the performance with 1.5x. As seen from previous tests, other operations which involve lesser amount of floating point operations scale much better.
Result: The text shown by VirtualBox is absolutely incorrect and misleading, because the performance does NOT degrade if all 4 cores of 2 modules are given to VM. On the contrary, it improves.
Notice: Tests are run on 2 module 4 core processor Windows processor minimum/maximum speeds set to 99% to disable turbo etc. In my system this sets the speed to 1.6GHz where it stays stable during all tests. Compared wall time to stopwatch in my phone, +-1 sec. I blame my reflexes for difference. Ran few tests several times to see if the results are stable (+-2sec) Commands: time nano HandBrakeCLI -i VID_20160818_162812.mp4 -e x264 -o test.mp4 -x threads=1 time nano HandBrakeCLI -i VID_20160818_162812.mp4 -e x264 -o test.mp4 -x threads=2 time nano HandBrakeCLI -i VID_20160818_162812.mp4 -e x264 -o test.mp4 -x threads=4 Results: 1 Core VM 1 thread 4m54.668s - avg 6.9fps 2 threads 5m6.473s - avg 6.6fps 4 threads 5m7.991s - avg 6.6fps 8 threads 5m9.824s - avg 6.6fps 2 Core VM 1 thread 4m28.607s - avg 7.6fps 2 threads 2m41.696s - avg 12.7fps 4 threads 2m41.596s - avg 12.7fps 8 threads 2m41.990s - avg 12.9fps 4 Core VM 1 thread 4m27.508s - avg 7.6fps 2 threads 2m15.641s - avg 15.1fps 4 threads 1m39.228s - avg 20.5fps 8 threads 1m38.982s - avg 20.9fps
comment:5 by , 8 years ago
In addition, VirtualBox shows different number of cores in Linux and Windows hosts. In windows it allows me to select up to 4 cores and the slider is red after 2 cores. Meanwhile in Linux it correctly allows me to select up to 8 cores and slider is red after 4 cores.
comment:6 by , 8 years ago
yurtesen, before you annoy everybody with your extensive prosa you should carefully read the above comments. VirtualBox uses a Windows function to determine the number of installed phyiscal cores so we trust the OS to provide the correct information -- which works for Intel CPUs and older AMD CPUs and which works for Linux. That explains why you see different results for Linux and for Windows. If you insist of using more CPU cores for your guest, feel free to do so. We will NOT guess the number of physical cores installed in the system. So if you insist of a fix, please provide an appropriate patch (which fixes the detection of the number of physical cores on AMD hosts) and we will consider applying it.
comment:7 by , 8 years ago
yurtesen, I removed your last inappropriate comment. Insulting developers ("silly excuses") is not tolerated. I already explained why VirtualBox behaves like it does, see my previous comment.
comment:8 by , 8 years ago
Well, I spent my time for you and made repeatable benchmarks and put for all to see the error in how virtualbox functions. Clearly showed and explained several reasons why the virtualbox suggestion was incorrect, misleading and how it can be improved.
I did not get a response telling why and if my tests or reasonings are wrong etc. The only response is, to put it simply, 'this is because windows says so, therefore it is not a bug'. For example nobody tried to explain me why it is perfectly fine that in Linux, VirtualBox tells me it is good to use 4 cores, but in same machine in Windows it tells me it is better to use 2 cores. What gives?
I don't remember what I wrote which you removed and my apologies if it was not nice. Let me put it in a more civilized way and at the same time it happens to be a funny analogy. :)
If you can imagine how it felt for astronomers (prominently Galileo Galilei) when they tell the earth is not center of the universe and church just refuses it (because apparently bible says so). You can probably imagine how some responses here makes people feel.
comment:9 by , 7 years ago
The mentioned lawsuit was dismissed. So, by law also AMD Bulldozer architecture has real cores and not threads. http://www.leagle.com/decision/In%20FDCO%2020161114J11/Dickey%20v.%20Advanced%20Micro%20Devices,%20Inc.
Apparently the guy who started the lawsuit had no understanding of what is a "core". Quoting "Dickey did not adequately allege that he had a particular understanding of what constitutes a "core.""
comment:10 by , 7 years ago
This has nothing to do with the lawsuit. That had to do with CPU modules (where there are an unequal number of general CPU cores, integer units, and floating point units).
I have an AMD FX-8320 (Piledriver/Vishera) with eight true CPU cores and the latest VirtualBox in the 3.1 series, 3.1.28, still thinks that four of the CPUs are virtual. This bug needs to be fixed to represent reality, hopefully using a combination of Windows functions and other kinds of probes.
I have many, many other programs that inquire about the CPU and none of these programs report that my processor has only four physical cores. Why can't VirtualBox do the same?
virtualbox-processor-count-bug.png