Virtualization with GPU passthrough on an APU?

Hello!

I’m wondering if it’s possible to set up virtualization with GPU passthrough on an APU.
If so, how would i go about it? The main reason i want to do this is so i can use Affinity software for work, and it doesn’t work with wine, bottles or anything like that, people have tried, so i need it run “natively” in a virtual machine.

Trying to fully switch to linux, this is kind of the final piece of the puzzle… For now, i still have windows 10 installed on another drive when i need those applications. Which Manjaro casually recognized and set up in grub so i don’t have to boot from bios which is very nice, i like that already! :slight_smile:

But i’m trying to get rid of windows cause windows 11 is testing my limits for various tracking stuff. Kinda want to get out of the building before the dumpster fire sets it ablaze you know? :stuck_out_tongue_winking_eye: But having it installed just for affinit AND in a virtual machine is good enough for me to use windows that way.

Or if there’s a way to “skip” windows desktop and have affinity windows appear as if they’re part of manjaro desktop, that would be super, but baby steps…

Back to virtualization - i’ve hear also that you need to have 2 GPUs for GPU passthrough to work, is that correct? And that APU is impossible because GPU passthrough needs a PCIE card?

If that’s the case - i do have an old (but officially not supported anymore) AMD card, R7 260x which was good enough for Affinity when i used it on windows, will that work for GPU passthrough?

And if i install it in my computer, i want to keep using the APU as my main GPU for manjaro and all its programs and games, will i be able to do that or will it automatically want to use the PCIE one?

Bottom line is - i’m very new at this, i dabbled with virtualbox, boxes, bottles and vwware player (which i couldn’t get to work), but nothing ever as complex or fancy as i’m trying to do now.

Where do i start?
I guess here, on the forums, but i’m also looking for info, guides, maybe help troubleshooting if needed.

Thank you for reading, and thanks in advance for any help!

EDIT: System info in case it’s needed.

System:
  Kernel: 6.1.0-x64v1-xanmod1-MANJARO arch: x86_64 bits: 64 compiler: gcc
    v: 12.2.0 parameters: BOOT_IMAGE=/@/boot/vmlinuz-manjaro-xanmod
    root=UUID=3c103b00-38b2-448f-963d-b21e21c8d003 rw rootflags=subvol=@ quiet
    resume=UUID=2e8c475c-b939-46e7-bf7f-71596d247bbe udev.log_priority=3
  Desktop: KDE Plasma v: 5.26.4 tk: Qt v: 5.15.7 wm: kwin_wayland vt: 2
    dm: SDDM Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Desktop Mobo: ASRock model: B550M Pro4 serial: <superuser required>
    UEFI: American Megatrends LLC. v: P2.30 date: 02/24/2022
Battery:
  Message: No system battery data found. Is one present?
Memory:
  RAM: total: 15.01 GiB used: 5.41 GiB (36.1%)
  RAM Report: permissions: Unable to run dmidecode. Root privileges required.
