首页 > 其他分享 >Virtualbox - Virtualized CPU missing features AVX, AVX2 and FMA

Virtualbox - Virtualized CPU missing features AVX, AVX2 and FMA

时间:2025-01-16 11:00:29浏览次数:1  
标签:AVX2 AVX features Level LineSize Cache 64 Assoc Supports

 

(duckdb_book) frank@ZZHUBT:~$ python
Python 3.13.1 (main, Jan 15 2025, 18:12:47) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import polars as pl
/home/frank/venvs/duckdb_book/lib/python3.13/site-packages/polars/_cpu_check.py:258: RuntimeWarning: Missing required CPU features.

The following required CPU features were not detected:
    avx, avx2, fma
Continuing to use this version of Polars on this processor will likely result in a crash.
Install the `polars-lts-cpu` package instead of `polars` to run Polars with better compatibility.

Hint: If you are on an Apple ARM machine (e.g. M1) this is likely due to running Python under Rosetta.
It is recommended to install a native version of Python that does not run under Rosetta x86-64 emulation.

If you believe this warning to be a false positive, you can set the `POLARS_SKIP_CPU_CHECK` environment variable to bypass this check.

  warnings.warn(
Illegal instruction (core dumped)

 

How to Check Support for AVX/AVX2/FMA:

  • Linux: You can run the following command to check if your CPU supports these features:

    lscpu

    Look for the flags avx, avx2, and fma in the output. If they’re not present, your CPU doesn’t support them.

  • macOS: Use the following command:

    sysctl -a | grep machdep.cpu.features

    If AVX or FMA is listed, your CPU supports those features.

  • Windows: You can check the CPU information with the following command in Command Prompt:

    wmic cpu get caption, deviceid, name, numberofcores, maxclockspeed, status

 

The virtualized CPU doesn't support AVX/AVX2/FMA:

(duckdb_book) frank@ZZHUBT:~$ lscpu
Architecture:             x86_64
  CPU op-mode(s):         32-bit, 64-bit
  Address sizes:          39 bits physical, 48 bits virtual
  Byte Order:             Little Endian
CPU(s):                   2
  On-line CPU(s) list:    0,1
Vendor ID:                GenuineIntel
  Model name:             13th Gen Intel(R) Core(TM) i5-1340P
    CPU family:           6
    Model:                186
    Thread(s) per core:   1
    Core(s) per socket:   2
    Socket(s):            1
    Stepping:             2
    BogoMIPS:             4377.60
    Flags:                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl x
                          topology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 movbe popcnt aes rdrand hypervisor lahf_lm abm 3dnowprefetch ibr
                          s_enhanced fsgsbase bmi1 bmi2 invpcid rdseed adx clflushopt sha_ni arat md_clear flush_l1d arch_capabilities
Virtualization features:  
  Hypervisor vendor:      KVM
  Virtualization type:    full
Caches (sum of all):      
  L1d:                    96 KiB (2 instances)
  L1i:                    64 KiB (2 instances)
  L2:                     2.5 MiB (2 instances)
  L3:                     24 MiB (2 instances)
NUMA:                     
  NUMA node(s):           1
  NUMA node0 CPU(s):      0,1
Vulnerabilities:          
  Gather data sampling:   Not affected
  Itlb multihit:          Not affected
  L1tf:                   Not affected
  Mds:                    Not affected
  Meltdown:               Not affected
  Mmio stale data:        Not affected
  Reg file data sampling: Mitigation; Clear Register File
  Retbleed:               Mitigation; Enhanced IBRS
  Spec rstack overflow:   Not affected
  Spec store bypass:      Vulnerable
  Spectre v1:             Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:             Mitigation; Enhanced / Automatic IBRS; RSB filling; PBRSB-eIBRS SW sequence; BHI SW loop, KVM SW loop
  Srbds:                  Not affected
  Tsx async abort:        Not affected

 

PS C:\Users\ZhangZhihui> wmic cpu get caption, deviceid, name, numberofcores, maxclockspeed, status
wmic : 无法将“wmic”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
所在位置 行:1 字符: 1
+ wmic cpu get caption, deviceid, name, numberofcores, maxclockspeed, s ...
+ ~~~~
    + CategoryInfo          : ObjectNotFound: (wmic:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

 

Starting with Windows 11, the wmic command has been deprecated and removed in favor of PowerShell commands and other modern tools. 

Using Coreinfo (Recommended for CPU Feature Detection):

Coreinfo is a small utility from Sysinternals that can show you detailed CPU capabilities, including AVX, AVX2, and FMA.

Steps to use Coreinfo:

  1. Download Coreinfo:

  2. Extract and Run Coreinfo:

    • Extract the contents of the zip file.
    • Open PowerShell or Command Prompt as Administrator.
    • Navigate to the directory where you extracted Coreinfo.exe.
    • Run the command: powershell .\coreinfo.exe
  3. Check the output for the features:

    • You’ll see output like: AVX * Supports AVX AVX2 * Supports AVX2 FMA * Supports FMA

    This will tell you if your CPU supports AVX, AVX2, and FMA instructions.

 

 

It turns out my physical CPU supports AVX, AVX2 and FMA:

PS E:\software\Coreinfo> .\Coreinfo.exe

Coreinfo v3.6 - Dump information on system CPU and memory topology
Copyright (C) 2008-2022 Mark Russinovich
Sysinternals - www.sysinternals.com


13th Gen Intel(R) Core(TM) i5-1340P
Intel64 Family 6 Model 186 Stepping 2, GenuineIntel
Microcode signature: 00004122
HTT             *       Hyperthreading enabled
CET             *       Supports Control Flow Enforcement Technology
Kernel CET      -       Kernel-mode CET Enabled
User CET        *       User-mode CET Allowed
HYPERVISOR      *       Hypervisor is present
VMX             -       Supports Intel hardware-assisted virtualization
SVM             -       Supports AMD hardware-assisted virtualization
X64             *       Supports 64-bit mode

SMX             -       Supports Intel trusted execution
SKINIT          -       Supports AMD SKINIT
SGX             -       Supports Intel SGX

NX              *       Supports no-execute page protection
SMEP            *       Supports Supervisor Mode Execution Prevention
SMAP            *       Supports Supervisor Mode Access Prevention
PAGE1GB         *       Supports 1 GB large pages
PAE             *       Supports > 32-bit physical addresses
PAT             *       Supports Page Attribute Table
PSE             *       Supports 4 MB pages
PSE36           *       Supports > 32-bit address 4 MB pages
PGE             *       Supports global bit in page tables
SS              *       Supports bus snooping for cache operations
VME             *       Supports Virtual-8086 mode
RDWRFSGSBASE    *       Supports direct GS/FS base access

FPU             *       Implements i387 floating point instructions
MMX             *       Supports MMX instruction set
MMXEXT          -       Implements AMD MMX extensions
3DNOW           -       Supports 3DNow! instructions
3DNOWEXT        -       Supports 3DNow! extension instructions
SSE             *       Supports Streaming SIMD Extensions
SSE2            *       Supports Streaming SIMD Extensions 2
SSE3            *       Supports Streaming SIMD Extensions 3
SSSE3           *       Supports Supplemental SIMD Extensions 3
SSE4a           -       Supports Streaming SIMDR Extensions 4a
SSE4.1          *       Supports Streaming SIMD Extensions 4.1
SSE4.2          *       Supports Streaming SIMD Extensions 4.2

AES             *       Supports AES extensions
AVX             *       Supports AVX instruction extensions
AVX2            *       Supports AVX2 instruction extensions
AVX-512-F       -       Supports AVX-512 Foundation instructions
AVX-512-DQ      -       Supports AVX-512 double and quadword instructions
AVX-512-IFAMA   -       Supports AVX-512 integer Fused multiply-add instructions
AVX-512-PF      -       Supports AVX-512 prefetch instructions
AVX-512-ER      -       Supports AVX-512 exponential and reciprocal instructions
AVX-512-CD      -       Supports AVX-512 conflict detection instructions
AVX-512-BW      -       Supports AVX-512 byte and word instructions
AVX-512-VL      -       Supports AVX-512 vector length instructions
FMA             *       Supports FMA extensions using YMM state
MSR             *       Implements RDMSR/WRMSR instructions
MTRR            *       Supports Memory Type Range Registers
XSAVE           *       Supports XSAVE/XRSTOR instructions
OSXSAVE         *       Supports XSETBV/XGETBV instructions
RDRAND          *       Supports RDRAND instruction
RDSEED          *       Supports RDSEED instruction

CMOV            *       Supports CMOVcc instruction
CLFSH           *       Supports CLFLUSH instruction
CX8             *       Supports compare and exchange 8-byte instructions
CX16            *       Supports CMPXCHG16B instruction
BMI1            *       Supports bit manipulation extensions 1
BMI2            *       Supports bit manipulation extensions 2
ADX             *       Supports ADCX/ADOX instructions
DCA             -       Supports prefetch from memory-mapped device
F16C            *       Supports half-precision instruction
FXSR            *       Supports FXSAVE/FXSTOR instructions
FFXSR           -       Supports optimized FXSAVE/FSRSTOR instruction
MONITOR         *       Supports MONITOR and MWAIT instructions
MOVBE           *       Supports MOVBE instruction
ERMSB           *       Supports Enhanced REP MOVSB/STOSB
PCLMULDQ        *       Supports PCLMULDQ instruction
POPCNT          *       Supports POPCNT instruction
LZCNT           *       Supports LZCNT instruction
SEP             *       Supports fast system call instructions
LAHF-SAHF       *       Supports LAHF/SAHF instructions in 64-bit mode
HLE             -       Supports Hardware Lock Elision instructions
RTM             -       Supports Restricted Transactional Memory instructions

DE              *       Supports I/O breakpoints including CR4.DE
DTES64          -       Can write history of 64-bit branch addresses
DS              -       Implements memory-resident debug buffer
DS-CPL          -       Supports Debug Store feature with CPL
PCID            *       Supports PCIDs and settable CR4.PCIDE
INVPCID         *       Supports INVPCID instruction
PDCM            *       Supports Performance Capabilities MSR
RDTSCP          *       Supports RDTSCP instruction
TSC             *       Supports RDTSC instruction
TSC-DEADLINE    *       Local APIC supports one-shot deadline timer
TSC-INVARIANT   *       TSC runs at constant rate
xTPR            *       Supports disabling task priority messages

EIST            *       Supports Enhanced Intel Speedstep
ACPI            *       Implements MSR for power management
TM              *       Implements thermal monitor circuitry
TM2             *       Implements Thermal Monitor 2 control
APIC            *       Implements software-accessible local APIC
x2APIC          *       Supports x2APIC

CNXT-ID         -       L1 data cache mode adaptive or BIOS

MCE             *       Supports Machine Check, INT18 and CR4.MCE
MCA             *       Implements Machine Check Architecture
PBE             *       Supports use of FERR#/PBE# pin

PSN             -       Implements 96-bit processor serial number

PREFETCHW       *       Supports PREFETCHW instruction

Maximum implemented CPUID leaves: 00000020 (Basic), 80000008 (Extended).
Maximum implemented address width: 48 bits (virtual), 39 bits (physical).

Processor signature: 000B06A2

Logical to Physical Processor Map:
**--------------  Physical Processor 0 (Hyperthreaded)
--**------------  Physical Processor 1 (Hyperthreaded)
----**----------  Physical Processor 2 (Hyperthreaded)
------**--------  Physical Processor 3 (Hyperthreaded)
--------*-------  Physical Processor 4
---------*------  Physical Processor 5
----------*-----  Physical Processor 6
-----------*----  Physical Processor 7
------------*---  Physical Processor 8
-------------*--  Physical Processor 9
--------------*-  Physical Processor 10
---------------*  Physical Processor 11

Logical Processor to Socket Map:
****************  Socket 0

Logical Processor to NUMA Node Map:
****************  NUMA Node 0

No NUMA nodes.

Logical Processor to Cache Map:
**--------------  Data Cache          0, Level 1,   48 KB, Assoc  12, LineSize  64
**--------------  Instruction Cache   0, Level 1,   32 KB, Assoc   8, LineSize  64
**--------------  Unified Cache       0, Level 2,    1 MB, Assoc  10, LineSize  64
****************  Unified Cache       1, Level 3,   12 MB, Assoc   8, LineSize  64
--**------------  Data Cache          1, Level 1,   48 KB, Assoc  12, LineSize  64
--**------------  Instruction Cache   1, Level 1,   32 KB, Assoc   8, LineSize  64
--**------------  Unified Cache       2, Level 2,    1 MB, Assoc  10, LineSize  64
----**----------  Data Cache          2, Level 1,   48 KB, Assoc  12, LineSize  64
----**----------  Instruction Cache   2, Level 1,   32 KB, Assoc   8, LineSize  64
----**----------  Unified Cache       3, Level 2,    1 MB, Assoc  10, LineSize  64
------**--------  Data Cache          3, Level 1,   48 KB, Assoc  12, LineSize  64
------**--------  Instruction Cache   3, Level 1,   32 KB, Assoc   8, LineSize  64
------**--------  Unified Cache       4, Level 2,    1 MB, Assoc  10, LineSize  64
--------*-------  Data Cache          4, Level 1,   32 KB, Assoc   8, LineSize  64
--------*-------  Instruction Cache   4, Level 1,   64 KB, Assoc   8, LineSize  64
--------****----  Unified Cache       5, Level 2,    2 MB, Assoc  16, LineSize  64
---------*------  Data Cache          5, Level 1,   32 KB, Assoc   8, LineSize  64
---------*------  Instruction Cache   5, Level 1,   64 KB, Assoc   8, LineSize  64
----------*-----  Data Cache          6, Level 1,   32 KB, Assoc   8, LineSize  64
----------*-----  Instruction Cache   6, Level 1,   64 KB, Assoc   8, LineSize  64
-----------*----  Data Cache          7, Level 1,   32 KB, Assoc   8, LineSize  64
-----------*----  Instruction Cache   7, Level 1,   64 KB, Assoc   8, LineSize  64
------------*---  Data Cache          8, Level 1,   32 KB, Assoc   8, LineSize  64
------------*---  Instruction Cache   8, Level 1,   64 KB, Assoc   8, LineSize  64
------------****  Unified Cache       6, Level 2,    2 MB, Assoc  16, LineSize  64
-------------*--  Data Cache          9, Level 1,   32 KB, Assoc   8, LineSize  64
-------------*--  Instruction Cache   9, Level 1,   64 KB, Assoc   8, LineSize  64
--------------*-  Data Cache         10, Level 1,   32 KB, Assoc   8, LineSize  64
--------------*-  Instruction Cache  10, Level 1,   64 KB, Assoc   8, LineSize  64
---------------*  Data Cache         11, Level 1,   32 KB, Assoc   8, LineSize  64
---------------*  Instruction Cache  11, Level 1,   64 KB, Assoc   8, LineSize  64

Logical Processor to Group Map:
****************  Group 0

 

The Paravirtualization Interface setting in VirtualBox determines how the guest operating system interacts with the underlying host system for performance optimizations. It allows the guest to take advantage of certain features to speed up operations, especially in virtualized environments. This setting is particularly useful for improving performance in tasks such as I/O, memory access, and CPU processing.

In VirtualBox, the Paravirtualization Interface can be configured under the System > Acceleration tab, and it offers several options. Here's an explanation of each one:

Paravirtualization Interface Options in VirtualBox:

  1. None:

    • Meaning: No paravirtualization interface is used.
    • Use Case: This is the default setting and is appropriate for most guest operating systems, especially when paravirtualization is not supported or needed. It does not provide any specific optimizations and leaves the virtual machine to operate in the traditional virtualized environment with full emulation.
    • Performance Impact: This option may result in slower performance for certain workloads, as the guest OS has to rely entirely on hardware emulation, which can be less efficient.
  2. Minimal:

    • Meaning: Provides basic paravirtualization support.
    • Use Case: This setting is used for Linux guests (especially older or lighter Linux distributions) that don’t require advanced paravirtualization support but could benefit from some optimizations. It provides minimal optimization for things like I/O performance and memory management.
    • Performance Impact: There can be a small performance boost in I/O operations (disk and network), but it's not as powerful as the more advanced paravirtualization options.
  3. KVM (Kernel-based Virtual Machine):

    • Meaning: Optimizes performance for Linux guests running on a KVM-based hypervisor (specifically when running Linux with KVM on the host system).
    • Use Case: This is the recommended setting for Linux guests that support KVM. It enables more advanced optimizations for Linux guests running on virtualized hardware, particularly when the host system uses KVM or supports paravirtualization.
    • Performance Impact: This setting provides significant performance improvements, especially for I/O, memory, and CPU. It can result in better performance for Linux guests because it exposes paravirtualized devices to the guest, enabling faster operations than when running in full emulation mode.
  4. Hyper-V:

    • Meaning: Provides paravirtualization optimizations for Windows guests running in a Hyper-V environment.
    • Use Case: This is useful when running Windows Server 2012 or later and Windows 10 or later as guest OSes. It uses the paravirtualization interface designed for use with Microsoft's Hyper-V hypervisor. It's especially beneficial for users who are running Windows on a host machine and want the guest to interact in a way that maximizes compatibility and performance within the Windows environment.
    • Performance Impact: This can improve performance for Windows guests in terms of system calls, memory access, and I/O handling, as it provides optimized communication between the guest OS and the host.
  5. VBoxSVGA (VirtualBox Graphics Adapter):

    • Meaning: This setting is related to the graphics adapter used by VirtualBox and is designed to support 3D acceleration and optimize graphics performance. However, this is separate from paravirtualization related to CPU and memory.
    • Use Case: This is relevant if you are using VirtualBox’s VBoxSVGA graphics adapter for modern GUI-based guests, such as Linux or Windows systems, and want better 3D graphics performance.
    • Performance Impact: It does not directly affect CPU or memory performance, but it can improve the overall experience of running graphical user interfaces (GUIs) in VirtualBox.

Summary of Paravirtualization Options:

OptionDescriptionBest Use CasePerformance Impact
None No paravirtualization. Basic virtual machine operation. Default for most guest OSes. No optimizations; slower performance.
Minimal Basic optimizations for Linux guests. Lightweight Linux distributions. Small performance boost, especially in I/O.
KVM Paravirtualization interface for Linux guests running with KVM. Linux guests using KVM. Significant performance improvements in I/O, memory, CPU.
Hyper-V Paravirtualization for Windows guests with Hyper-V. Windows 10/Server 2012 or later. Better CPU, memory, and I/O performance.
VBoxSVGA Graphics adapter optimization for VirtualBox guests, enabling better 3D acceleration. For guests that require GUI-based graphics. Improves 3D performance, not CPU or memory.

 

 

 

 

标签:AVX2,AVX,features,Level,LineSize,Cache,64,Assoc,Supports
From: https://www.cnblogs.com/zhangzhihui/p/18674566

相关文章

  • 【C++17 library features】深入解析 C++17 标准库中的文件系统 (std::filesystem)
    目录标题第一章:std::filesystem概述1.1C++17引入文件系统库的背景和动机1.2std::filesystem的主要功能和模块结构1.2.1路径管理(PathManagement)1.2.2文件和目录操作(FileandDirectoryOperations)1.2.3文件属性与状态(FileAttributesandStatus)1.2.4错误处理......
  • .NET 9 new features-Microsoft.ML.Tokenizers 库
    在.NET9中,微软引入了Microsoft.ML.Tokenizers库,为.NET开发者提供了强大的文本标记化功能。一、什么是Microsoft.ML.TokenizersMicrosoft.ML.Tokenizers是一个用于文本标记化的库,是.NET生态系统中的一个强大库旨在将文本转换为令牌(tokens)      以便......
  • 通过使用 SIMD 指令集(如 SSE、AVX 等),用于条件处理
    在C++中使用SIMD指令进行掩码操作可以通过使用SIMD指令集(如SSE、AVX等)来实现。掩码操作通常用于条件处理,例如在某些条件下选择性地处理数据。以下是一个使用SSE指令进行掩码操作的示例,以展示如何在SIMD操作中实现条件选择。示例:使用掩码进行条件选择我们将创建一个......
  • .NET 9 New features-JSON序列化
    .NET9已经发布有一段时间了,近期整理一下.NET9的新特性,今天重点分享.NET9JSON序列化方面的改进。先引用官方的说明:在 System.Text.Json 中,.NET9提供了用于序列化JSON的新选项和新的单一实例,可以更轻松地使用Web默认值进行序列化。举个实际的例子,缩进选项JsonSer......
  • .NET 9 new features-分布式追踪支持、HTTP/3 改进以及更好的容器镜像支持
    .NET9针对云原生开发进行了显著优化,重点改进了分布式追踪、HTTP/3支持和容器镜像优化等方面。这些特性极大地提升了.NET在现代云原生应用中的适配性与开发效率。1.设计原理1.1分布式追踪支持背景:在云原生架构中,应用程序通常由多个微服务组成。分布式追踪能够帮助开发者......
  • .NET 9 new features-Memory Caching 和 Collections 优化
    一、内存缓存(MemoryCaching)1.具体的原理内存缓存是一种在应用程序内存中存储数据的机制,旨在减少对外部数据源的频繁访问,从而提高应用程序的性能。在.NET中,MemoryCache类提供了内存缓存的实现。它允许开发者将经常使用的数据存储在内存中,以便快速检索。在.NET9中,Memory......
  • TMS WEB Core Crack,Key Features of TMS WEB Core
    TMSWEBCoreCrack,KeyFeaturesofTMSWEBCoreTMSWEBCoreisconsideredidealforproducingmodernwebsoftwareforusersanddevelopers.DiscoveringtheunlimitedpossibilitiesoftheapplicationsalongwithdevelopmentwiththeuseoftheTMS......
  • .NET 9 New features-AOT相关的改进
    上一篇文章给大家介绍了.NET9Newfeatures-JSON序列化 本篇文章,研究分享一下关于AOT方面的改进1.什么是AOTAOT(Ahead-of-Time)编译是一种在应用程序部署之前,将高级语言代码直接编译为本机机器代码的技术。与传统的即时编译(Just-In-Time,JIT)不同,AOT在应用程序运行之前完成编......
  • .NET 9 New features-JSON序列化
    .NET9已经发布有一段时间了,近期整理一下.NET9的新特性,今天重点分享.NET9JSON序列化方面的改进。先引用官方的说明:在 System.Text.Json 中,.NET9提供了用于序列化JSON的新选项和新的单一实例,可以更轻松地使用Web默认值进行序列化。举个实际的例子,缩进选项JsonSer......
  • [C#] 24位图像水平翻转的跨平台SIMD硬件加速向量算法的关键——YShuffleX3Kernel源码
    在上一篇文章里,给大家讲解了24位图像水平翻转(FlipX)算法,其中用到了一个关键方法——YShuffleX3Kernel。一些读者对它背后的原理感兴趣——为什么它在跨平台时运行也能获得SIMD硬件加速,各种向量指令集的情况下具体怎样实现的?于是本文便详细解答一下。一、为什么它在跨平台时运行......