Giter VIP home page Giter VIP logo

cpuid.py's People

Contributors

alalazo avatar dw avatar flababah avatar gregory-shklover avatar isuruf avatar niklasf avatar vxuyu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cpuid.py's Issues

Trailing zeros

Nice and fast! And all I need is name and vendor.
But: the Name is returned with 9 trailing zeros (shown below as '?'), which have to be removed. The Vendor comes back ok.

`
03 12:44:42.183 DEBUG : ....77 CPU Name : Intel(R) Core(TM) i7-4771 CPU @ 3.50GHz?????????

03 12:44:42.183 DEBUG : ....78 CPU Vendor : GenuineIntel
`
Linux Mint 21.2, Python 3.10.12

Memory Exception when running python 3.7 on Windows 64-bit

I have looked through the code and can not seem to find the cause of this bug.

OSError: exception: access violation when writing 0x00000000XXXXXXXX

The code runs fine on 3.7 in Ubuntu. 2.7 runs fine on Windows 64-bit.
The offending line is:

self.func_ptr(strust, eax, ecx)

Any idea of a root cause?

Donation

Do you have a donation link?
I want to "send" you a beer or two, since your project helped me a bit.

Thanks!

PyPI package

Hi. Have you considered publishing this as a library to PyPI?

How about calling cpuid with subleaf?

I noticed that cpuid can be called with %eax as leaf, and %ecx as subleaf, e.g., when query Intel thread/core and cache topology using %eax=4 or %eax=Bh. cpuid wiki

However, cpuid.py seems to only consider leaf, i.e., %eax, ignoring subleaf, i.e., %ecx.

AVX2 detection broken

The CPU under test definitely supports AVX2:

$ cat /proc/cpuinfo
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 61
model name  : Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz
stepping    : 4
microcode   : 0x21
cpu MHz     : 2232.656
cache size  : 4096 KB
physical id : 0
siblings    : 4
core id     : 0
cpu cores   : 2
apicid      : 0
initial apicid  : 0
fpu     : yes
fpu_exception   : yes
cpuid level : 20
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch ida arat epb pln pts dtherm intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap xsaveopt
bugs        :
bogomips    : 4790.55
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:

But example.py does not detect it:

Vendor ID : GenuineIntel
CPU name  : Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz

Vector instructions supported:
SSE       : Yes
SSE2      : Yes
SSE3      : Yes
SSSE3     : Yes
SSE4.1    : Yes
SSE4.2    : Yes
SSE4a     : --
AVX       : Yes
AVX2      : --
BMI2      : --

In fact no flags are set at all, for EAX = 7:

CPUID    A        B        C        D
00000000 00000014 756e6547 6c65746e 49656e69
00000001 000306d4 03100800 7ffafbbf bfebfbff
00000002 76036301 00f0b5ff 00000000 00c30000
00000003 00000000 00000000 00000000 00000000
00000004 00000000 00000000 00000000 00000000
00000005 00000040 00000040 00000003 11142120
00000006 00000077 00000002 00000009 00000000
00000007 00000000 00000000 00000000 00000000
00000008 00000000 00000000 00000000 00000000
00000009 00000000 00000000 00000000 00000000
0000000a 07300403 00000000 00000000 00000603
0000000b 00000000 00000000 00000068 00000003
0000000c 00000000 00000000 00000000 00000000
0000000d 00000000 00000000 00000000 00000000
0000000e 00000000 00000000 00000000 00000000
0000000f 00000000 00000000 00000000 00000000
00000010 00000000 00000000 00000000 00000000
00000011 00000000 00000000 00000000 00000000
00000012 00000000 00000000 00000000 00000000
00000013 00000000 00000000 00000000 00000000
00000014 00000000 00000000 00000000 00000000
80000000 80000008 00000000 00000000 00000000
80000001 00000000 00000000 00000121 2c100800
80000002 65746e49 2952286c 726f4320 4d542865
80000003 37692029 3035352d 43205530 40205550
80000004 342e3220 7a484730 00000000 00000000
80000005 00000000 00000000 00000000 00000000
80000006 00000000 00000000 01006040 00000000
80000007 00000000 00000000 00000000 00000100
80000008 00003027 00000000 00000000 00000000

Must CPUID be called differently for EAX = 7? Compare https://en.wikipedia.org/wiki/CPUID#EAX.3D7.2C_ECX.3D0:_Extended_Features

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.