[Feature Request]: Print usable info at boot #1053
Replies: 5 comments
-
If course, here the very same "script" in shell/bash, in case golang is not appreciated: #!/bin/bash
# Check if AES-NI is supported
if grep -q '^flags.*\baes\b' /proc/cpuinfo; then
echo "AES-NI: ✔️"
else
echo "AES-NI: ❌"
fi
# Check if AVX512 is supported
if grep -q '^flags.*\bavx512\b' /proc/cpuinfo; then
echo "AVX512: ✔️"
else
echo "AVX512: ❌"
fi (this works in a native or this (untested) Node.JS implementation:
npm install systeminformation
const si = require('systeminformation');
async function main() {
try {
const cpuData = await si.cpu();
const aesNi = cpuData.flags.includes('aes');
const avx512 = cpuData.flags.includes('avx512');
console.log(`AES-NI:\t${aesNi ? '✔️' : '❌'}`);
console.log(`AVX512:\t${avx512 ? '✔️' : '❌'}`);
} catch (error) {
console.error('Error:', error);
}
}
main(); |
Beta Was this translation helpful? Give feedback.
-
Yes, it can be a bit improved for ARM and x64_86 but feel free to make a PR :) |
Beta Was this translation helpful? Give feedback.
-
I will open a PR as soon as I have time for. |
Beta Was this translation helpful? Give feedback.
-
But if both features aren’t available it should not prevent the user to be able to use the Container. |
Beta Was this translation helpful? Give feedback.
-
Yes, this is solely for logging things out and making them transparent. Maybe I also add a little note/link when features are not available to this very repo, which explains it. |
Beta Was this translation helpful? Give feedback.
-
Currently, when the system boots up, users lack insight into how the application utilizes the underlying hardware. This issue is particularly pronounced when using containers, as they often restrict access to various hardware components of the host.
To enhance transparency, I propose implementing a check for key hardware components (
AES
/AES-NI
&AVX512
) during startup and logging this information to the log or stdout.Why is this important?
AES
andAVX512
can significantly accelerate encryption tasks, sometimes by up to 7x on certain CPUs. Users might erroneously attribute poor performance of this containers to software issues, unaware that the hardware lacks essential integrated circuits or that the VM/container is unable to utilize them.I've created a simple Go snippet using
github.com/klauspost/cpuid
to achieve this:It is very simple to use and efficient. If you @pheiduck think this is adding value to the project, let me know and I will open a PR, when I have time, or just implement it youself - however you wish.
Beta Was this translation helpful? Give feedback.
All reactions