AMD APU Ryzen 5700G iGPU Passthrough on 6.9.2


q3bing

Recommended Posts

Also the latest VIRTIO drivers I cannot get it to let me install the entire package, I have to deselect a few items to make it not fail and roll back installation.  I did try going back to my previous version of VIRTIO as well with Win10 to make the VM exactly how it was working in 6.9.2.

Link to comment

What version of VIRTIO was everyone else using?  Maybe that's part of the key?

 

I didn't record which one I was on when things were working, but pretty sure it was virtio-win-0.1.190-1.iso

 

Maybe one of the drivers I loaded as part of that was key?  I just tried a new Win10 VM with 190 and it still didn't work though.

Link to comment
Posted (edited)

My understanding is virtio shouldn't be coming into play with the gpu, only the disk drive and other virtualized components (network, audio, memory ballooning, serial, etc)

 

I ordered a newer 5700g to see if passthrough was somehow added to a later manufactured date. Mine is from launch originally. Will post results.

 

Are you getting display output in any configuration since update unraid?

Edited by mysticcfx
Link to comment

Nope, I cannot get it to do anything on HDMI output since upgrade.  I installed Windows about 100 times today getting fresh starts on new VMs to try different approaches, nothing worked.  I tried to get the bios dumped directly from my chip, and was unsuccessful with that too.  GPUZ doesn't work, nor does Space Invadors process, nor SIV.  I tried it in Windows 11 and Windows 10.  Its frustrating how hard this is, when it seems like it should just work.

 

If I had to do it again, I would probably have tried to go with Intel instead of AMD... but I already had the x570 board.

Link to comment
Posted (edited)

Did you update your bios? the vbios is tied to the bios of your motherboard. It can be extracted with uefi tool searching Cezanne and exporting the corresponding data body. make sure it shows the vbios header when inspecting. What does your dmesg show in terminal when starting your W10/W11 VM? This beta BIOS from march of 22 is showing a vbios date of 9/24/21. So it may not be your issue if your motherboard is similar since no new APUs came out.vbios.thumb.png.2e15c7ea099b38347b7243cd7799d0f1.png

Edited by mysticcfx
Link to comment

dmesg doesn't update, but syslog shows this:

 

May 18 17:50:00 UNRAID kernel: vfio-pci 0000:0b:00.0: vfio_ecap_init: hiding ecap 0x19@0x270
May 18 17:50:00 UNRAID kernel: vfio-pci 0000:0b:00.0: vfio_ecap_init: hiding ecap 0x1b@0x2d0
May 18 17:50:00 UNRAID kernel: vfio-pci 0000:0b:00.0: vfio_ecap_init: hiding ecap 0x25@0x400
May 18 17:50:00 UNRAID kernel: vfio-pci 0000:0b:00.0: vfio_ecap_init: hiding ecap 0x26@0x410
May 18 17:50:00 UNRAID kernel: vfio-pci 0000:0b:00.0: vfio_ecap_init: hiding ecap 0x27@0x440

 

Link to comment
Posted (edited)

I was never able to get video output. The os would always show the gpu, but error 43 after driver install. Only could be done via vnc, Never direct output. Also fyi, the vbios in the thread is from Feb 21 and not the more recent Sept 21.

 

I'm also guessing the gpu shows as an MS generic driver prior to install which is basically no acceleration.

Edited by mysticcfx
Link to comment

Yeah, my point is that you never got output, and maybe never used the version of the driver I was using?  Not sure if I ever got the bios messages/etc or if the VM would only display after it got Windows started, I never paid attention to that.

 

No, it showed up as the same AMD device the whole time.  I noticed It was good to go in Device Manager right before I installed driver.  I might start over and not install any driver and see what it does.

Link to comment
23 hours ago, onyxdrew said:

Also the latest VIRTIO drivers I cannot get it to let me install the entire package, I have to deselect a few items to make it not fail and roll back installation.  I did try going back to my previous version of VIRTIO as well with Win10 to make the VM exactly how it was working in 6.9.2.

To install the VirtIO drivers, you need to disable the Driver Signature Enforcement feature. 

image.thumb.png.c7d8b34c105576d9c4452933e18386b0.png

 

Link to comment

Yeah when I was screwing around my system reset the cmos settings as one time I locked it up...  I had thought I had saved teh profile but it doesn't appear to have worked.  I'm burned out of it for now, will pick it up again next week maybe.  Not sure why the updated QEMU would have much impact either?

Link to comment
  • 2 weeks later...
Posted (edited)

Hi all,I succeeded!!!

But my system is a HACKED QNAP 5.0 TS-877, basically following the techhit process.

I'm not familiar with unraid, nor have unraid installed. So just for your reference.。

 

Thank you all very much !!!

 

The following are the settings on my qnap system, please refer to

 

My motherboard: MSI B450M MORTAR MAX

My CPU: 5700G

Linux kernel: 5.10.60-qnap

 

grub.cfg:

amd_iommu=on iommu=pt  pcie_acs_override=downstream,multifunction  video=efifb:off

 

Get vbios rom:

My motherboard is MSI B450M MORTAR MAX, bios version 7B89v2G,down motherboard BIOS。

down UBU_v1.79.17

https://winraid.level1techs.com/t/tool-guide-news-uefi-bios-updater-ubu/30357

extracted motherboard bios to UBU,run UBU.BAT

Get  file Extracted--VBIOS--017.010.000.030.000000--vbios_1638.dat

This is  you Cezanne's vbios.rom 

My Cezanne's vbios.rom version 017010.000.030.0000

 

BIOS setp:

Re-Size BAR Support           --enable

Above 4G memory/Crypto    --enable   

SR-IOV Support                   --enable

Initiate Graphic Adapter       --IGD

Integrated Graphics             --Force

UMA Frame Buffer Size        --4G

IOMMU                                --enable

DMA Protection                   --auto

DMAr Support                     --auto

SVM Mode                          --enable

NX Mode                            --enable

other all auto

BOOT UEFI

CSM   cloese

 

IOMMU Group: 

IOMMU Group 15:

    30:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:1638] (rev c8)

IOMMU Group 16:

    30:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:1637]

IOMMU Group 17:

    30:00.2 Encryption controller [1080]: Advanced Micro Devices, Inc. [AMD] Device [1022:15df]

IOMMU Group 18:

    30:00.3 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Device [1022:1639]

 

Bios: seabios

 

 <kvm>

   <hidden state='on'/>

  </kvm>

 

  <cpu mode='host-passthrough' check='none'>

    <topology sockets='1' cores='8' threads='1'/>

  </cpu>

 

   <type arch='x86_64' machine='pc-i440fx-4.1'>hvm</type>       #My qnap only set pc-i440fx-4.1

 

    </hostdev>

    <hostdev mode='subsystem' type='pci' managed='yes'>

      <source>

        <address domain='0x0000' bus='0x30' slot='0x00' function='0x0'/>

      </source>

      <rom bar='on' file='/share/CACHEDEV1_DATA/.qpkg/.QKVM/romfile/1002_1638_1002_1636.rom'/>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>

    </hostdev>

    <memballoon model='virtio'>

      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>

    </memballoon>

  </devices>

  <qemu:commandline>

    <qemu:arg value='-set'/>

    <qemu:arg value='device.hostdev0.x-vga=on'/>

  </qemu:commandline>

 

ps: on my system

hidden state ; machine='pc-i440fx-4.1' ; rom file; x-vga=on

is required

My qnap qemu only set pc-i440fx-4.1

 

my qemu virsh version: 4.1

 

Last:

 

1.win10-21h2

2.amd drive 22.5.2

3.RadeonResetBugFix

https://github.com/inga-lovinde/RadeonResetBugFix

 

No more code 43

No reset bug

Perfect !!!!

 

 

Thanks again everyone and good luck !!!!

 

Edited by wx-Rmt
Link to comment

I installed unraid 6.9.2 today, and successfully connected the 5700G core display with the above method.

I'm still testing its stability to see if the system can run stably for more than 24 hours.

 

At the same time, I also briefly tried 6.10.2, but it didn't work,

but I found that 6.10.2 has no GPU reset problem, but it will code43.

Link to comment

extracted motherboard bios to UBU,run UBU.BAT

Get  file Extracted--VBIOS--017.010.000.030.000000--vbios_1638.dat
I cant do this point.
UBU_v1_69_17_2\UBU    wont do anything(mmutool not found)
uefiTool wont do anything too

 

Wanna mod the Bios for the x370 Taichi


Please write a useable guide

Link to comment

 

down UBU_v1.79.17.rar

https://winraid.level1techs.com/t/tool-guide-news-uefi-bios-updater-ubu/30357

down.thumb.png.2849610a988d356a27a68de235fc9a5b.png

 

Unzip the English directory 

For example E:\UBU_v1.79.17

 

Copy X370TC7.10 into E:\UBU_v1.79.17 Double click UBU.bat

ubu01.png.0e36af84c481b679f64c2b0e7b0ed0a4.png

 

Wait for the prompt to press any key

 

ubu02.png.23674a6159b3237b5988b511a8fcf4b9.png

 

chioce 2 enterubu03.png.a466f8995ddfeaa59ce5997b13aeb9d6.png

 

S enter

ubu04.png.dffa55d48373ab21f177544cada18ce0.png

choice 0 exit

or just close

 

ubu05.png.5cf0bd3cacf9e0d5019e29bc174df984.png

 

 

At the same time you can open E:\UBU_v1.79.17\Files\AMD\VBIOS\_List_vbios.txt

# 504349520210 vbis_xxx.dat rb "     OROM VBIOS Rembrant         - "
5043495202103F16 vbios_163F.dat vg "     OROM VBIOS Van Gogh         - "
5043495202103816 vbios_1638.dat ce "     OROM VBIOS Cezanne          - "
5043495202103616 vbios_1636.dat re "     OROM VBIOS Renoir           - "
504349520210D815 vbios_15D8.dat pi "     OROM VBIOS Picasso          - "
526176656E322047656E vbios_15DD_2.dat ra2 "     OROM VBIOS Raven 2          - "
526176656E2047656E vbios_15DD_1.dat ra1 "     OROM VBIOS Raven            - "

  • Like 1
  • Upvote 1
Link to comment
Posted (edited)

I have been running stably for more than 24 hours on the unraid 6.9.2 through the i440fx-5.1 model through the 5700g igpu

If you use Q35-5.1 unsuccessfully, you can try i440fx-5.1

 

I can only speak simple English,only google translate.

 

My motherboard is MSI B450M MORTAR MAX, bios version 7B89v2G

My CPU 5700G.

 

Use UBU_v1.79.17 to extract vbios.rom of you motherboard bios

 

kernel /bzimage
append pcie_acs_override=downstream,multifunction vfio_iommu_type1.allow_unsafe_interrupts=1 video=efifb:off initrd=/bzroot

 

set1.thumb.png.6c3017a882cbaac03c1b8bc1d61fffef.png

 

set2.thumb.png.6d028bff01fa1c2eac32063cfb46171b.png

 

Create a new vm win10

Machine:i440fx-5.1

BIOS:SeaBIOS

Hyper-V:Yes

Graphics Card  just use vnc

fx01.png.1e4a36a631ff46031b7778a2b20d3d3b.png

 

fx02.png.eba4ce7db756dea9fcf0a6e09be43b2f.png

 

 

 

installing win10, installing virtio-win.

My Computer - Properties - Advanced System Settings - Hardware - Device Installation Settings - Set to No.

Don't let win10 download and install old amd drivers automatically。

Remember to change it back later.

It is best to open the remote desktop, which is convenient for debugging later.

 

Download the latest AMD 22.5.2 driver and RadeonResetBugFix in vm win10

https://github.com/inga-lovinde/RadeonResetBugFix

Unzip the amd driver to any directory.

 

shutdown win10。

edit win10

Modify the vnc of Graphics Card to AMD Cezanne (30:00.0),Specify the vbios.rom obtained earlier

fx03.png.bc5bc34da199ceb8a7d4bd1ea64d59df.png

 

 

click update

edit win10 again

XML VIEW

 

Add  hidden state

 

    <kvm>
      <hidden state='on'/>
    </kvm>

 

xml01.png.0774760f8375b83d243e5a0137a24046.png

 

Add  x-vga=on

  <qemu:commandline>
    <qemu:arg value='-set'/>
    <qemu:arg value='device.hostdev0.x-vga=on'/>
  </qemu:commandline>

 

xml02.png.b0860ed8dbc27f49e8b87ba00584cf9a.png

 

Ps:not very familiar with unradi。The following is not very clear。

if you modify the vm in the Virtual Machines GUI, it will automatically delete x-vga=on, and you have to manually add it in the XML VIEW mode each time.

 

update.

 

boot win10

 

If it is the first time to pass through the igpu。

The monitor lights up directly, enter the system (pass-through keyboard, mouse or remote desktop),

install the amd driver, do not restart after the driver installation is complete,

cmd RadeonResetBugFixService.exe install

Wait a few minutes for the RadeonResetBugFixService installation to complete. Restart win10 again.

 

When start win10 again, my monitor will be black for 1-2 minutes, wait patiently for RadeonResetBugFixService to activate the amd graphics card, and the monitor will light up again.

 

Finally, remember to turn off the hibernation of win10, I found that hibernation may cause the host to crash.

 

The second time my machine boots up vm win10 it starts to go black for a few minutes. Just be patient for a while.

I don't know if it's because of my B450 motherboard or because of my dp interface

 

But I tested with 6.10.2 yesterday. It can directly light up the display every time, and 6.10.2 has fixed the problem of gpu reset, but brought code 43.

 

See the specific principle https://github.com/inga-lovinde/RadeonResetBugFix the bottom description.

 

 

 

 

Windows100.xml

Edited by wx-Rmt
  • Like 2
Link to comment
Posted (edited)

I also succeeded above 6.10.0

deleted pci=noats

 

I looked at the startup syslog, found an error, then deleted pci=noats, restarted the error in syslog disappeared,。

and then the nuclear display pass-through was normal.

 

But the gpu rest bug that needs to be pointed out still exists, and the win10 gpu reset patch RadeonResetBugFix is still needed .

 

 

I requested ICH777 to add the 0x1002, x1638 id of our apu to the AMD VENDOR RESET plugin, I don't know if it works.

So maybe don't RadeonResetBugFix。

 

At the same time I create a new

/boot/config/modprobe.d/amdgpu.conf

blacklist amdgpu

 

Special reminder:

Restart the nas first, then pass through the gpu for the first time, install the amd driver, and install RadeonResetBugFix.

Edited by wx-Rmt
Link to comment

6.9.2 = no problem for me.  But I could not get this working after upgrading to 6.10 today.  VM would not freeze on start up and never successfully boot with the GPU passthrough.  And would boot fine when setting display to VNC.

 

I had to revert back to 6.9.2 where it's working fine again.

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.