Custom kvm -smp argument

pabloo

New Member
Nov 4, 2020
4
1
1
36
Hello,

Is it possible to customise how Proxmox generates the kvm -smp argument for CPU configuration?

I'm running Proxmox 6.2-15 on a 6-core 2018 Mac Mini and I'm and trying to use all 12 available threads on a macOS Catalina VM.

macOS has some limitations on CPU configurations and non-supported configurations won't boot. I can boot with 1-cpu/8-cores, but it won't boot if I select 12-cores. I have a similar problem on a 2x6-core 2010 MacPro in which 16-cores will work but 24 won't.

qm showcmd ID shows -smp '12,sockets=1,cores=12,maxcpus=12' when I select 12 cores and macOS does not boot, but if I manually run the command replacing -smp with -smp '12,cores=1' macOS does boots and it recognises all CPUs.

I tried most permutations from the CPU configuration UI but I could not get it to generate the required -smp parameter.
Is there any way I can customise it? I also tried adding it to args: in the VM .conf file but it does not work due to the other CPU configs. If I remove the CPU config from the .conf Proxmox still generates -smp with 1 core.

Thank you!
 
hi,

just set the cpulimit option in the GUI: VM -> Hardware -> Processor -> Advanced -> cpu limit

for example setting it to 1, reboot the VM and use showcmd to check you'll see it being set -smp 1
 
If I set cpulimit to 12 and cores to 1 I get -smp '1,sockets=1,cores=1,maxcpus=1'
If I set cpulimit to 12 and cores to 12 I get -smp '12,sockets=1,cores=12,maxcpus=12'

What I actually need is -smp '12,cores=1' (not sure what this macOS limitation is about).
I haven't tested it but probably adding sockets=1,maxcpus=12 will also work.

I'm okay if this can't be set from the UI, but maybe there's some .conf option I could use to make it persistent? If I could prevent Proxmox from adding -smp when cores: and sockets: is missing then I could add it to args:.

Thanks oguz, I know this is probably not a supported use case.
 
can you send the output of the full command line and your vm config?

qm config VMID and qm showcmd VMID. also pveversion -v could help.
 
Yes, thank you.

qm config 100 (with working 8-core config)
Code:
args: -device isa-applesmc,osk="redacted" -smbios type=2 -cpu Penryn,kvm=on,vendor=GenuineIntel,+kvm_pv_unhalt,+kvm_pv_eoi,+invtsc,vmware-cpuid-freq=on,+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check -device usb-kbd,bus=ehci.0,port=2
balloon: 0
bios: ovmf
boot: cdn
bootdisk: sata0
cores: 8
cpu: Penryn
efidisk0: local-lvm-nvme:vm-100-disk-0,size=4M
machine: q35
memory: 28672
name: catalina
net0: vmxnet3=62:C0:85:EB:D3:A7,bridge=vmbr0,firewall=1
numa: 0
onboot: 1
ostype: other
sata0: local-lvm-nvme:vm-100-disk-1,cache=unsafe,discard=on,size=400G,ssd=1
scsihw: virtio-scsi-pci
smbios1: uuid=aa5d96ac-a111-43ec-b3e9-dcd4d509baa6
sockets: 1
vga: vmware
vmgenid: d2132395-ac66-4409-a813-4b489e6b66ac

qm showcmd 100
/usr/bin/kvm -id 100 -name catalina -chardev 'socket,id=qmp,path=/var/run/qemu-server/100.qmp,server,nowait' -mon 'chardev=qmp,mode=control' -chardev 'socket,id=qmp-event,path=/var/run/qmeventd.sock,reconnect=5' -mon 'chardev=qmp-event,mode=control' -pidfile /var/run/qemu-server/100.pid -daemonize -smbios 'type=1,uuid=aa5d96ac-a111-43ec-b3e9-dcd4d509baa6' -drive 'if=pflash,unit=0,format=raw,readonly,file=/usr/share/pve-edk2-firmware//OVMF_CODE.fd' -drive 'if=pflash,unit=1,format=raw,id=drive-efidisk0,size=131072,file=/dev/vmdata/vm-100-disk-0' -smp '8,sockets=1,cores=8,maxcpus=8' -nodefaults -boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' -vnc unix:/var/run/qemu-server/100.vnc,password -cpu 'Penryn,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,vendor=GenuineIntel' -m 28672 -readconfig /usr/share/qemu-server/pve-q35-4.0.cfg -device 'vmgenid,guid=d2132395-ac66-4409-a813-4b489e6b66ac' -device 'usb-tablet,id=tablet,bus=ehci.0,port=1' -device 'vmware-svga,id=vga,bus=pcie.0,addr=0x1' -iscsi 'initiator-name=iqn.1993-08.org.debian:01:f1ae8612507a' -device 'ahci,id=ahci0,multifunction=on,bus=pci.0,addr=0x7' -drive 'file=/dev/vmdata/vm-100-disk-1,if=none,id=drive-sata0,cache=unsafe,discard=on,format=raw,aio=threads,detect-zeroes=unmap' -device 'ide-hd,bus=ahci0.0,drive=drive-sata0,id=sata0,rotation_rate=1,bootindex=100' -netdev 'type=tap,id=net0,ifname=tap100i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown' -device 'vmxnet3,mac=62:C0:85:EB:D3:A7,netdev=net0,bus=pci.0,addr=0x12,id=net0,bootindex=300' -machine 'type=q35+pve0' -device 'isa-applesmc,osk=redacted' -smbios 'type=2' -cpu 'Penryn,kvm=on,vendor=GenuineIntel,+kvm_pv_unhalt,+kvm_pv_eoi,+invtsc,vmware-cpuid-freq=on,+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check' -device 'usb-kbd,bus=ehci.0,port=2'

