[GUIDE] Perfect GPU Passthrough - Say your prayers, Dual-Booters! [READ DESCRIPTION, IMPORTANT INFO]

preview_player
Показать описание

XMR wallet: 488tbuUeic42bRd2XL8vv47HVp1R2N7PEUabtSjVVNyVBQb8jJ3Cw7fH2N4b8drZLud5Zn3pdjawaFe8Y9aEb5zbN5oEPTV

[READ THIS SECTION, VERY IMPORTANT]
PLEASE do not go to looking-glass for support. This is not a supported method and while it works perfectly fine, there are methods used that they do not agree with (they are pissed). If you have any issues, please either write it in the comments or go to my github. I check my comments very frequently so you do not have to worry about waiting very long.

[END SECTION]

Demonstration + Let's Play:

YOU WILL NEED: virt-manager, gpu-passthrough-manager, dkms, jack example tools, wget, looking-glass, looking-glass source code, the IddSampleDriver, and the looking glass host binary for windows

LOOKING GLASS HOST BINARY:

LOOKING GLASS SOURCE CODE:

IddSampleDriver:

gpu-passthrough-manager:

SPECIAL COMMANDS USED IN VIDEO:

Check IOMMU status:
sudo dmesg | grep -i -e DMAR -e IOMMU

Download the hook helper:

Copy the scripts (IF USING ANOTHER NAME, REPLACE EVERY INSTANCE OF NAME IN SCRIPTS AS WELL, OTHERWISE JUST CALL YOUR VM "name")

sudo cp -r name-files/ /etc/libvirt/hooks/qemu.d/name

Setting up shmem:

sudo modprobe kvmfr static_size_mb=128

sudo chown (yourusername):kvm /dev/kvmfr0

EQUATION TO FIGURE OUT SHMEM SIZE
ROUND TO A POWER OF 2. 8MB, 16MB, 32MB, ETC.

w = width, h = height
w * h * 4 * 2 = total bytes
total bytes / 1024 / 1024 = total MiB + 10

Arch wiki:
Gentoo wiki:
ASUS-Linux:
Рекомендации по теме
Комментарии
Автор

Just recorded the demonstration (+ sort of let's play) and am rendering it now, will be uploaded soon. Didn't feel the demonstration was necessary to be put in this video but I will put it in this comment + description and also the beginning and end of the video!

supermasterfighter
Автор

the tutorial was a little bit unstructured/messy but this was the only tutorial that actually had it end up working with headless for me lol
thanks man

aa
Автор

Damn. Found a good teacher for me. Very direct and efficient. Subbed and liked and shit. Thank you!

oldpain
Автор

expect an xmr donation soon. This was an excellent guide. Thank you.

SkyenNovaA
Автор

While Windows KVMs mainly enhance the Linux experience rather than fully emulating Windows flawlessly, it's still amazing that we have full passthrough for them. Makes a lot of things on non-dual boot systems way easier

IfritBoi
Автор

well i think i will watch this video many times to make the vm works, good and detaild and straight to the point, thx for the efforts, will try this if bottels fail in making solidworks run

blackend
Автор

As long as I add <domain> <audio> and <qemu:commandline> sections, my VM crashed immediately after starting to boot. Error in logs doesn't say anything: 2024-10-30 15:30:13.997+0000: shutting down, reason=crashed

lI_Simo_Hayha_Il
Автор

What extra steps do I need if I want to dynamicly bind/unbind the GPU?

SoulRollerFIN
Автор

I think GPU passthrough is really cool but I just wish this could work with audio. The reason I still dual boot is because my DAW only runs on Windows. You can passthrough audio but the latency is really bad.

itsnony
Автор

Just FYI: grep -i ignores capitalisation, no need to capitalize IOMMU

PascalBrax
Автор

i think i might try this when i upgrade my pc very soon, but i would like to know how does this vm approach deal with various anti cheat stuff? will that still be a problem with games that have those annoying ring 0 kernel drm things?

im probably one of worst case scenarios for switching to linux, as even though i really want to, i do need adobe and bunch other non-blender 3d programs for work

small ramble can ignore:(its not even a re-learning issue, theres many features which just arent a thing in alternatives, like layerstyles, no matter how some will just say install photoshop gimp theme and its totally same thing), plus i have made few autohotkey scripts for photoshop too, sadly autohotkey is windows only, i also use sharex, and while i tried flameshot it just does not seem as powerful as sharex, i sometimes also like to play old flash games and flashpoint while usable thru wine, its just another example of how everything i want to do is x100 more painful or just not doable on directly)

also if had a 8 core cpu, would giving 2c4t to linux and 6c12t to windows vm be ok? or would linux need more?

revyYT
Автор

Well that looks like a pain in the butt. :D

Sigmatechnica
Автор

Hey I don't know if you still are replying to comments but when I attempt to run
sudo cp -r name-files/
i get an error saying
cp: cannot stat 'name-files/': No such file or directory
I don't know what to do from here as I know very little about gpu passthrough. I'm on endeavourOS(arch-based) latest version if that matters at all.

ppleberrynd
Автор

how can you play games in windows without the games knowing you are using a VM? (they dont like vms & they ban you)

andrewtate-dhtb
Автор

One question, is it possible to use the gpu set into the VM back on the host os when the vm isnt being used? For instance training an ML model, nothing graphical

joemama
Автор

What would be a good second video card for a 3060? I have 3 monitors(2x 1440p, 1x 1080p) that I want to support for ordinary things. Then I want the 3060 to handle gaming and other graphic card centric things. I do not have on board video. I prefer to not switch inputs(which I understand is the purpose of this approach).

danielhoglan
Автор

Wanted to see if I could find a good way to replicate Hyper-V’s function partitioning to share a gpu (I only have one) between host and vm, just so happened to find another warhammer fan running DWM. Hell yeah.

saltyowl
Автор

Is there a more user friendly operation? I need a performant VM of Windows hosted on a RHEL clone, like Rocky Linux, so I can use DCCs like ZBrush. Sick of dual boot. Do we have to use Arch Linux as the host?

stevejjd
Автор

Hello, im a windows user thinking in going to linux, im running Ubuntu 23.04 at the moment, one of the main things i use windows now is for gaming, mostly multiplayer games which they dont run on linux because of EAC.
my question is, with this virtual machine setup that way, am i be able to play them? This setup will work on Ubuntu or need to change distro ?
Thank you.

pepperpotts
Автор

Is this for multi-gpu? My monitors are run off my motherboard, so I'm looking for a guide to get my use the dGPU for VMs while being plugged into one of the same monitors (switch inputs via the monitor's physical button).

svenbjorn