CPU:
  Info: model: AMD Ryzen 5 5600G with Radeon Graphics bits: 64 type: MT MCP
    arch: Zen 3 gen: 4 level: v3 note: check built: 2021-22
    process: TSMC n7 (7nm) family: 0x19 (25) model-id: 0x50 (80) stepping: 0
    microcode: 0xA50000C
  Topology: cpus: 1x cores: 6 tpc: 2 threads: 12 smt: enabled cache:
    L1: 384 KiB desc: d-6x32 KiB; i-6x32 KiB L2: 3 MiB desc: 6x512 KiB L3: 16 MiB
    desc: 1x16 MiB
  Speed (MHz): avg: 3677 high: 3900 min/max: 1400/4464 boost: enabled
    scaling: driver: acpi-cpufreq governor: performance cores: 1: 3067 2: 3900
    3: 3900 4: 3900 5: 3900 6: 2971 7: 3900 8: 2993 9: 3900 10: 3900 11: 3900
    12: 3900 bogomips: 93426
  Flags: 3dnowprefetch abm adx aes aperfmperf apic arat avic avx avx2 bmi1
    bmi2 bpext cat_l3 cdp_l3 clflush clflushopt clwb clzero cmov cmp_legacy
    constant_tsc cpb cppc cpuid cqm cqm_llc cqm_mbm_local cqm_mbm_total
    cqm_occup_llc cr8_legacy cx16 cx8 de decodeassists erms extapic
    extd_apicid f16c flushbyasid fma fpu fsgsbase fsrm fxsr fxsr_opt ht
    hw_pstate ibpb ibrs ibs invpcid irperf lahf_lm lbrv lm mba mca mce
    misalignsse mmx mmxext monitor movbe msr mtrr mwaitx nonstop_tsc nopl npt
    nrip_save nx ospke osvw overflow_recov pae pat pausefilter pclmulqdq
    pdpe1gb perfctr_core perfctr_llc perfctr_nb pfthreshold pge pku pni popcnt
    pse pse36 rapl rdpid rdpru rdrand rdseed rdt_a rdtscp rep_good sep sha_ni
    skinit smap smca smep ssbd sse sse2 sse4_1 sse4_2 sse4a ssse3 stibp succor
    svm svm_lock syscall tce topoext tsc tsc_scale umip v_spec_ctrl
    v_vmsave_vmload vaes vgif vmcb_clean vme vmmcall vpclmulqdq wbnoinvd wdt
    x2apic xgetbv1 xsave xsavec xsaveerptr xsaveopt xsaves
  Vulnerabilities:
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: retbleed status: Not affected
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, IBRS_FW,
    STIBP: always-on, RSB filling, PBRSB-eIBRS: Not affected
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: AMD Cezanne [Radeon Vega Series / Radeon Mobile Series]
    driver: amdgpu v: kernel arch: GCN-5.1 code: Vega-2 process: TSMC n7 (7nm)
    built: 2018-21 pcie: gen: 3 speed: 8 GT/s lanes: 16 link-max: gen: 4
    speed: 16 GT/s ports: active: DP-1,HDMI-A-1 empty: DP-2 bus-ID: 05:00.0
    chip-ID: 1002:1638 class-ID: 0300 temp: 30.0 C
  Display: wayland server: X.org v: 1.21.1.6 with: Xwayland v: 22.1.7
    compositor: kwin_wayland driver: X: loaded: amdgpu unloaded: modesetting
    alternate: fbdev,vesa dri: radeonsi gpu: amdgpu d-rect: 5120x1440
    display-ID: 0
  Monitor-1: DP-1 pos: primary,left res: 2560x1440 size: N/A modes: N/A
  Monitor-2: HDMI-A-1 pos: right res: 2560x1440 size: N/A modes: N/A
  API: OpenGL v: 4.6 Mesa 22.3.1 renderer: AMD Radeon Graphics (renoir LLVM
    14.0.6 DRM 3.49 6.1.0-x64v1-xanmod1-MANJARO) direct render: Yes
Audio:
  Device-1: AMD Renoir Radeon High Definition Audio driver: snd_hda_intel
    v: kernel pcie: bus-ID: 3-2.4:5 chip-ID: 1235:8200 gen: 3 speed: 8 GT/s
    class-ID: 0103 lanes: 16 link-max: gen: 4 speed: 16 GT/s bus-ID: 05:00.1
    chip-ID: 1002:1637 class-ID: 0403
  Device-2: AMD Family 17h/19h HD Audio vendor: ASRock driver: snd_hda_intel
    v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16 link-max: gen: 4
    speed: 16 GT/s bus-ID: 05:00.6 chip-ID: 1022:15e3 class-ID: 0403
  Device-3: Focusrite-Novation Scarlett 2i4 USB type: USB
    driver: snd-usb-audio
  Sound API: ALSA v: k6.1.0-x64v1-xanmod1-MANJARO running: yes
  Sound Interface: sndio v: N/A running: no
  Sound Server-1: JACK v: 1.9.21 running: no
  Sound Server-2: PulseAudio v: 16.1 running: yes
  Sound Server-3: PipeWire v: 0.3.63 running: yes
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: ASRock driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1
    port: f000 bus-ID: 03:00.0 chip-ID: 10ec:8168 class-ID: 0200
  IF: enp3s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  IP v4: <filter> type: dynamic noprefixroute scope: global
    broadcast: <filter>
  IP v6: <filter> type: noprefixroute scope: link
  WAN IP: <filter>
