Kir*_*irt 14 mac multi-core core ubuntu
我的 Mac 上有一个 Ubuntu VM。是否有我可以在 Ubuntu 中运行的命令来告诉我必须使用多少个内核?
我可以在主机上“关于这个 mac”,但我不确定多核处理器将如何转换为 VM。
Den*_*son 26
这应该有效:
grep -c processor /proc/cpuinfo
Run Code Online (Sandbox Code Playgroud)
或者
lshw -class processor -short
Run Code Online (Sandbox Code Playgroud)
在 OS X 上,您可以使用 sysctl 或 system_profiler:
$ sysctl hw.ncpu hw.physicalcpu hw.logicalcpu
hw.ncpu: 8
hw.physicalcpu: 4
hw.logicalcpu: 8
$ sysctl -n hw.ncpu # -n disables printing the names of variables
8
$ system_profiler SPHardwareDataType|grep Cores
Total Number of Cores: 4
Run Code Online (Sandbox Code Playgroud)
我的处理器支持超线程,所以有 8 个逻辑内核和 4 个物理内核。
| 归档时间: |
|
| 查看次数: |
24362 次 |
| 最近记录: |