AMD Ryzen 5600G iGPU code 43 error

Yes, like I said without vendor-reset qemu will refuse to start because of "pci_hp_register failed with error -16" when you start it the second time, which is the reset bug. And for me it never worked the first time in the first place without vendor-reset it was 100% broken.

Like I said I can now restart Qemu however often I need because of adding 5600G iGPU product ID (0x1638) to vendor reset.

I said this right in the first post I made.

On the other hand to get rid of Code 43, use Niemez driver with mentioned options/versions + Qemu UEFI + VBIOS file (+ other mentioned stuff?)

Then to get rid of possible host crash bug only when Qemu starts, use Virtual-Display-Driver instead of plugging in physical display / dummy cable.

= works 100%

(One detail that doesn't work but that of course is to be expected: when I suspend the host PC to memory while VM is running, the iGPU will no longer work after I wake the host PC up. And this persists even after I restart Qemu. I had mixed success fixing this with a combo of PCIe reset while the amdgpu driver was loaded & rebound, which requires you to power off VM of course - not totally sure about this yet - Naturally it only makes sense to solve this problem, by blocking suspend when VM is active. So you don't need a script that fixes broken state like this, because either way you can't suspend host PC while VM is running. It would be pointless.)
 
Last edited:
I don't know what I've done differently except for the entries in grub. But it seems to work now. I am thrilled.

Thanks a lot!
 

Attachments

  • 1733695012823.png
    1733695012823.png
    598.3 KB · Views: 30
  • Like
Reactions: ballerburg9005
In vendor-reset add the following line to src/device-db.h (use lspci -nnk to get this number for GPU, e.g. 1002:1638) after #define _AMD_NAVI10(op) \:


Then you can also add your vendor id to 99-vendor-reset.rules, which you have to copy to /etc/udev/rules.d/ by hand... or you can do the same by hand in vm script:

Amazing. By add 2 lines to vendor-reset, it actully works on my AMD 5600G, linux or Windows VM can reboot over and over again without rebooting the whole machine.

Big thanks to you! :D

By the way, I don't need the Niemez driver, just install the official driver on amd.com, it works fine.
 
Last edited:
I am trying to get this accomplished but I am lost on the vendor-reset part. Is there something to explain getting into that part?
Edit: I have gotten the vendor-reset all setup and I am able to install the official drivers but get error 43. Do we still need to add the rom as well as the second line I do not have 99.vender.reset.rules I have 60.vender.reset.rules how do I add this I cannot edit it? I have 3 guides total I am following from. Seeing error 43 and seeing the Drivers installed gives me a little hope. I am using the 5600G on a Asrock X300W Tiny PC I have all the bios settings configured as this machine has been in service for about 3 years now. I was just JUST about to switch to an INTEL based machine to make it easier I do not really want to now that I seen this! Thank
 
Last edited:
I am trying to get this accomplished but I am lost on the vendor-reset part. Is there something to explain getting into that part?
Edit: I have gotten the vendor-reset all setup and I am able to install the official drivers but get error 43. Do we still need to add the rom as well as the second line I do not have 99.vender.reset.rules I have 60.vender.reset.rules how do I add this I cannot edit it? I have 3 guides total I am following from. Seeing error 43 and seeing the Drivers installed gives me a little hope. I am using the 5600G on a Asrock X300W Tiny PC I have all the bios settings configured as this machine has been in service for about 3 years now. I was just JUST about to switch to an INTEL based machine to make it easier I do not really want to now that I seen this! Thank
Please read my posts, they contain all the steps required.

Checklist off the top of my head:

* set up vfio-pci which involves changing kernel cmd line in grub amongst other things
* recompile and load/install vendor-reset as described early to get rid of reset bug
* reinstall Windows in UEFI mode in VM, if not aleady UEFI (probably not)
* load UEFI ROM image linked in this thread (which does not work with Windows VM that's not booting as UEFI)
* do all sorts of other steps required for vfio-pci, as per other tutorials, like change VM command
* if and only if you did all those steps, possibly using Niemez driver with mentioned options can get rid of Error 43 (but regular drv might work out of the box)

I must also warn people that I noticed that my home PC would crash every few days since I used vendor-reset. But I believe even blacklisting vendor-reset did not fix it, so I removed VFIO-PCI entirely eventually and since then I had no issues. Not 100% sure where this bug came from, and if it would still occur with newer kernel. Just made the impression to me that my system RAM was faulty or something, when in actuality it was related to VFIO-PCI, without even using Qemu or vendor-reset. If this happens to you as well, try removing everything related to VFIO-PCI. Note: I use suspend to ram all the time.
 
Last edited:
Is anyone try to use all this things using a real monitor? I'm on last proxmox 9 and after the kernel update I loose the possibility to have a working VM+HDMI output to TV after a first working usage, from second lunch the GPU is mounted but HDMI video is glitched image have black hole here and there and only fix is a host reboot. As workaround I install the old 6.8kernel were instead is working correctly and che turni on and off VM without problems and is showing correctly on TV. I have a Ryzen 5 5625U and blacklisted AMD driver and use only vfio one (I was try vendor reset but seem do nothing and I try to edit to make read my hardware) the only thing I can note from old and new kernel is that on old one I never see any log about the vfio reset when on new kernel I can see vfio reset when run the VM and see this is the cause of glitches. When is in glitched status if I connect to rdp or similar all seem working correctly. I do a lot of try but can't find a working way and so I put as default the old kernel but hope to find a fix for the new one too.
 
Are you using any of the following?

devcon or pnputil or RadeonResetBugFix

Set the following as the startup script.

Code:
pnputil /enable-device /class Display /bus PCI /connected

Set the following as the shutdown script.

Code:
pnputil /disable-device /class Display /bus PCI /connected

https://github.com/isc30/ryzen-gpu-passthrough-proxmox/issues/131
I try manually to go from vfio to AMD driver with a script or manual after\before VM launch but if start to play with AMD driver all seem much more unstable but I think to never try this and so I will try to :
pnputil /enable-device /class Display /bus PCI /connected

About radeonresetbugfix yes is installed and help to avoid the error 43 but not to fix the glitch on new kernel