Bluetooth:
  Device-1: Cambridge Silicon Radio Bluetooth Dongle (HCI mode) type: USB
    driver: btusb v: 0.8 bus-ID: 3-2.1:3 chip-ID: 0a12:0001 class-ID: e001
  Report: rfkill ID: hci0 rfk-id: 0 state: up address: see --recommends
Logical:
  Message: No logical block device data found.
RAID:
  Message: No RAID data found.
Drives:
  Local Storage: total: 698.65 GiB used: 189.82 GiB (27.2%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Kingston model: SNV2S500G
    size: 465.76 GiB block-size: physical: 512 B logical: 512 B speed: 63.2 Gb/s
    lanes: 4 type: SSD serial: <filter> rev: SBI02102 temp: 32.9 C scheme: GPT
  ID-2: /dev/sda maj-min: 8:0 vendor: Samsung model: SSD 860 EVO 250GB
    size: 232.89 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
    type: SSD serial: <filter> rev: 1B6Q scheme: GPT
  Optical-1: /dev/sr0 vendor: ATAPI model: iHAS122 rev: ZL0C dev-links: cdrom
  Features: speed: 48 multisession: yes audio: yes dvd: yes
    rw: cd-r,cd-rw,dvd-r,dvd-ram state: running
Partition:
  ID-1: / raw-size: 448.97 GiB size: 448.97 GiB (100.00%)
    used: 189.82 GiB (42.3%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
    label: N/A uuid: 3c103b00-38b2-448f-963d-b21e21c8d003
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 608 KiB (0.2%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
    label: NO_LABEL uuid: BE32-0B52
  ID-3: /home raw-size: 448.97 GiB size: 448.97 GiB (100.00%)
    used: 189.82 GiB (42.3%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
    label: N/A uuid: 3c103b00-38b2-448f-963d-b21e21c8d003
  ID-4: /var/cache raw-size: 448.97 GiB size: 448.97 GiB (100.00%)
    used: 189.82 GiB (42.3%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
    label: N/A uuid: 3c103b00-38b2-448f-963d-b21e21c8d003
  ID-5: /var/log raw-size: 448.97 GiB size: 448.97 GiB (100.00%)
    used: 189.82 GiB (42.3%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
    label: N/A uuid: 3c103b00-38b2-448f-963d-b21e21c8d003
Swap:
  Kernel: swappiness: 30 (default 60) cache-pressure: 50 (default 100)
  ID-1: swap-1 type: partition size: 16.5 GiB used: 0 KiB (0.0%) priority: -2
    dev: /dev/nvme0n1p3 maj-min: 259:3 label: swap
    uuid: 2e8c475c-b939-46e7-bf7f-71596d247bbe
Unmounted:
  ID-1: /dev/sda1 maj-min: 8:1 size: 100 MiB fs: vfat label: N/A
    uuid: 4679-8A08
  ID-2: /dev/sda2 maj-min: 8:2 size: 16 MiB fs: <superuser required>
    label: N/A uuid: N/A
  ID-3: /dev/sda3 maj-min: 8:3 size: 232.27 GiB fs: ntfs label: N/A
    uuid: DCCC7B38CC7B0C50
  ID-4: /dev/sda4 maj-min: 8:4 size: 510 MiB fs: ntfs label: N/A
    uuid: CC006C1E006C122E
USB:
  Hub-1: 1-0:1 info: Hi-speed hub with single TT ports: 10 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Device-1: 1-5:2 info: Sunplus Innovation Gaming Mouse type: Mouse,Keyboard
    driver: hid-generic,usbhid interfaces: 2 rev: 2.0 speed: 12 Mb/s power: 100mA
    chip-ID: 1bcf:08a6 class-ID: 0300
  Hub-2: 1-7:3 info: Genesys Logic Hub ports: 4 rev: 2.0 speed: 480 Mb/s
    power: 100mA chip-ID: 05e3:0610 class-ID: 0900
  Device-1: 1-8:4 info: ASRock LED Controller type: HID
    driver: hid-generic,usbhid interfaces: 1 rev: 1.1 speed: 12 Mb/s power: 100mA
    chip-ID: 26ce:01a2 class-ID: 0300 serial: <filter>
  Hub-3: 2-0:1 info: Super-speed hub ports: 4 rev: 3.1 speed: 10 Gb/s
    chip-ID: 1d6b:0003 class-ID: 0900
  Hub-4: 3-0:1 info: Hi-speed hub with single TT ports: 4 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Hub-5: 3-2:2 info: ASMedia ASM1074 High-Speed hub ports: 4 rev: 2.1
    speed: 480 Mb/s power: 100mA chip-ID: 174c:2074 class-ID: 0900
  Device-1: 3-2.1:3 info: Cambridge Silicon Radio Bluetooth Dongle (HCI mode)
    type: Bluetooth driver: btusb interfaces: 2 rev: 2.0 speed: 12 Mb/s
    chip-ID: 0a12:0001 class-ID: e001
  Device-2: 3-2.3:4 info: Valve Wireless Steam Controller type: Keyboard,HID
    driver: hid-steam,usbhid interfaces: 5 rev: 2.0 speed: 12 Mb/s power: 100mA
    chip-ID: 28de:1142 class-ID: 0300
  Device-3: 3-2.4:5 info: Focusrite-Novation Scarlett 2i4 USB type: Audio
    driver: snd-usb-audio interfaces: 6 rev: 2.0 speed: 480 Mb/s power: 500mA
    chip-ID: 1235:8200 class-ID: 0103
  Hub-6: 4-0:1 info: Super-speed hub ports: 2 rev: 3.1 speed: 10 Gb/s
    chip-ID: 1d6b:0003 class-ID: 0900
  Hub-7: 4-2:2 info: ASMedia ASM1074 SuperSpeed hub ports: 4 rev: 3.0
    speed: 5 Gb/s power: 8mA chip-ID: 174c:3074 class-ID: 0900
  Hub-8: 5-0:1 info: Hi-speed hub with single TT ports: 4 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Hub-9: 6-0:1 info: Super-speed hub ports: 2 rev: 3.1 speed: 10 Gb/s
    chip-ID: 1d6b:0003 class-ID: 0900
Sensors:
  System Temperatures: cpu: 38.5 C mobo: N/A gpu: amdgpu temp: 30.0 C
  Fan Speeds (RPM): N/A
Info:
  Processes: 345 Uptime: 24m wakeups: 0 Init: systemd v: 252 default: graphical
  tool: systemctl Compilers: gcc: 12.2.0 clang: 14.0.6 Packages: pm: pacman
  pkgs: 1717 libs: 478 tools: pamac pm: flatpak pkgs: 0 Shell: Zsh v: 5.9
  default: Bash v: 5.1.16 running-in: konsole inxi: 3.3.24

Hello,

Regardless if you passthrough the iGPU or dGPU, APU or not, that GPU must not be used by the host, so in order to run your host and the VM in the same time, with the passthrough GPU, you need dual GPU, because running the host headless will most likely not be your thing.

Yes, use that for your VM as instructed on PCI passthrough via OVMF - ArchWiki

I see! I’ll put the old GPU in then and only use it for the guest. Thank you so much for replying and thank you for the link, i’ll read up on it, then see what i can do. :slight_smile:
Hopefully i can set it up, i’d relly like to get away from windows, and Affinity is basically the only thing still holding me there. I’ve set up audio production on linux, gaming, and now hopefully this as well.
Nothing else really needed setting up, i love that about linux! :smiley: