You are not logged in.

#1 2016-12-23 21:04:58

Jong
Member
Registered: 2016-08-02
Posts: 3

Multi-GPU support and VGA passthrough

I recently got an RX480 and installed it on my PC. My future plans are to VGA passthrough it to my windows KVM, but I've encountered a few problems with the basic handling of this card.

00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller (rev 06)
...
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480] (rev c7)
01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Device aaf0

IGD uses i915, RX480 uses amdgpu and each of these cards has 1 monitor connected to it.

I'm running sddm and i3.

I'd expect X to work out of the box with this configuration, but it doesn't. The monitor connected to RX480 works, but the one connected to IGD is not recognized by X (i.e xrandr doesn't see it).
Is it possible to get these 2 working together?

Venturing on to passthrough. I tried to bind the RX480 to vfio-pci:

# http://askubuntu.com/questions/697019/unbind-gpu-from-radeon-drivers-without-restarting-lightdm
flipdriver() {
    dev="$1"
    driver="$2"

    if [ -z $driver ] | [ -z $dev ];
    then
        return 1
    fi

    vendor=$(cat /sys/bus/pci/devices/${dev}/vendor)
    device=$(cat /sys/bus/pci/devices/${dev}/device)

    echo -n Unbinding $vendor:$device ...

    if [ -e /sys/bus/pci/devices/${dev}/driver ]; then
        echo ${dev} > /sys/bus/pci/devices/${dev}/driver/unbind
        while [ -e /sys/bus/pci/devices/${dev}/driver ]; do
            sleep 0.5
            echo -n .
        done
    fi
    echo " OK!"

    echo -n Binding \'$driver\' to $vendor:$device ...
    echo ${vendor} ${device} > /sys/bus/pci/drivers/${driver}/new_id

    echo " OK!"

    return 0
}

flipdriver 0000:01:00.0 vfio-pci

But then I lose my monitor. So I guessed I should've blacklisted amdgpu or used pci-stub/vfio-pci on boot, this way arch would just use the i915 screen.
I tried to blacklist amdgpu. Also tried to let vfio-pci take control of the card (and its audio pci function) on boot:

$ cat /etc/modprobe.d/vfio.conf
options vfio-pci ids=1002:67df,1002:aaf0

Both resulted in me having a monitorless PC! i915 *still* controls the second monitor but whoever should be claiming it doesn't do that!

TL;DR how can I force arch to use i915 as its main display? I don't want it trying to use the RX480.
Thanks.

Offline

#2 2016-12-23 23:27:09

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: Multi-GPU support and VGA passthrough

Your system uses a hybrid graphics setup, check PRIME wiki page.

Every hybrid graphic setup has  a primary and a secondary card.
The primary card is the one used for tty / X , unless you take some special actions as described on prime wiki page.

My guess is your bios/uefi firmware sets the RX 480 as primary card.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

Board footer

Powered by FluxBB