mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-17 20:05:09 -04:00
On x64, we are testing if we support vector capabilities (1 = "basic" = AVX2, 2 = "advanced" = AVX-512) in order to enable and choose a native implementation for some vector functions, using CPUID. However, under some circumstances, this is not sufficient: the OS on which we are running also needs to support AVX/AVX2 etc; basically, it needs to acknowledge it knows about the additional register and that it is able to handle them e.g. in context switches. To do that we need to a) test if the CPU has xsave feature and b) use the xgetbv to test if the OS set it (declaring it supports AVX/AVX2/etc). In most cases this is not needed, as all modern OSes do that, but for some virtualized situations (hypervisors, emulators, etc.) all the component along the chain must support it, and in some cases this is not a given. This PR introduces a change to the x64 version of vec_caps to check for OS support too, and a warning on the Java side in case the CPU supports vector capabilities but those are not enabled at OS level. Tested by passing noxsave to my linux box kernel boot options, and ensuring that the avx flags "disappear" from /proc/cpuinfo, and we fall back to the "no native vector" case. Fixes #126809 |
||
---|---|---|
.. | ||
cli | ||
core | ||
dissect | ||
entitlement | ||
geo | ||
grok | ||
h3 | ||
log4j | ||
logging | ||
logstash-bridge | ||
lz4 | ||
native | ||
plugin-analysis-api | ||
plugin-api | ||
plugin-scanner | ||
secure-sm | ||
simdvec | ||
ssl-config | ||
tdigest | ||
x-content | ||
build.gradle |