USB Passthrough / High CPU Load

Jan 9, 2012
282
2
18
Hi,

i want to passthrough a "HASP" USB-Device to a Windows-XP VM.
I add "usb0: host=2-1.4" to the conf File and it works, but now the VM has a very High CPU Load (~95%).
If i boot the VM without "usb0: host=2-1.4" and add the Device via the "Monitor" with "device_add usb-host,hostbus=2,hostport=1.4", it works too and the CPU Load is normal!?


root@proxmox-hb:~# pveversion -v
pve-manager: 2.3-13 (pve-manager/2.3/7946f1f1)
running kernel: 2.6.32-19-pve
proxmox-ve-2.6.32: 2.3-93
pve-kernel-2.6.32-16-pve: 2.6.32-82
pve-kernel-2.6.32-19-pve: 2.6.32-93
lvm2: 2.02.95-1pve2
clvm: 2.02.95-1pve2
corosync-pve: 1.4.4-4
openais-pve: 1.1.4-2
libqb: 0.10.1-2
redhat-cluster-pve: 3.1.93-2
resource-agents-pve: 3.9.2-3
fence-agents-pve: 3.1.9-1
pve-cluster: 1.0-36
qemu-server: 2.3-18
pve-firmware: 1.0-21
libpve-common-perl: 1.0-49
libpve-access-control: 1.0-26
libpve-storage-perl: 2.3-6
vncterm: 1.0-3
vzctl: 4.0-1pve2
vzprocps: 2.0.11-2
vzquota: 3.1-1
pve-qemu-kvm: 1.4-8
ksm-control-daemon: 1.1-1
 
Anyone?

Adding "usb0: ***" to my configs crashes Proxmox.
Args usb-echi needs balloon:0 since 2.3.


Would like trendco be able to automate device_add since i boot UnRaid in a VM from usb-stick.





A work-around for you to try trendco

(in conf)
balloon:0
args: -device usb-ehci,id=ehci -device usb-host,bus=ehci.0,hostbus=1,hostport=1 usb0: host=2-1.4
 
The difference is USB2.0/1.1 mode.
Adding the device redirection to the conf-file enables USB2.0, while manual adding only connects as USB1.1 and prevents the usbport.sys bug to trigger (high interrupt load)

I'm having the same Problem with an HASP-Dongle and Windows 2008. USB2.0 creates extremely high CPU load due to >1000 interrupts/sec. Load is ~40-50% but the system gets painfully unresponsive.
Currently i'm running a script from the windows-machine which uses WinSCP to connect to its host and runs the "qm set device_add" command. Not very elegant, but it works...


BTW: can anybody reveal the secrets of the "device_del" syntax to me? I couldn't find anything about the syntax to remove an usb-device, also the device_add variant with "vendorid=xxxx,productid=xxxx" stopped working...

device to remove (connected via option in the config file):
Device 1.1, Port 1, Speed 1.5 Mb/s, Product HASP HL 3.25


qm> info usbhost
Bus 3, Addr 3, Port 2, Speed 1.5 Mb/s
Vendor Specific: USB device 0529:0001, HASP HL 3.25
Auto filters:
Bus *, Addr *, Port *, ID 0529:0001


qm> device_del usb-host,vendorid=0529,productid=0001
Device 'usb-host,vendorid=0529,productid=0001' not found

and:

qm> device_del usb-host,hostbus=3,hostport=2
Device 'usb-host,hostbus=3,hostport=2' not found
 
Last edited:
The Problem still exists in Proxmox-3.1 :(
Passthrough a USB Device by adding "usb0: host=1-1.6" in conf File -> 90-100% CPU Load in Windows VM (XP 32)
Is there still no solution?
 
The difference is USB2.0/1.1 mode.
Adding the device redirection to the conf-file enables USB2.0, while manual adding only connects as USB1.1 and prevents the usbport.sys bug to trigger (high interrupt load)

I'm having the same Problem with an HASP-Dongle and Windows 2008. USB2.0 creates extremely high CPU load due to >1000 interrupts/sec. Load is ~40-50% but the system gets painfully unresponsive.
Currently i'm running a script from the windows-machine which uses WinSCP to connect to its host and runs the "qm set device_add" command. Not very elegant, but it works...


BTW: can anybody reveal the secrets of the "device_del" syntax to me? I couldn't find anything about the syntax to remove an usb-device, also the device_add variant with "vendorid=xxxx,productid=xxxx" stopped working...

device to remove (connected via option in the config file):
Device 1.1, Port 1, Speed 1.5 Mb/s, Product HASP HL 3.25


qm> info usbhost
Bus 3, Addr 3, Port 2, Speed 1.5 Mb/s
Vendor Specific: USB device 0529:0001, HASP HL 3.25
Auto filters:
Bus *, Addr *, Port *, ID 0529:0001


qm> device_del usb-host,vendorid=0529,productid=0001
Device 'usb-host,vendorid=0529,productid=0001' not found

and:

qm> device_del usb-host,hostbus=3,hostport=2
Device 'usb-host,hostbus=3,hostport=2' not found

I'm using a USB device (well, it's a USB PCMCIA card writer) with a conf file setting of
usb1: host=0781:5406
and I don't see any high CPU activity in Windows XP.

I have found that the syntax...

device_add usb-host,id=whateveryouwant,vendorid=0x0461,productid=0x0010

(note you need 0x in front of the vendorid and prodictid)
...works from the monitor and to get rid of the device use:

device_del whateveryouwant

So you have to give some kind of identifier when you add the device so you can use it to remove it.
I haven't tried the bus - port syntax.




 
Hi,
when you add usbX: in config file, proxmox create an usb2 controller

when you do

"device_add usb-host,id=whateveryouwant,vendorid=0x0461,productid= 0x0010"

it's add an usb1 device on default uhci controller. (usb1)

This is the difference.

Maybe usb2 generate more interrupts, that could explain the difference of cpu.
 
Can i anyway use the config file to create a usb1 Controller?
I passthrough a USB-ISDN Device (FritzCrad-USB-2.1) for a Fax-Server and it must be done automatically on startup.
 
I just checked. We have a Windows XP VM that has the USB device connected to it with the entry in the conf file, not via the monitor. So it has a USB 2.0 hub. The CPU utilisation reported by the VM itself is around 1-2% when you are not doing anything. From the web interface, it reports around 14% CPU. I have also noticed a discrepancy between what the VM reports and what the web interface reports on both XP and Windows 7 with or without and USB devices. For example, I have a Windows 7 machine running at around 38% and the web interface reports 46%. I have another Windows 7 VM that reports 0% in TaskManager, but a steady 4% on the web interface.

The USB device I have attached is not a dongle. Maybe it's the dongle driver that's the problem?
 
proxmox gui show cpu used on host. (that mean cpu used in guest + cpu for interrupts)

windows show only cpu is used in the vm.

usb can send a lot of interrupts (depend of the devices), that explain the difference of cpu that you see.
 
Win7 / 2008 R2 is fine with USB2.0 - everything older (XP, 2008 "R1") chokes on its own interrupts when using *some* devices via USB2.0.
Interestingly a naked, unpatched install of 2008 I set up for testing did not show this behavior, but on the other day after it finally finished updating and I rebooted the VM, it again generated thousands of interrupts per second... So M$ definately broke the 2.0 support within KVM with one of their updates
 
I've done some Tests and found the Problem.
In my case, it is the Virtio Network-Driver (0.1-52) !!!

Virtio Network Device (0.1-52) / without USB Passthrough -> CPU Load normal
Virtio Network Device (0.1-52) / USB Passthrough -> CPU Load ~90%
rtl8139 Network Device / USB Passthrough -> CPU Load normal
rtl8139 Network Device / Virtio Hard Disk (0.1-52) / USB Passthrough -> CPU Load normal
Virtio Network Device (0.1-65) / USB Passthrough -> CPU Load normal !
Virtio Network Device (0.1-65) / Virtio Hard Disk (0.1-52) / USB Passthrough -> CPU Load normal !

So i hope that there will be soon a new stable Virtio Driver.
 
I'm not using virtio network drivers (win 2008 lost its network on 2 out of 3 reboots with virtio net) plus all drives are connected via IDE -> problem still persistent.
 
I'm not using virtio network drivers (win 2008 lost its network on 2 out of 3 reboots with virtio net) plus all drives are connected via IDE -> problem still persistent.

I think that Windows loads all the drivers in the system\drivers folder, even if they are not used. I just looked at mine using http://www.nirsoft.net/utils/driverview.html and there are loaded drivers that I am not using. Maybe when you changed the driver you didn't delete it as well, but left it there? It may still be loaded and causing problems. Just a thought.
 
The Test-VM I mentioned didn't had any virtio drivers installed but burned to death after running windows updates and connecting the HASP dongle via USB2.0.
Thanks for your efforts, but as far as i verified the problem it is connected to some windows updates which broke some drivers... But it seems like a common problem on vista/2008 machines - often/mostly related to ACPI- or the usbsys drivers. At least you could read for weeks through google results on this topic. It's not working properly on bare-metal installations, so it won't work in a VM as well...

I've migrated nearly all services from the 2008 machine to the 2008 R2 and i've given up on messing around with this bug-infested "operating system". As soon as the last services are migrated there is only one windows server left in my network and until now the R2 server was at least more stable and caused much less trouble than the 2008 (within a VM or as bare metal install)...
 

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!