pveversion -v
Code:
proxmox-ve: 6.2-2 (running kernel: 5.4.65-1-pve)
pve-manager: 6.2-15 (running version: 6.2-15/48bd51b6)
pve-kernel-5.4: 6.2-7
pve-kernel-helper: 6.2-7
pve-kernel-5.4.65-1-pve: 5.4.65-1
pve-kernel-5.4.34-1-pve: 5.4.34-2
ceph-fuse: 12.2.11+dfsg1-2.1+b1
corosync: 3.0.4-pve1
criu: 3.11-3
glusterfs-client: 5.5-3
ifupdown: 0.8.35+pve1
ksm-control-daemon: 1.3-1
libjs-extjs: 6.0.1-10
libknet1: 1.16-pve1
libproxmox-acme-perl: 1.0.5
libpve-access-control: 6.1-3
libpve-apiclient-perl: 3.0-3
libpve-common-perl: 6.2-2
libpve-guest-common-perl: 3.1-3
libpve-http-server-perl: 3.0-6
libpve-storage-perl: 6.2-9
libqb0: 1.0.5-1
libspice-server1: 0.14.2-4~pve6+1
lvm2: 2.03.02-pve4
lxc-pve: 4.0.3-1
lxcfs: 4.0.3-pve3
novnc-pve: 1.1.0-1
proxmox-backup-client: 0.9.4-1
proxmox-mini-journalreader: 1.1-1
proxmox-widget-toolkit: 2.3-6
pve-cluster: 6.2-1
pve-container: 3.2-2
pve-docs: 6.2-6
pve-edk2-firmware: 2.202002-1
pve-firewall: 4.1-3
pve-firmware: 3.1-3
pve-ha-manager: 3.1-1
pve-i18n: 2.2-2
pve-qemu-kvm: 5.1.0-4
pve-xtermjs: 4.7.0-2
qemu-server: 6.2-18
smartmontools: 7.1-pve2
spiceterm: 3.1-1
vncterm: 1.6-2
zfsutils-linux: 0.8.4-pve2
 
thanks.
you can take a look here[0] to make it easier to pass the cpu flags.

and then adding smp through that or args: could work.

you could also experiment with the available options in the cpu settings, like vCPU and socket/core count.

[0]: https://pve.proxmox.com/wiki/Manual:_cpu-models.conf
 
Thanks, I read the manual but I couldn't figure out how smp could be added to a custom CPU model.

I also tried adding smp to args: but then the command line gets two -smp arguments and depending on what I select from the UI I get different errors starting the VM:
  1. Selecting 1 core from the UI.
    kvm ... -smp '1,sockets=1,cores=1,maxcpus=1' ... -smp '12,cores=1'
    kvm: maxcpus must be equal to or greater than smp
  2. Selecting 12 cores from the UI
    kvm ... -smp '12,sockets=1,cores=12,maxcpus=12' ... -smp '12,cores=1'
    macOS doesn't boot
 
  • Like
Reactions: xrr
Confirming what pabloo ran into, trying to set smp args will result in a first smp argument coming from proxmox vm settings (core, sockets, virtual cpu as reflected by UI) and then last arg will be the "custom" -smp argument as passed by "sudo qm set 100 --args '-smp 1,sockets=2,cores=16,threads=2,maxcpus=64" or alike...

I failed trying to allow my vms to see the 32 core x 2 threads instead of 64 "plain" cores;
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!