So an update on this that I just discovered and I will update the guide with it:
What you found is normal. In kernel 4.8 there are changes which help with IOMMU separation, and that random PCI controller you see in that group is normal. I have the same thing. I have it working without the ACS patch on kernel 4.8!
Yeah, I was going to mention that. Mine works that way as well.
I do need some help with CPU pinning, because for some reason itās fighting me. I have never had a problem with pinning before, so I donāt understand what the problem is.
Also, I think I may have found the issue that was causing the VM to not boot, and it was in the config file. It caused the new VM to not boot as well.
Iāll elaborate tomorrow sometime. Been a long couple days at work and I am tired.
Iām still testing my virt manger config but for my audio issues I tried that config and still had problems and then used then the recommendations on this page and worked for me.
After you said that, I did some more tests and it worked the first time, after shutting down the vm a starting the vm up I would always cause audio jitter even if I restarted the vm or rebooted the pc.
Using all the suggested audio parameters mentioned on the link works every time.
I am also using archlinux and not debian which may be cause, but it can also be difference in hardware.
I donāt know why that works now, because I am almost certain that I tried that exact setup a few times and it didnāt work. Maybe it has something to do with the spacing. I donāt know. I was trying to get this setup the entire time, making variations in the first line and it kept taking two or three cores out of the cputune section.
All I know is that my VM boots and Windows shows that it has 2 cores and 2 threads available.
Everything worked as expected up to āthe fun partā but then when I try to start virt-manager I get this error.
Unable to connect to libvirt.
Verify that the ālibvirtdā daemon is running. (It is.) Libvirt URI is: qemu:///system
Traceback (most recent call last):
File ā/usr/share/virt-manager/virtManager/connection.pyā, line 904, in _do_open
self._backend.open(self._do_creds_password)
File ā/usr/share/virt-manager/virtinst/connection.pyā, line 148, in open
open_flags)
File ā/usr/lib/python2.7/dist-packages/libvirt.pyā, line 105, in openAuth
if ret is None:raise libvirtError(āvirConnectOpenAuth() failedā) libvirtError: Failed to connect socket to ā/var/run/libvirt/libvirt-sockā: No such file or directory
Iām using Debian Stretch with all updates. I have two questions about the quoted lines in bold.
I have uri_default = āqemu:///sessionā in /etc/libvirt/libvirt.conf and not commented, so why does virt-manager report that the URI is qemu:///system in this error message?
The last quoted line, about /var/run/libvirt/libvirt-sock, shows up in a lot of Google results dating back several years, and there seem to be multiple underlying causes, possibly varying with versions of libvirt & virt-manager. So far, I have continued to see the /var/run/libvirt/libvirt-sock error even after creating the missing file then giving it ownership & permissions that I expected to work based on what Iāve read so far:
You should be running libvirt as root. To connect to it you also have to run virtmanager as root. When you open it it should ask you for your password (or the root account). If not it wonāt be able to connect to it.
So make sure you have libvirt running as root and you have escalated the GUI to the proper level as well.
Thanks for creating this Gray! Iāve been doing passthrough for about a year now and spent a lot of time tuning certain things, such as adding IO threads, tuning storage parameters (I ended up settling on a raw image, cache none IO mode native as it was fastest), but the one thing I couldnāt find a lot of information on was audio. I have a wireless USB headset and at first I was passing that through to use for audio but I knew there had to be a way to have it be able to play on my speakers as well which is how I found out about doing it with spice. I was using a spice channel with the spice guest tools for audio for quite some time, and that worked really well, but I was also forced to have basically a second screen due to it , if I removed it from virt-manager it would just add it back, and sometimes it would change the resolution on my monitor before/after logging in, or it wouldnāt show up on my monitor at all but rather inside the QEMU window that you could open from virt-manager. I did have that display āturned offā, Iād disable the Microsoft Basic Adapter that would show up and it would eventually be enabled again. The pulse audio solution is much more elegant and I stressed the VM and it was still playing fine, only when I ran stress-ng on the host did it have some issues.
I donāt use the extra command line arguments that youāve listed right at the end of the tutorial, I just removed the hyper V sections and added the other format to hide KVM and set CPU to host. Iāve also enabled suspend to memory and suspend to disk.
Yes it is. As long as I suspend/hibernate the VM before I put the host to sleep (I donāt shut down often) I can just start it back up. I even pass through my USB 3.1 controller so I can use my KVM display port switch and when I hibernate the VM since it āshuts offā the USB controller gets passed back to the host. When I sleep/suspend to mem the VM goes into suspend mode in virt-manager, but I canāt recall if it breaks after I put the host to sleep or not, I think it still turns on fine. To wake it back up from sleep/suspend to mem I have to use dompmwakeup from a virsh terminal.
@lessaj Awesome, thanks for the info. Iāve been trying to figure that out for a while.
Now, Iām having some issues with a recently acquired fury that Iām trying to pass through in place of my 970. libvirt keeps giving me device in use errors when I try to start the VM and when it passes through, Iām able to use it as long as I donāt have the AMD drivers installed.
I went through the whole vfio-pci attachment process again, and Iām sitting here scratching my head. I even created a new domain in libvirt.
For the record, Iām using the arch-vfio kernel and I had more luck with an nvidia card than an amd one. My host card is a r9 380, Iām wondering if amdgpu is causing issues trying to bind to the fury, even after we attached vfio-pci to it.
Iām considering swapping in my 970 as the host device for now, but I hate nvidia cards in Linux with a passion. Any advice would be awesome. Iāve been scratching my head on this one for a while, and Iād rather not nuke and pave.
You canāt have the Nvidia or AMD drivers loaded on the host. The drivers will interfere with vfio. Look up blacklisting modules for specific pci devices, as well as the XEN pci stub module. One of those might help.
I was not able to get audio properly working no matter what I tried and just decided to pass the onboard sound to the VM using virt manager (black listing not required). This worked without issues to my surprise and I was able to install my onboard sound drivers to the VM and get the full 5.1 audio. Of course when the VM is running there is no sound to the host but as soon as the VM is shutdown the host regains audio with no problems. I would have liked to have audio working on both at the same time but I can live with it, as the VMās only usage is for gaming.
The other option would have been to get a second sound card and pass that through to the VM but this would require the use of some sort of audio mixer as I would now have to connect 2 sound cards to one set of speakers. This was just further complicating the setup and adding cost so I gave up on this option for now.
I noticed that on my āpassed throughā GPU the fans stay on permanently until the windows VM is first started. The fans then stay off after the windows VM is shut down. Is there a way to remedy this or is this just how it works at the moment?
Also AMD 8350 users who have this setup working properly, please share your CPU topology:-). I have been testing out different socket and thread combinations on virt manager but I have gotten horrible performance on my VM with all the combinations I tried so far. I havenāt looked into CPU pinning yet, if that is what is required to get this working properly.