Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic at res.eax == 0 #45

Closed
mmyyrroonn opened this issue Feb 2, 2021 · 6 comments
Closed

panic at res.eax == 0 #45

mmyyrroonn opened this issue Feb 2, 2021 · 6 comments

Comments

@mmyyrroonn
Copy link

Hi, Nice to meet you. Our project met a panic error at the below line. I'm not professional at cpu. May I know in which kind of situation would cause the failure of the following error? Any help would be appreciated.

assert!(res.eax == 0);

@gz
Copy link
Owner

gz commented Feb 3, 2021

Hi @myronfanqiu

Can you tell me what CPU model this is where you encounter this error? And maybe cpuid --raw if you're running this on Linux. Thanks!

@programmerjake
Copy link

programmerjake commented Jul 2, 2021

Apparently that assert should just be deleted since, according to Wikipedia, eax is set to the highest input ecx value supported for the input eax == 7. In particular, avx512_bf16 is returned from input eax == 7, ecx == 1

https://en.wikipedia.org/wiki/CPUID#EAX=7,_ECX=0:_Extended_Features

@programmerjake
Copy link

thread '<unnamed>' panicked at 'assertion failed: res.eax == 0', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/raw-cpuid-7.0.3/src/lib.rs:295:13

running into this issue on a Intel(R) Xeon(R) Gold 6348H:
/proc/cpuinfo: https://pastebin.ubuntu.com/p/g9NkyVjbQG/

it supports avx512_bf16, so must return an eax of at least 1.

@gz
Copy link
Owner

gz commented Jul 3, 2021

Hi thanks for reporting this,yea this makes sense I think this sub-leaf is new and the assert was too pessimistic assuming they'll never add one. I'll remove the assert.

@gz
Copy link
Owner

gz commented Jul 3, 2021

Released a fixed version as 9.0.1. This doesn't quite allow to query for avx_bf16 yet, I'll update the cpuid library more for that.

@gz gz closed this as completed Jul 3, 2021
@programmerjake
Copy link

Thanks!

facebook-github-bot pushed a commit to facebookexperimental/reverie that referenced this issue Apr 23, 2022
Summary: Updating raw-cpuid to get this fix: gz/rust-cpuid#45

Reviewed By: dtolnay

Differential Revision: D35856229

fbshipit-source-id: 74e173e4db6d3e4270ce0993a5491adb2b776a1f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants