CpuId.jl icon indicating copy to clipboard operation
CpuId.jl copied to clipboard

ERROR: LoadError: This CPU does not provide information on cpuid leaf 0x00000004.

Open chriselrod opened this issue 3 years ago • 4 comments

https://github.com/JuliaSIMD/VectorizationBase.jl/runs/6198591014?check_suite_focus=true#step:6:168

Could it return some sort of error code that I can check to use a generic fallback instead?

chriselrod avatar Apr 27 '22 17:04 chriselrod

What would be your preferred behaviour ?

cachesize()     --> () | missing | nothing         # empty tuple, or 'missing', or 'nothing'
cachesize(lvl)  --> -1 | 0 | missing | nothing      # illegal value, zero or 'missing', or 'nothing'

Personally, I'd lean towards empty tuple and -1, or missing/nothing.

Missing/nothing could also easily be applied to all other functions instead of throwing exceptions. An illegal value would be difficult for functions that return booleans

m-j-w avatar Apr 28 '22 07:04 m-j-w

I'd prefer nothing, as it's the standard of methods like findfirst, and will generally force you to handle it immediately or throw (as not many people define methods for nothing), so it's easier to find where it originated vs missing which will tend to propagate.

chriselrod avatar Apr 28 '22 12:04 chriselrod

We also see this error over at https://github.com/JuliaParallel/Hwloc.jl/pull/61 in our x86 CI. Note, however, that in only effects the Julia >= 1.7 runners (with CpuId.jl version 3.1). So I wonder what has changed in CpuId.jl since version 3.0, on first sight, this looks like a regression.

carstenbauer avatar Aug 17 '22 14:08 carstenbauer

@carstenbauer this issue is about the failure behavior of the function if the hardware is not providing the expected information. The request is to report nothing rather than to throw an exception.

m-j-w avatar Aug 18 '22 07:08 m-j-w