Questions tagged [cpuid]

CPUID is an Intel x86 and x86_64 processor instruction that returns the processor type and the presence of particular features.

Originally introduced by Intel, the CPUID instruction returns the processor type and the presence of features such as MMX/SSE.

163 questions
74
votes
7 answers

How to check if a CPU supports the SSE3 instruction set?

Is the following code valid to check if a CPU supports the SSE3 instruction set? Using the IsProcessorFeaturePresent() function apparently does not work on Windows XP. bool CheckSSE3() { int CPUInfo[4] = {-1}; //-- Get number of valid info…
Stiefel
  • 2,677
  • 3
  • 31
  • 42
35
votes
8 answers

x86/x64 CPUID in C#

Related to my other question, please help me debug "An unhandled exception of type 'System.AccessViolationException' occurred in Unknown Module. Additional information: Attempted to read or write protected memory. This is often an indication that…
Jason Kleban
  • 20,024
  • 18
  • 75
  • 125
32
votes
3 answers

CPUID implementations in C++

I would like to know if somebody around here has some good examples of a C++ CPUID implementation that can be referenced from any of the managed .net languages. Also, should this not be the case, should I be aware of certain implementation…
Kris
  • 2,100
  • 5
  • 31
  • 50
18
votes
2 answers

How do applications determine if instruction set is available and use it in case it is?

Just interesting how it works in games and other software. More precisely, I'm asking for a solution in C++. Something like: if AMX available -> Use AMX version of the math library else if AVX-512 available -> Use AVX-512 version of the math…
malatindez
  • 320
  • 1
  • 8
17
votes
5 answers

Intrinsics for CPUID like informations?

Considering that I'm coding in C++, if possible, I would like to use an Intrinsics-like solution to read useful informations about the hardware, my concerns/considerations are: I don't know assembly that well, it will be a considerable investment…
user2485710
  • 9,451
  • 13
  • 58
  • 102
15
votes
3 answers

Get Computer Unique ID from PHP

I've created an application using PHP and I'm going to sell it to my local market. I will personally be going to their locations to install/configure Apache & MySQL as well as installing my own code. I would like a security system so that if anyone…
Tito
  • 663
  • 1
  • 8
  • 14
14
votes
7 answers

How to get CPU serial under Linux without root permissions

How can I get CPU serial number under Linux (Ubuntu) without root permissions? I tried cpuid command, it works without root permissions, but appears to return all zeros (I believe because something needs to be changed in BIOS). Can you please…
Alexey
  • 345
  • 3
  • 5
  • 10
14
votes
2 answers

Is there an API to detect CPU features on iOS?

I have some cryptography code that has multiple implementations, selecting which implementation at runtime based on the features of the CPU it is running on. Porting this has been straightforward so far, with Windows, Linux and Android being…
Myria
  • 3,372
  • 1
  • 24
  • 42
12
votes
0 answers

How does CPUID work on hybrid architectures?

I want to find out what the L2 cache size is on the current processor. Fortunately, there is a library called cpu_features which allows for that, and more. Internally, it uses the cpuid instruction to get all of this information. I am wondering,…
janekb04
  • 4,304
  • 2
  • 20
  • 51
9
votes
2 answers

What does this line mean in Python?

Which CPU information this code is trying to retrieve. This code is part of a larger package. I am not a Python programmer, and I want to convert this code to C#. from ctypes import c_uint, create_string_buffer, CFUNCTYPE, addressof CPUID =…
Priyank Bolia
  • 14,077
  • 14
  • 61
  • 82
9
votes
2 answers

How do I call "cpuid" in Linux?

While writing new code for Windows, I stumbled upon _cpuinfo() from the Windows API. As I am mainly dealing with a Linux environment (GCC) I want to have access to the CPUInfo. I have tried the following: #include int main() { int a,…
TheBlueCat
  • 1,147
  • 5
  • 19
  • 38
9
votes
2 answers

Why does Hyper-threading get reported as supported on processors without it?

I'm trying to gather system information and noticed the following on an Intel Xeon E5420: After executing CPUID(EAX=1), EDX[28] is set, indicating Hyper-threading support, despite the fact that the processor is listed on the Intel website as not…
andrewmu
  • 14,276
  • 4
  • 39
  • 37
8
votes
7 answers

How to get cpu-id in java?

I want to create an encryption with java.Is there anyway to get CPU Id or anything that be unique in PC such as BIOS or ... for example System.getCpuId(); it is just an example Thanks a lot ...
Freeman
  • 9,464
  • 7
  • 35
  • 58
8
votes
3 answers

How to receive L1, L2 & L3 cache size using CPUID instruction in x86

I encountered a problem during preparing an assembler x86 project which subject is to write a program getting L1 data, L1 code, L2 and L3 cache size. I tried to find something in Intel Documentation & in the Internet but I failed. THE MAIN…
Tomek Janiuk
  • 93
  • 1
  • 3
7
votes
2 answers

Using CPUID to detect CPU specs, reliable solution?

I'm trying to gather information about my CPU with __cpuid(). Though it is getting it right on my computer, when I run my program on my colleague's computer it is detecting the Intel Core2 Quad Q6600 to be hyper-threaded, though according to the…
Alex
  • 197
  • 1
  • 11
1
2 3
10 11