Ticket #20005 (new defect)

Opened 2 years ago

Last modified 10 months ago

POPCNT cpu flag not supported in 6.1 Ubuntu 16 guest

Reported by: eben Owned by:
Component: VMM Version: VirtualBox 6.1.16
Keywords: Cc:
Guest type: other Host type: other


Ubuntu 16 guest with Enable Nested Paging enabled. On VirtualBox 6.0 guest Ubuntu 16.04 reports having the POPCNT CPU flag. On 6.1 POPCNT is no longer there (causing my OpenCV app to fail). I downgraded back to 6.0 and it runs again. If this is in the release notes I didn't find it.

Change History

comment:1 Changed 16 months ago by Stevn

+1, same issue

OpenCV running on Ubuntu 18.04.5LTS 64-bit reports:

* FATAL ERROR:                                               *
* This OpenCV build doesn't support the CPU/HW configuration *
Required baseline features:
    ID=  2 (SSE) - OK
    ID=  3 (SSE2) - OK
    ID=  4 (SSE3) - OK
    ID=  5 (SSSE3) - OK
    ID=  6 (SSE4.1) - OK
    ID=  7 (SSE4.2) - OK
terminate called after throwing an instance of 'cv::Exception'
  what():  OpenCV(4.5.1-openvino) ../openvino/modules/core/src/system.cpp:626: error: (-215:Assertion failed) Missing support for required CPU baseline features.  Check OpenCV build configuration and required CPU/HW setup. in function 'initialize'
Version 0, edited 16 months ago by Stevn (next)

comment:2 Changed 16 months ago by Stevn

Found a solution. On the guest Ubuntu OS, check the flags in cpuinfo, note popcnt is not available

cat /proc/cpuinfo

On the Host OS (in my case Windows10 console):

cd C:\Program Files\Oracle\VirtualBox
VBoxManage.exe setextradata <Your VM's name> VBoxInternal/CPUM/IsaExts/POPCNT 1

confirm on guest after restart:

cat /proc/cpuinfo | grep popcnt

comment:3 Changed 16 months ago by klaus

POPCNT is enabled when it's known safe with the current VM execution code, which currently is the case when nested paging is enabled (should be always the case on a reasonably recent CPU, anything else kills performance) and unrestricted guest execution is available (again recent CPU). Your tweak is probably reasonably safe, but it shows that your CPU is not considered recent enough.

It's possible that the condition could be relaxed, but that needs careful analysis.

comment:4 Changed 10 months ago by AnssiH

It seems like "Nested Paging" and "Unrestricted Execution" are always reported as "Inactive" when running under Hyper-V, resulting in POPCNT and some other extensions getting disabled by default.

Checked with i7-8550U and i7-10750H, of which at least the latter is "reasonably recent".

Note: See TracTickets for help on using tickets.
ContactPrivacy policyTerms of Use