VirtualBox

Opened 3 years ago

Last modified 2 years ago

#20005 new defect

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

Description

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 (4)

comment:1 by Stevn, 3 years ago

+1, same issue

OpenCV running on Ubuntu 18.04.5LTS 64-bit Guest OS (VB 6.1.22 r144080) 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=  8 (POPCNT) - NOT AVAILABLE
    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'
Last edited 3 years ago by Stevn (previous) (diff)

comment:2 by Stevn, 3 years ago

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 by Klaus Espenlaub, 3 years ago

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 by AnssiH, 2 years ago

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.

© 2023 Oracle
ContactPrivacy policyTerms of Use