CPU: Invalid CPU topology deprecated: sockets (0) * dies (1) * cores (8) * threads (1) != maxcpus (4) #170

Closed
opened 2025-12-29 00:19:27 +01:00 by adam · 5 comments
Owner

Originally created by @taimaiduc on GitHub (Apr 15, 2021).

OS related issued, please help us identify the issue by posting the output of this

image

Running

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 CORES=8 \
    sickcodes/docker-osx:naked

egrep -c '(svm|vmx)' /proc/cpuinfo
12

ERROR

+ exec qemu-system-x86_64 -m 16000 -cpu Penryn,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check -machine q35,accel=kvm:tcg -smp 4,cores=8 -usb -device usb-kbd -device usb-tablet -device 'isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc' -drive if=pflash,format=raw,readonly,file=/home/arch/OSX-KVM/OVMF_CODE.fd -drive if=pflash,format=raw,file=/home/arch/OSX-KVM/OVMF_VARS-1024x768.fd -smbios type=2 -audiodev alsa,id=hda -device ich9-intel-hda -device hda-duplex,audiodev=hda -device ich9-ahci,id=sata -drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore-nopicker.qcow2 -device ide-hd,bus=sata.2,drive=OpenCoreBoot -drive id=MacHDD,if=none,file=/image,format=qcow2 -device ide-hd,bus=sata.4,drive=MacHDD -netdev user,id=net0,hostfwd=tcp::10022-:22,hostfwd=tcp::5900-:5900, -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:09:49:17 -monitor stdio -vga vmware
qemu-system-x86_64: Invalid CPU topology deprecated: sockets (0) * dies (1) * cores (8) * threads (1) != maxcpus (4)
Originally created by @taimaiduc on GitHub (Apr 15, 2021). # OS related issued, please help us identify the issue by posting the output of this ![image](https://user-images.githubusercontent.com/10907980/114842504-1a674c80-9e03-11eb-815b-1fe8b3c7cce8.png) Running ``` 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 CORES=8 \ sickcodes/docker-osx:naked ``` **egrep -c '(svm|vmx)' /proc/cpuinfo 12** ERROR ``` + exec qemu-system-x86_64 -m 16000 -cpu Penryn,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check -machine q35,accel=kvm:tcg -smp 4,cores=8 -usb -device usb-kbd -device usb-tablet -device 'isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc' -drive if=pflash,format=raw,readonly,file=/home/arch/OSX-KVM/OVMF_CODE.fd -drive if=pflash,format=raw,file=/home/arch/OSX-KVM/OVMF_VARS-1024x768.fd -smbios type=2 -audiodev alsa,id=hda -device ich9-intel-hda -device hda-duplex,audiodev=hda -device ich9-ahci,id=sata -drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore-nopicker.qcow2 -device ide-hd,bus=sata.2,drive=OpenCoreBoot -drive id=MacHDD,if=none,file=/image,format=qcow2 -device ide-hd,bus=sata.4,drive=MacHDD -netdev user,id=net0,hostfwd=tcp::10022-:22,hostfwd=tcp::5900-:5900, -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:09:49:17 -monitor stdio -vga vmware qemu-system-x86_64: Invalid CPU topology deprecated: sockets (0) * dies (1) * cores (8) * threads (1) != maxcpus (4) ```
adam added the documentation label 2025-12-29 00:19:27 +01:00
adam closed this issue 2025-12-29 00:19:27 +01:00
Author
Owner

@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): This should clear up the CPU limit questions https://github.com/kholia/OSX-KVM/blob/master/notes.md#pass-through-all-cpu-cores--threads
Author
Owner

@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"
@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" ```
Author
Owner

@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!

@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!
Author
Owner

@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"

image

Not sure that is the correct or not

What do you think? @sickcodes

@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" ![image](https://user-images.githubusercontent.com/10907980/114973403-9bc5ea00-9eaa-11eb-843a-7b2b54adb48b.png) Not sure that is the correct or not What do you think? @sickcodes
Author
Owner
@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
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Docker-OSX#170