简体   繁体   English

multiprocessing.cpu_count返回错误的内核数量

[英]multiprocessing.cpu_count returning wrong number of cores

I try to use the following code to decide the number of cores of my laptop: 我尝试使用以下代码来确定笔记本电脑的核心数量:

import multiprocessing
multiprocessing.cpu_count()

The result is 8, but when I open the system report, I can see that I have only 1 CPU with 4 cores. 结果是8,但是当我打开系统报告时,我可以看到我只有1个带有4个内核的CPU。

What's wrong with cpu_count() ? cpu_count()什么问题?

You have 4 physical cores, but 8 logical processors. 您有4个物理内核,但有8个逻辑处理器。 For example, you may have a processor with hyper-threading . 例如,您可能拥有一个具有超线程的处理器。

From SuperUser: Difference Between Cores and Processors 来自SuperUser: 核心和处理器之间的差异

你有什么CPU,它可能是计算物理核心+虚拟核心。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我的 CPU 核心数是 2,但使用 multiprocessing.cpu_count() 得到 4? - Why my CPU core number is 2, but use multiprocessing.cpu_count() get 4? multiprocessing.cpu_count和os.cpu_count之间的区别 - Difference between multiprocessing.cpu_count and os.cpu_count Mac 上的 Python os.cpu_count() 返回错误的内核数 - Python os.cpu_count() on Mac returns wrong number of cores Python multiprocessing.cpu_count() 在 4 核 Nvidia Jetson TK1 上返回“1” - Python multiprocessing.cpu_count() returns '1' on 4-core Nvidia Jetson TK1 如果在python multiprocessing.cpu_count()中返回64,我是否可以从gcloud计算引擎的96个vCPU中受益? - Do I benefit from the 96 vCPUs of a gcloud Compute Engine if in python multiprocessing.cpu_count() returns 64? python多处理和核心数 - python multiprocessing and number of cores 在一定数量的核上进行多处理 - Multiprocessing on a set number of cores python multiprocessing,cpu-s和cpu内核 - python multiprocessing, cpu-s and cpu cores 使用多处理池时,工作进程数应与CPU或内核数相同吗? - When using multiprocessing Pool should the number of worker processes be the same as the number of CPU's or cores? 了解多处理模块的cpu核心的使用 - Understanding the usage of cpu cores of the multiprocessing module
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM