# AMD Ryzen IOMMU KVM RX570?

## Rocky007

Hello,

i'm trying to enable IOMMU so that i can pass a AMD RX570 through to a virtual machine.

My CPU is a AMD Ryzen 1700

Mainboard is a Gigabyte Aorus Gaming 5 AX370 (http://www.gigabyte.de/Motherboard/GA-AX370-Gaming-5-rev-10#kf)

Every time i try it, i get the following error:

```

Installation could not be completed: "Unsupported configuration: host does not support passthrough of host PCI devices"

Traceback (most recent call last):

  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 90, in cb_wrapper

    callback(asyncjob, *args, **kwargs)

  File "/usr/share/virt-manager/virtManager/create.py", line 2277, in _do_async_install

    guest.start_install(meter=meter)

  File "/usr/share/virt-manager/virtinst/guest.py", line 501, in start_install

    noboot)

  File "/usr/share/virt-manager/virtinst/guest.py", line 416, in _create_guest

    dom = self.conn.createLinux(start_xml or final_xml, 0)

  File "/usr/lib/python2.7/dist-packages/libvirt.py", line 3606, in createLinux

    if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)

LibvirtError: Unsupported configuration: host does not support passthrough of host PCI devices

```

In the Kernel i set the following:

```

Device Drivers  ---> 

   [*] IOMMU Hardware Support  --->

      Generic IOMMU Pagetable Support  ----  

      [*]   AMD IOMMU support

      <M>     AMD IOMMU Version 2 driver  

      [*]   Support for Intel IOMMU using DMA Remapping Devices  

      [*]     Support for Shared Virtual Memory with Intel IOMMU  

      [*]     Enable Intel DMA Remapping Devices by default       

      [*]   Support for Interrupt Remapping

Device Drivers --->

   [*] Graphics support  --->

     <*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)  ---> 

            [ ]   DRM DP AUX Interface

            [*]   Enable legacy fbdev support for your modesetting driver 

     [*]   AMD GPU

```

In /etc/default/grub:

```

GRUB_CMDLINE_LINUX_DEFAULT="domdadm iommu=noforce amd_iommu=fullflush amd_iommu_dump=1  amd_iommu_intr=legacy intel_iommu=on"

```

dmesg | grep IOMMU

```

[    0.000000] DMAR: IOMMU enabled

[    0.874422] AMD-Vi: IOMMU performance counters supported

[    0.882969] AMD-Vi: Found IOMMU at 0000:00:00.2 cap 0x40

```

[Moderator edit: changed [quote] tags to [code] tags to preserve output layout. -Hu]

----------

## Myu

Not on Ryzen but here's my 2 cents :

Are the vfio-related modules loaded at boot time ?

I've this is /etc/conf.d/modules  for instance : 

```
modules="vfio vfio-pci vfio_iommu_type1 vfio_virqfd"
```

Also, you need to blacklist the ID of your card i.e in /etc/modprobe.d/vfio.conf

```
options vfio-pci ids=10de:1380,10de:0fbc,8086:1e20
```

I found that https://reddit.com/r/vfio is a good source on help for such a setup, and there's Ryzen users already !   :Smile: 

----------

## Rocky007

I'm on a legacy boot and not UEFI so vfio wouldn't be needed?

currently i've set up using pci-stub.

How would i configure it with this?

----------

## Myu

Yes you can make it work with pci-stub if you don't use UEFI in the VM, true  :Smile: 

There's also Xen if you feel adventurous, seems to work properly with AMD cards.

That being said, your issue here seems more like virt-manager saying "this host has no PCIE passthrough capabilities" which means there's something not working in the lower levels of your setup i.e :

AMD-Vi not properly enabled in BIOS/UEFI

AMD-Vi plain not working (BIOS upgrade needed perhaps ?)

Too old kernel / virt-manager / qemu stack ?

... something else

I'm not an expert so you may have better luck on reddit or on the vfio-users mailing list

----------

