@sickcodes commented on GitHub (Apr 15, 2021):
This should clear up the CPU limit questions https://github.com/kholia/OSX-KVM/blob/master/notes.md#pass-through-all-cpu-cores--threads
macOS requires a core count that is a power of 2, but some modern CPUs have odd
counts - like 6 cores and 12 threads.
So how can we harness the entire CPU in the VM?
There are strategies that mix smp/sockets/cores/threads/maxcpu arguments and
use odd socket counts to arrive at even core counts, and even let you specify
that some of the cores are hyperthreaded.
Specifically for the case of an Intel i7 processor with 6 cores and 12 total
threads, altering the boot script to contain these variables and the following
modified SMP line results in a full CPU core/thread pass through:
@sickcodes commented on GitHub (Apr 15, 2021):
Via @kholia
### Pass through all CPU cores / threads
macOS requires a core count that is a power of 2, but some modern CPUs have odd
counts - like 6 cores and 12 threads.
So how can we harness the entire CPU in the VM?
There are strategies that mix smp/sockets/cores/threads/maxcpu arguments and
use odd socket counts to arrive at even core counts, and even let you specify
that some of the cores are hyperthreaded.
Specifically for the case of an Intel i7 processor with 6 cores and 12 total
threads, altering the boot script to contain these variables and the following
modified SMP line results in a full CPU core/thread pass through:
```
CPU_SOCKETS="3"
CPU_CORES="2"
CPU_THREADS="2"
CPU_TOTAL="12"
```
The `-smp line` should read something like the following:
```
-smp "$CPU_TOTAL",cores="$CPU_CORES",sockets="$CPU_SOCKETS",threads="$CPU_THREADS",maxcpus="$CPU_TOTAL"
```
@taimaiduc did you want to add documentation or a link via PR about the CPU topology? Glad to see you got it working!
@sickcodes commented on GitHub (Apr 16, 2021):
@taimaiduc did you want to add documentation or a link via PR about the CPU topology? Glad to see you got it working!
@taimaiduc commented on GitHub (Apr 16, 2021):
Hi @sickcodes
**Error**
CPU_SOCKETS="3"
CPU_CORES="2"
CPU_THREADS="2"
CPU_TOTAL="12"
qemu-system-x86_64: Invalid CPU topology deprecated: sockets (3) * dies (1) * cores (4) * threads (2) != maxcpus (12)
I am running this command and it will be working
```
docker run -it \
--cpus=12 \
--device /dev/kvm \
-p 50922:10022 \
-v "${PWD}/macos.img:/image" \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e "DISPLAY=${DISPLAY:-:0.0}" \
-e RAM=16 \
-e SMP="12",cores="2",sockets="3",threads="1",maxcpus="12" \
sickcodes/docker-osx:naked
```
=>>>>
CPU_SOCKETS="3"
CPU_CORES="2"
CPU_THREADS="1"
CPU_TOTAL="12"

Not sure that is the correct or not
What do you think? @sickcodes
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @taimaiduc on GitHub (Apr 15, 2021).
OS related issued, please help us identify the issue by posting the output of this
Running
egrep -c '(svm|vmx)' /proc/cpuinfo
12
ERROR
@sickcodes commented on GitHub (Apr 15, 2021):
This should clear up the CPU limit questions https://github.com/kholia/OSX-KVM/blob/master/notes.md#pass-through-all-cpu-cores--threads
@sickcodes commented on GitHub (Apr 15, 2021):
Via @kholia
Pass through all CPU cores / threads
macOS requires a core count that is a power of 2, but some modern CPUs have odd
counts - like 6 cores and 12 threads.
So how can we harness the entire CPU in the VM?
There are strategies that mix smp/sockets/cores/threads/maxcpu arguments and
use odd socket counts to arrive at even core counts, and even let you specify
that some of the cores are hyperthreaded.
Specifically for the case of an Intel i7 processor with 6 cores and 12 total
threads, altering the boot script to contain these variables and the following
modified SMP line results in a full CPU core/thread pass through:
The
-smp lineshould read something like the following:@sickcodes commented on GitHub (Apr 16, 2021):
@taimaiduc did you want to add documentation or a link via PR about the CPU topology? Glad to see you got it working!
@taimaiduc commented on GitHub (Apr 16, 2021):
Hi @sickcodes
Error
CPU_SOCKETS="3"
CPU_CORES="2"
CPU_THREADS="2"
CPU_TOTAL="12"
qemu-system-x86_64: Invalid CPU topology deprecated: sockets (3) * dies (1) * cores (4) * threads (2) != maxcpus (12)
I am running this command and it will be working
=>>>>
CPU_SOCKETS="3"
CPU_CORES="2"
CPU_THREADS="1"
CPU_TOTAL="12"
Not sure that is the correct or not
What do you think? @sickcodes
@sickcodes commented on GitHub (Apr 28, 2021):
This might explain more:
https://github.com/thenickdude/KVM-Opencore/commit/d78b27e1ab86a299498fc3d832939ef14525e9de#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R74
https://github.com/Leoyzen/KVM-Opencore/issues/1#issuecomment-605390885