RX 480 hangs in D3 power state whenever *buntu VM shuts down


Recommended Posts

Hi everyone,

 

I have been using unRAID since 6.1.8, and I truly adore it. Currently I am running 6.3.5 and I have been using a Windows 10 VM as a daily desktop, and it's been marvelous -- with the exception of having to use Windows as a desktop OS. As I learn more Linux commands and as I learn about more FOSS projects, I am interested in getting my hardware working with an OS that is a bit more reliable and less riddled with spyware. However, when I have built different VMs with versions of Ubuntu, I find that I have the same problem with my RX 480:

 

When I start the shutdown process in a *nix VM, the Ubuntu/Kubuntu logo hangs on the screen and I am forced to destroy the VM instance. After force-stopping the VM, my GPU becomes unavailable, and QEMU spits out an error about the PCI device being stuck in a D3 power state. The only thing that works at this point is a full system restart.

As I was testing an install of Antergos, I found this related post on the Arch forums.

 

related passage:

"When the VM shuts down, all devices used by the guest are deinitialized by its OS in preparation for shutdown. In this state, those devices are no longer functional and must then be power-cycled before they can resume normal operation. Linux can handle this power-cycling on its own, but when a device has no known reset methods, it remains in this disabled state and becomes unavailable. Since Libvirt and Qemu both expect all host PCI devices to be ready to reattach to the host before completely stopping the VM, when encountering a device that won't reset, they will hang in a "Shutting down" state where they will not be able to be restarted until the host system has been rebooted. It is therefore recommended to only pass through PCI devices which the kernel is able to reset, as evidenced by the presence of a reset file in the PCI device sysfs node, such as /sys/bus/pci/devices/0000:00:1a.0/reset. "

 

My question: Is there a simple solution to this problem? or will I be forced to patch the unRAID kernel to reset my GPU?

Link to comment

Have you watched @gridrunner's video series of VMs and passthrough.

 

I know he is primarily a Nvidia guy, there may be some hints about Radeon. Or you might reach out to him for assistance. He is excellent with regards to passthrough and all things VM.

 

The other option is @jonp. He is with LimeTech and not always on the forums, but was the innovator of the VM passthrough, and may have some ideas.

 

I would suggest posting a diagnostics file from after the failure and before the reboot. (Tools -> Diagnostics, or run "diagnostics" from the unRAID command line).

Link to comment

@bjp999 can you link me to anything specific? I'm not sure I know where to look for the videos you mentioned.

 

@saarg my windows10 vm is virtually flawless (that was a pun) and I don't have any significant problems with it. I am primarily interested in your experience using the RX 480 in a Ubuntu vm. Please let me know how things work out for you! I have been able to boot and update Ubuntu 16.04.02, but the AMDGPU-PRO install script crashes the VM. Kubuntu 17.04 is stable with the open source AMDGPU driver, and some restart commands work just fine, such as

sudo shutdown -r now

but shutting down a vm via KDE or xfce launcher menu will hang the shutdown process and the *ubuntu logo will flash on my monitor with no options for input. I am fairly certain I have found the issue, but I cannot find a solution. Weird, right?

Edited by bearcat2004
Link to comment
5 hours ago, bearcat2004 said:

@bjp999 can you link me to anything specific? I'm not sure I know where to look for the videos you mentioned.

 

 

@bearcat2004 @gridrunner

 

The two part one - first one on the daily driver without passthrough, and second one on converting it into a gaming VM with passthrough are particularly good. 

 

Also, the three part series on the performance enhancement cover a lot of performance tuning on Dockers and VMs. The first one includes a tip that will increase your CPU performance by ~10%. The second and third are very helpful on tuning VMs and Dockers respectively.

 

Here is a link to his youtube channel. Most of them concerning VM, passthrough and/or Dockers.

 

https://www.youtube.com/channel/UCZDfnUn74N0WeAPvMqTOrtA

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.