When we do machine learning, we definitely need to use a good GPU graphics card, followed by a powerful CPU. High frequency CPU in the running program, really sometimes faster than the use of GPU, so how to check your machine’s CPU is an essential step. When we are shopping for a laptop or server, we often see the expression “X core XG”. Today let’s learn some common terms.

View CPU model and frequency – model By CPU model, we can intuitively distinguish its good and bad, and frequency feedback is how its performance.

# CPU type $cat/proc/cpuinfo | grep "model name" | uniq model name: Intel Xeon (R) (R) CPU v4 E5-2640 $# @ 2.40 GHz CPU frequency cat/proc/cpuinfo | grep "CPU MHz" | uniq MHz CPU: 1547.537 CPU MHz: 1250.590 CPU MHz: 2183.637Copy the code

Checking the number of physical cpus – Chip Indicates the actual number of cpus installed on the mainboard. You can count the number of unique physical ids.

# physical CPU number $cat/proc/cpuinfo | grep "physical id" | sort | uniq | wc - 2 lCopy the code

The number of cores that can process data on a single CPU, such as dual-core or quad-core cores.

# number of CPU cores $cat/proc/cpuinfo | grep "CPU cores" | uniq CPU cores: 10Copy the code

Check the number of logical cpus. N/A In general, the number of logical cpus is equal to the number of physical cpus x the number of cores. If the number is different, it indicates that the server CPU supports hyper-threading. Hyperthreading (HTT) : In simple terms, it enables one kernel in the processor to function as two cores in the operating system. In this case, the execution resources available to the operating system are doubled, greatly improving the overall system performance. In this case, the logical CPU = Number of physical cpus x number of cores x 2.

# logical CPU number $cat/proc/cpuinfo | grep "processor" | wc - 40 lCopy the code

None example Query whether hyper-threading is enabled on the CPU

# $query way cat/proc/cpuinfo | grep - e - e "CPU cores" "siblings" | sort | uniq CPU cores: 10 siblings: 20Copy the code