All of lore.kernel.org
 help / color / mirror / Atom feed
* Unable to pass multiple cores / CPUs to guests
@ 2012-01-29  8:05 Binarus
  2012-01-30 17:44 ` Jim Paris
  0 siblings, 1 reply; 3+ messages in thread
From: Binarus @ 2012-01-29  8:05 UTC (permalink / raw)
  To: kvm

Dear all,

it seems that I am unable to pass multiple cores / CPUs to KVM guests. Whatever I do, the guests only report one CPU / core.

Host hardware: Xeon E5620 on a Supermicro mainboard
Host software: Ubuntu 11.04 (Natty) 64-Bit

I have compiled my own (newer) kernel 2.6.37 for Natty (since I had certain problems with PCI passthrough if I used the standard kernel). I did not alter the other parts of the distribution; notably, I am using the original qemu-kvm package which was included.

Since virt-manager and the related tools were failing with unintelligible error messages when trying the very first basic action, I am starting the virtual machines by hand instead of using any wrappers / managers. I am using commands like this one:

/usr/bin/qemu-system-x86_64 -M pc -cpu host -smp cores=2,threads=1,sockets=1 -drive file=/dev/sda6,if=virtio,cache=none,index=0 -drive file=/dev/sdb,if=virtio,cache=none,index=1 -cdrom /dev/cdrom -pidfile ./qemu-garak.pid -boot c -k de -m 4096 -smp 1 -device pci-assign,host=01:05.0 -daemonize -usb -usbdevice "tablet" -name garak -net nic,vlan=0,model=virtio,macaddr=02:01:01:01:01:01 -net tap,vlan=0,ifname=virtnet1,script=/etc/qemu-ifup,downscript=/etc/qemu-ifup -vnc :1

I also have tried -cpu host and -smp cores=1,threads=1,sockets=2 (amongst other things).

I am running several Windows guests (Server 2003 R2 (32 Bit), Server 2008 R2 (64 Bit), Windows XP Pro (32 Bit), Windows 7 Pro (64 Bit)) and Linux guests (Ubuntu 11.10 (64 Bit), Debian squeeze (32 Bit)), but all of these only report one processor / core, regardless of the -smp settings; besides that, the setup works reliably.

Now, I really need additional CPU power in one of the guests, so I am wondering what I am doing wrong. Of course, I have read about changing the HAL within Windows and tried several things (Uniprocessor HAL vs. Multiprocessor HAL), but with no success. After having put a whole day into trying to solve the problem, I now don't know what else I could do.

Does anybody have any idea what is going wrong? Is there some kernel compile option (2.6.37) which may be responsible for not being able to pass multiple cores to the guests? Does the qemu-kvm version have to fit to the kernel version (there are no warning messages when I start the guests like shown above)?

Thank you very much,

Binarus

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Unable to pass multiple cores / CPUs to guests
  2012-01-29  8:05 Unable to pass multiple cores / CPUs to guests Binarus
@ 2012-01-30 17:44 ` Jim Paris
  2012-02-04  9:03   ` Binarus
  0 siblings, 1 reply; 3+ messages in thread
From: Jim Paris @ 2012-01-30 17:44 UTC (permalink / raw)
  To: Binarus; +Cc: kvm

Binarus wrote:
> Dear all,
> 
> it seems that I am unable to pass multiple cores / CPUs to KVM
> guests. Whatever I do, the guests only report one CPU / core.
...
> /usr/bin/qemu-system-x86_64 -M pc -cpu host -smp cores=2,threads=1,sockets=1 -drive file=/dev/sda6,if=virtio,cache=none,index=0 -drive file=/dev/sdb,if=virtio,cache=none,index=1 -cdrom /dev/cdrom -pidfile ./qemu-garak.pid -boot c -k de -m 4096 -smp 1 -device pci-assign,host=01:05.0 -daemonize -usb -usbdevice "tablet" -name garak -net nic,vlan=0,model=virtio,macaddr=02:01:01:01:01:01 -net tap,vlan=0,ifname=virtnet1,script=/etc/qemu-ifup,downscript=/etc/qemu-ifup -vnc :1

Remove the "-smp 1".

-jim

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Unable to pass multiple cores / CPUs to guests
  2012-01-30 17:44 ` Jim Paris
@ 2012-02-04  9:03   ` Binarus
  0 siblings, 0 replies; 3+ messages in thread
From: Binarus @ 2012-02-04  9:03 UTC (permalink / raw)
  To: kvm

Jim,

I just don't know how I could thank you! I have put multiple days into that problem and didn't remember nor see that I already have put -smp 1 later in the command. I think it would have cost me some more days or I would have been unable to solve the problem at all if you didn't give me that hint.

It's working like expected now; the guest sees and uses the additional CPU core, and the backup from encrypted drives to other encrypted drives is running much faster and with lower CPU load now.

An amusing aside: During my experiments, I had a set of parameters which made the Windows guest think it runs at 7.2 GHz (3 x 2.4 GHz where 2.4 GHz is the real clock rate of the host's CPU). Unfortunately, I can't remember the exact command, but I believe it roughly looked like ... -cpu qemu64 -smp2 ... -smp 1 ...

Regards,

Binarus


On 30.01.2012 18:44, Jim Paris wrote:
> Binarus wrote:
>> Dear all,
>>
>> it seems that I am unable to pass multiple cores / CPUs to KVM
>> guests. Whatever I do, the guests only report one CPU / core.
> ...
>> /usr/bin/qemu-system-x86_64 -M pc -cpu host -smp cores=2,threads=1,sockets=1 -drive file=/dev/sda6,if=virtio,cache=none,index=0 -drive file=/dev/sdb,if=virtio,cache=none,index=1 -cdrom /dev/cdrom -pidfile ./qemu-garak.pid -boot c -k de -m 4096 -smp 1 -device pci-assign,host=01:05.0 -daemonize -usb -usbdevice "tablet" -name garak -net nic,vlan=0,model=virtio,macaddr=02:01:01:01:01:01 -net tap,vlan=0,ifname=virtnet1,script=/etc/qemu-ifup,downscript=/etc/qemu-ifup -vnc :1
> 
> Remove the "-smp 1".
> 
> -jim
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-04  9:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-29  8:05 Unable to pass multiple cores / CPUs to guests Binarus
2012-01-30 17:44 ` Jim Paris
2012-02-04  9:03   ` Binarus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.