AMD/NVIDIA GPU Passthrough in Window 11 - Proxmox Guide

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
this right here is my desktop computer now to be quite frank i have not used this thing for a couple of months now the sapphire's laptop i have after the recent updates to fedora and ubuntu now runs almost completely fine and i do a lot of my davinci resolve work on the m1 macbook air so unfortunately this thing has become a waste of space that is until today through one of my favorite applications proxmox what we're going to be doing is setting up a windows virtual machine and passing a gpu directly to that machine and this is awesome because within that virtual machine i will probably be able to get davinci resolve running perfectly fine as well as potentially setting it up for steam home link and streaming in the future and despite the length of this video it's actually a pretty easy thing to do it's all going to be thanks to this reddit post right here the ultimate beginner's guide for gpu passthrough and this is a idiot-friendly tutorial so it's going to be perfect for somebody like me now the guide is three years old so there's going to be some minor tweaks and changes that we make throughout this video primarily due to both the vm configuration and vm setup processes but most of everything is the same so jumping right into it the very first thing we're going to want to do is get a usb just like this and flash the proxmox iso to it the download link for proxmox will be down below and if you're on linux you could use like gnome utility or the gnome disk utility to restore the iso to the usb or if you're on windows you could use a tool like etcher or rufus now once you do have a usb flash what you're going to want to do is dive into your bios to ensure that iomu is enabled now here real quick there's going to be a couple things in the bios that we're going to want to change the first one everybody's going to want to do and that's going to be going over to advanced and then under amd cbs you're going to want to go down to nbio and then right here you're going to see i o mmu you're going to want to make sure that that is enabled no matter your hardware no matter who you are you are going to need this enabled in your bios now the next one was a little specific to me and my radeon 580. if i go over here to boot i needed to disable csm this right here need to disable that for me because i was getting a lot of error 43 in device manager within the windows even after getting the driver to install because there is a bug sometimes within these radeon graphics cards but i will be leaving links in the description to some additional resources and stuff to help you out if you do run into some problems and now that you made sure that is set properly what you're going to want to do plug your usb into your computer and then set this as the boot priority and it will take you to the proxmox installation when you're actually in the install you just go install proxmox and then wait for it to boot into the next screen and then from here you go through the eula agree to it pick the hard drive you would like to install it onto go next and then from here pick your country and then change your time zone to what is proper for your location go next give yourself a strong complicated and a secure password under email we're going to replace this with something that's actually valid so from there we could go next the management interface is going to be the network card you're using under hostname there's a lot of different things you could put but for me i'm going to go with proxmox.local and then this right here is going to be your ip address that you're going to use to connect to later we're just going to go next here it's going to give you a rundown of just about everything and then you click install and then when the installation is successful it's going to give you your next steps which is going to be connect to your ip address in the web browser with the port 806. from there we can go ahead and select a reboot and then when we go ahead and actually reboot into proxmox it's not going to give us really a user interface it's just going to give us this with the same information we just said at this point you can leave your machine on unplug it from your monitor or whatever you use to install it and head over to your web browser alright here we are in a fresh install of proxmox and this right here is the guide that we're going to be using and i will note that this proxmox installation is completely fresh so there is no changes in either the volumes configuration or anything like that so let's get started by going to proxmox here and jumping into our shell what we're going to do first is some grub configuration so go ahead paste this it's nano etsy default grub hit enter into our grub config now the first thing we're going to do is go to grub cmd line linux default where it says quiet and what we're going to do here is add an entry to enable iomu and depending on your cpu you're just going to name the cpu so if you're running intel you would type intel if you're running amd type amd i'm amd so it's going to be amd underscore io mmu equals on and again you're going to want to make sure you do enable this in your bios so ctrl o to output exit this out and now we're going to go ahead and reload our grub configuration i will note if you check out that guide on reddit there's some additional variables and whatnot if you're running into issues but at least for my system just that works completely fine so let's go ahead and update grub so next what we're going to do is add some modules so instead of going to etsy default group we're going to go to etsy and modules you'll see this file doesn't really contain anything except for some commented outlines but what we're going to do is copy and paste the modules we want to add including vfio oimmu and pci so ctrl o to output that and control x and now we're going to do is some i o mmu reapping with or remapping with some echo commands here so this right here is the first one it's going to allow for unsafe interprets within the uh interprets configuration so hit enter and then our next one is going to be a kvm configuration echo command so paste that on in and hit enter now from there we're going to run a few more echo commands to blacklist some drivers this one right here is the radeon driver so blacklist radeon and what this is doing is making it so our actual proxmox system isn't going to try to use our dedicated gpu so that way we can pass it directly through to our virtual machine and i'm only going to be using radeon so that's technically the only command i need to input but i also have a nvidia gpu and i might want to throw it in this machine eventually so i'm going to blacklist all of the potential drivers here so paste that on in and hit enter and now we're going to want to do is actually add the gpu we're going to add to our vfio that is simply our virtual function io which we're going to be using for pass-through so to do this let's first list all of our available devices so we can find the right vendor ids so you just type in that command there if i go all the way to the top here you can see it's lspci v now i already know where mine is because this is like the fourth time i've done this but right there five o'clock basically that's a vga compatible controller advanced micro devices incorporated radeon rtx and this is actually a 580 card that makes you pay close attention because like for example this right here is an audio device right under that which also says radeon rx but this is for the uh audio over hdmi this right here is what i want to pay attention to this uh zero five semicolon zero zero and with that what we're going to do is type in ls pci just like before but this time we are going to do dash n s and then 0 5 0 zero or whatever number it is that you need to use hit enter and this is gonna give us some vendor id numbers right here so what we're gonna do is add this to our vfio configuration we're gonna do this with a echo command now i already put in the right variables here so these two numbers this one ending in 67 df and this one ending in aaf0 are the vendor id numbers that we want to use so right here under ids in this command you could see this one ends in 67df and this one ends in the aaf0 and it's adding this id to our etsy mob probe.d v f i o dot configuration hit enter and there we go so now we need to update that with this command right here and hit enter and this one takes it like 10 15 seconds depending on your hardware there we go so now we just need to type in reset hit enter and now we're going to be starting the fun part actually creating our virtual machine and first things first what you need to do is upload your iso images in order to save some time i've already done that under proxmox local i have my windows 11 english x64 which by the way it is 5.5 gigabytes of data that's crazy to me but in addition we have the virta io drivers because with the type of virtual disk and internet or internet drivers we're going to be using we're going to need some additional drivers download link for both of these will be in the description if you are interested so now let's actually make our virtual machine so go up here click on create vm and i'm going to call this win11 and i'm going to leave all this default for now i do have advanced selected under operating system for iso image we're going to select that windows 11 guest os change this to microsoft windows and then version is going to be 11 20 22. so from there we could go next to a system here and for machine q35 is absolutely perfect we're going to leave graphic card at default under scsi controller i am going to change this to scsi single ovmf for uefi bios is exactly what we want right here under the tpm storage we're just going to go with our local lvm same with our efi storage and version 2 for tpm is perfect so from there let's go ahead and continue to our disks bus device i'm going to change this to scsi and basically everything can remain default i am going to up the storage to 256 gigabytes of uh storage because i am actually going to end up using this virtual machine quite a bit so from there let's go next this is our cpu i'm just going to up this to four cores for now this is a eight core processor i have in here and everything here seems to look good so i'm gonna continue this is our ram our memory i'm gonna go with 16 gigabytes of ram so i'm going to be multiplying this by four going next and here under network we are going to want to change this you could keep everything at default except for the model right here we're going to want to change to vert i o and then from there let's go next and here is all of our configuration everything looks good to me so let's go ahead and finish that up so what we're going to do is go right here under our virtual machine and then we're going to go to options and just change our boot order real quick so we actually make sure to boot into the proper device so right here let's bump this up to the first spot this is our iso for windows 11 hit okay and now what we're going to do is some configuration again so let's jump back into proxmox under the shell and i'm going to just copy and paste this command here this is our actual virtual machine configuration file so nano etsy pvq or qemu server and right there under vmid you're going to change this to the proper id and that is 100 for this virtual machine you can just see it right here next to the name that we gave it so let's go ahead and hit enter and we are going to see a lot of stuff here now i'm going to paste over everything the guide says there's one thing that we're going to change or get rid of so if i go all the way down to the bottom here and paste this on in we're going to have machine cpu and arguments now the one thing we're going to get rid of is machine right here it says q35 these machines already appear as pcq 35 6.2 and that's a windows 11 specific configuration and since this guide has been written windows 11 came out so we're just going to get rid of that but we're going to be keeping the cpu and arguments here so ctrl o to output that enter control x to get out of there and now what we should be able to do is actually add our pci device to our virtual machine so if we go over to hardware add and we're going to want to add that pci device here we are and if something went wrong or you don't have something enabled properly you might get a message here just make sure again that you have been able to iomu properly but here if we click device this is going to look a little familiar we have our five o'clock looking number here which this is our graphics card the radeon rx 580 so i'm going to click on that and from here we're going to want to make sure all functions is enabled keep rombar checked we're not going to check primary gpu for now but we are going to check pcie express so let's add that and then we can see it right there and again if you do encounter any issues i would recommend referring it to that uh guide i have linked in the description so from there i do believe we're ready to start our virtual machine so i'm gonna go to start and we're going to get ready to press a key to get into our our boot well our windows installation so start boot option press any key i did press a key so now we should be jumping into the windows 11 install there we go and i'm going to pop this out so we can see it just a little bit better here bring this on over and let's just drop it right right here for now and go next install now and we're just going to run through the normal installation process but right once we get to the point where we're going to have to pick our hard drive that is where we are going to have to load in our drivers so for now i'm just going to windows 11 pro next i'm going to go ahead and accept these microsoft terms custom install and here you can see it's not showing a device so what we're actually going to want to do is real quick go back over to proxmox and do a little uh switcheroo here so under windows 11 we're going to go to hardware and right here under cd dvd drive i'm gonna go select that and go edit and we're just gonna quickly swap it out for those over i o drivers we inputted hit okay go back to our virtual machine over here and we're going to go load driver browse and now the cd drive is going to be the proper drivers so we're going to go vio s c s i right here going to select windows 11 and go with the amd 64. so if i load that you're going to see the proper red hot ver i o driver let's go next that's going to load in the driver and when it is done we're going to have to jump back over here real quick and switch it out so we can see right there it's detecting the drive so let's jump back over to proxmox and edit this switch out our disk for our windows 11 installation hit ok jump back over to our virtual machine here and then select this drive new apply ok and next so now we're just running through the basic windows install it's going to reboot a couple times and if it does boot into the installation again for some reason you're just going to want to go ahead and eject that iso and reboot your machine but at this point i'm just going to run through the normal windows installation process and uh meet you back in the windows desktop and i will note during the installation process you're not going to have internet so you have to continue with the limited setup and when we get in we're going to go ahead and install those proper drivers and speaking of here we are in our windows 11 desktop via no vnc now the very first thing we're going to want to do is enable remote desktop because the steps we're going to do after this we'll make it so no vnc may not work properly as we switch over from their drivers to our dedicated cpu so first thing we're going to go into settings real quick and under settings we're going to search for remote desktop settings now under here it's as simple as toggling this on enabling the remote desktop so let's confirm that this is our pc name and if you want to go ahead to remote desktop users and just confirm that you already have administrative access what should i do so now that that's enabled what we're going to do is get our ip address but before we can do that we actually need some internet connectivity let's see down here we have none so simply like we did earlier we're going to want to go back to proxmox with our cd drive selected click on edit and again switch this out for those vert i o drivers click ok go back over to our virtual machine you can see it they just popped up there but what we're going to want to do is go into our device manager so right here is our internet controller we're just gonna give that a quick right click and update the driver we are going to browse our computer and here let's click browse and go to that cd we just popped in and the drivers we're going to want to pull are in the net kvm folder right here so give that a click and then go down to windows 11 so select the amd64 and click ok when we hit next it should look perfectly fine so we have the red hat for io and we can see we are connecting to internet there so i'm gonna go ahead and close this out exit this out and now you're gonna want to take note of your ip address so we can remote into this in a little bit so let's open up the good old windows terminal and then just type in ipconfig like so and here it's going to give us our local ipv4 address which for me it's indigent 48 so i should remember that so let's close this out and what i'm going to do is actually close out this no vnc prompt right here and i'm going to log in with a client this right here is the rdp client i'm going to be using i think it's rumana remote desktop client it's installed by default ubuntu but this is a good one if you're running on linux and give a quick connect here and yes let's accept our certificate so then this is going to override that and i can switch this over to hardware for now now i'm just going to leave this logged in and under hardware we're going to go over to display here click on edit and for graphic card we're going to want to select none believe it or not because we're going to instead of using their drivers and their input we're going to use our actual dedicated graphics card and with that what we're going to want to do is go ahead and stop and start our virtual machine so let's hit stop this is going to end it and we should see it eventually disconnect down here there we go so i'm going to go ahead and start up our virtual machine and we should still be able to remote into it with having no display driver set awesome there we go so i'm going to type in my password and then i'm going to toggle dynamic update and make this window a little bit bigger so we have a a better time here there we go and now we're at the point that we could go ahead and install some drivers now before we do that i'm just going to show you our task manager real quick under more details performance you can see it is detecting our radeon rx 580 so it's currently using that which is a very good sign so we're going to go ahead and pull some drivers for it so i went ahead and grabbed some software this right here is the amd pro drivers because i'm going to be using this with davinci resolve and davinci resolve is good because out of any application out there this is the one that will definitely tell you if your gpu is garbage or not so first thing we're going to grab these are professional drivers so let's install those all right moment of truth protecting your system configuration for driver and software compatibility and there we are so it's detecting it let's go ahead and do an install and now our system is going to restart with those uh drivers installed all right so we are back after our driver installation if i go ahead and skip this you can see the software installed completely fine and if we do go over to settings we have our various options and jumping over to performance we can see it's detecting everything just fine so i'm going to close this out and let's do the uh the ultimate test and that is like i said installing and opening davinci resolve all right so let's agree to this install next install and finish why do we always go to restart every single time here we are so let's go ahead and see if this fires up davinci resolve first launch the true litmus test all right continue and when we start the setup it's going to let us know so quick setup here we go operating system good graphics good awesome so if we continue from there continue continue and continue we will have davinci resolve so that's just evidence enough that the gpu passthrough is working uh perfectly fine it's allow access allow and here we are in resolve absolutely fantastic and just like that we're using a gpu in a virtual machine make sure you subscribe to this channel because i'm going to be doing a lot more things with it as this now is going to be my home lab replacing a little mini pc that i was previously using for things like my jellyfin server a transmission client things like that so lots of fun tutorials on the way if you are looking for more content right now i do recommend going to the hundred days of home lab website what i'm going to be doing is linking to that as a pinned comment down below lots of cool content creators making similar type videos to this so check it out down below and with all that i do hope you have an absolutely beautiful day and good bye
Info
Channel: TechHut
Views: 138,789
Rating: undefined out of 5
Keywords: linux, proxmox, windows 11, gpu
Id: S6jQx4AJlFw
Channel Id: undefined
Length: 21min 27sec (1287 seconds)
Published: Fri Jul 22 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.