Two Gamers, One GPU from your Windows PC! Hyper-V Paravirtualization Build and Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

I want to learn about virtual machines, specially gaming on one but I always thought sr iov was not available for consumer gpus and there was no way to share a gpu between host and guest or multiple guests without sr iov.

Yesterday I randomly found this video about GPU partioning and thought "theres no way it this easy". Is this a new technology or was this available for quite some time?
are there any disadvantages when compared to sr iov?

Also another question: In this video he used parsec to access the vm. why didnt he just use the vm window and make it fullscreen on a second screen? Is it not possible to drag the window areound or make it fullscreen?

👍︎︎ 1 👤︎︎ u/KnightBlad3 📅︎︎ Sep 07 2021 🗫︎ replies

Pretty cool idea, I only wonder how safe and healthy it actually is for the GPU.

👍︎︎ 1 👤︎︎ u/AltruisticTone7399 📅︎︎ Sep 07 2021 🗫︎ replies
👍︎︎ 1 👤︎︎ u/MrFredcamelo 📅︎︎ Sep 08 2021 🗫︎ replies
Captions
yes today i am building a gaming pc yes i understand that parts are really hard to find at affordable prices right now and yes i feel bad about it today's video is brought to you by manscaped and the performance package 4.0 which includes everything you need to keep your yard looking its best having the right tool for the job is paramount as you're not going to get the results you want with the wrong equipment the lawnmower 4.0 is ip67 rated so you can look your best whether it's rain or shine plus with its skin safe technology you won't end up tilling instead of just trimming you'll also get the weed whacker for ear and nose hair crop preserver to keep your tomatoes dry and the crop reviver to keep them cool go to manscapes.com craft computing to get 20 off free international shipping and two additional free gifts that's manscapes.com craft computing and remember your balls will thank you welcome back to craft computing everyone as always i'm jeff like i said yes i am building a gaming pc and i fully understand the market being what it is right now you're not going to be able to do the same thing unless you're willing to pay scalper prices that being said i am building this pc for a very specific purpose and that is to demonstrate gpu pair virtualization or gpup inside of windows hyper-v the idea being if you have enough horsepower in the gaming pc you may already own you might just be able to spin up a virtual machine and share your graphics card with a second client so enough of the apologies and excuses what gaming pc am i building today for starters we're going to be using the nzxt b550 motherboard which is nzxt's first entrance into an amd chipset really curious to see how they did on their first go-round for the cpu i opted to go with the ryzen 7 3700x which has 8 cores and 16 threads now i did consider going with a 5000 series ryzen but the only one that i have on hand is a 5600 x which only has 6 cores and 12 threads since this system is going to be running two gamers on a single cpu i opted for more threads instead of faster single threaded performance as i feel it's going to be a little bit easier to balance out the resources for memory i went just a little bit overkill with a 64 gigabyte kit from patriot viper running at 3 600 megahertz and while i probably could have gotten away with a 32 gigabyte kit as i always say overkill is often underrated at first glance it might seem like i went overkill on the storage as well with the patriot viper vp 4300 2 terabyte drive this is an nvme gen 4x4 drive with read speeds of up to 7 400 megabytes per second however keep in mind that even though most games won't take advantage of that additional read speed we are going to be running two gaming machines on the same hardware which means i will take every bit of extra performance that i can get for the power supply i've got an in-wind p85 850 watt 80 plus gold full modular unit which again should be more than adequate for this build keeping things cool will be the job of the in-wind br 36 all in one liquid cooler with a 360 millimeter radiator and of course there's just a touch of rgb on there nothing too flashy though i promise in fact i don't know that i need to worry too much about the internal rgb because chances are your eye is going to be drawn to the newly updated inwin 309 now i've reviewed this case before and it is a chassis that i love to hate i absolutely hate the cooling performance on it but damn if it doesn't look good while doing it so i think that just about wraps this up but i can't feel as if i'm missing something i know i know you're mad for the gpu i'm going to be rocking the nvidia rtx 3070 founders edition and yes i paid way more than retail in fact this card cost me a thousand dollars and that was the friend of a friend pricing all right i'm all done feeling guilty let's build this thing [Music] do [Music] do [Music] well that took a little bit longer than i anticipated uh as cyril once said on archer inwin and nzxt do you have any comment cards because i might have some thoughts on this one let's start with the inwin 309 chassis now as i mentioned before i have reviewed this case previously on the channel and while it is a gorgeous looking case and the front effect is absolutely fantastic it is a case with some pretty major design flaws in it i'm not going to go rehash those all here but you can click right up here if you want to see me go through those in short there are no front intake fans on this chassis replaced instead with this beautiful pixel art screen that means all of your intake is at the bottom of this chassis which it doesn't come with any fans for the intake so you are going to have to supply your own the in-wind saturn fans that you see inside of here are included with the 309 and tie into the led effect from the front panel and i think that is just a fantastic look overall however as you can hear they have a tendency to ramp themselves up at random because i can't seem to control these fans through the motherboard even though these are plugged in directly to the cpu header even at idle these fans run at about 1250 rpm and then randomly ramp up to about 1800 and even idle they're definitely not silent the good news though is they don't seem to have any problem at all pushing air through the radiator and out the back side of the chassis now you might notice i don't have the side panel currently installed on the chassis and that's for two good reasons number one it always looks better on camera to cut out that reflection and number two in this case the inwin br36 pump hits the side panel because there's no good way to route the tubing up to the radiator mount when doing product reviews i always try and note if there's going to be any potential incompatibility when trying to mount with standard hardware and nzxt we'll get to you in just a minute so just to clarify what the problem is here if you haven't caught on already inwind's br 36 all-in-one liquid cooler doesn't fit into the in-win 309 apparently their engineering departments really don't like speaking to each other now if you press on the pump you can get it to kind of lay flat against the fans and i guess it does work but it also blocks the majority of the rgb lighting and just looks terrible i could not get this aio to look good inside this case speaking of potential mounting difficulties let's go ahead and bring in nzxt to this conversation you see while i do love the shielding on the front of the nzxt motherboards the holes are not big enough to fit a standard case screw through and the in-wind 309 as well as many other case manufacturers use standard case screws for mounting motherboards in in the case of a veteran system builder like myself that's not really that big of a deal as i have boxes upon boxes of different size screws which means finding a replacement is pretty trivial however if this was my very first pc i would not have been able to screw the motherboard into the chassis another note on the saturn fans and why i use those instead of the lunafans that came with the br36 well you can see the cabling that comes off these fans is not really all that long and you might also notice that the fan on top of the cpu block is also not spinning there's also supposed to be an rgb effect inside of there as well the reason being is this is the set of cables that is required to plug into that cpu block to let your fans run and the rgb connect uh i took one look at this and frankly gave up but even if i did go through the trouble of plugging all of this in to get the rgb working i wouldn't be able to tie in the rgb on the luna fans to the front of the chassis as that is a proprietary connection that daisy chains to the inwin saturn fans so again if i wanted to use an in-wind 309 and a br36 cooler i can't use those two components together and still keep the rgb effect consistent between the sets that's kind of disappointing from a manufacturer's standpoint now originally i didn't plan on reviewing a lot of the hardware in this build as i figured they would go together pretty easily and we can get into today's tutorial however i ran into so many little nitpicky show-stopping issues i felt they were all worth addressing and don't get me wrong i think all these components are probably just fine by themselves in individual builds the in-win 309 the br-36 and the nzx tb550 but putting them all together in this particular system kind of brought all those little nitpicky issues to the surface but with all that out of the way let's go ahead and show you how i configure gpu pair virtualization in hyper-v and was able to put two gamers on a single cpu and single graphics card so what do you need to get started well the whole reason i built this pc was to give you an example of the hardware that this can run on but this will run on pretty much any consumer hardware the issues you're going to run into are do you have enough cpu memory and gpu resources to actually share and get a decent gaming experience for starters make sure your graphics card drivers are completely up to date as of the time of filming i'm using nvidia driver 471.41 on the rtx 3070. gpu pair virtualization can be done with either an amd or an nvidia-based graphics card today i'm going to be demoing it with an nvidia based card but there's no reason an amd card wouldn't work as well however the driver configuration will be a little bit different for software you're going to need windows 10 professional or higher this will not work on windows 10 home edition if you do have windows 10 home installed you can upgrade it to windows 10 professional and if you need a license key for that i will have ebay affiliate links down in the video description as far as which version of windows 10 i'm on update 21 h1 i do know this feature was added to hyper-v in version 20 h2 however i don't think it was active any time before that so you will need version 20 h2 or higher to run gpup to see if your gpu is capable of being split i'm going to open up a powershell window as administrator then i'm going to type in get vm partitionable gpu if you get no output then you're not currently ready to go make sure you update to the latest version of windows and make sure your graphics drivers are installed and up to date you should however get an update that looks something like this depending on the gpus that you have installed and this is all of the different parameters that you can set when setting a partitionable gpu now that we know the hardware is good to go we can move on to the virtual machine setup and for that we're going to install hyper-v or windows hypervisor to install hyper-v go to the windows menu and type in turn windows features on or off it's kind of an obscure control panel feature that is still enabled in windows that's really not accessible from anywhere else this should bring up a window that looks something like this and we're going to go down to hyper-v and check the box right by it and then click ok installation will take just a minute or two and once it's done you will need to reboot your computer so go ahead and do that and come back here when you're ready once your computer is back up and running we're going to open the hyper-v control panel and once again you can go to the start menu and just type in hyper-v and open up the hyper-v manager now there are a few things inside hyper-v that we need to change before we get to creating our virtual machines first and foremost we need to create a virtual switch so your virtual machine can actually reach the internet and be addressable by the internet by default hyper-v sets up a virtual switch where you only have communication with the host device not the greater internet itself so in the left column here we're going to right click on the server and go down to virtual switch manager in the menu that pops up we're going to click on new virtual network switch and this is an external facing network and then click on create virtual switch i'm going to name this switch external i know real creative we will confirm that this is an external facing switch and select your network adapter right here now in my case i only have a single network adapter so that's the one we're going to use if you only have a single network card make sure to check allow management operating system to share this network adapter otherwise your host computer will lose network access in lieu of your client computers and if everything looks good go ahead and click on apply and pending changes may disrupt network connectivity because it is creating a new network bridge and moving your internal connectivity over to that network bridge and go ahead and click on yes next we're going to click on our computer again and go down to hyper-v settings and then we're going to disable enhanced session mode so click on enhance session mode and uncheck that box and then hit apply and okay now as you can see i've already created a test virtual machine here but now we're going to create a virtual machine for you so yet again right click on your computer go to new and virtual machine this will open up the new virtual machine wizard go ahead and click on next and give your machine a name so i'm going to name mine gpup-02 click on next make sure to select a generation 2 hyper-v machine otherwise gpu-p will not work go ahead and click on next now again since i have 64 gigs of ram in this machine i have quite a bit to spare so i'm going to give my virtual machine 16 gigs worth or 16 384. now this is also a very important part for gpup you need to uncheck use dynamic memory for this virtual machine if you have dynamic memory enabled gpu passthrough will not function if everything looks good there go ahead and click on next for network connection i'm going to grab this pull down menu here and go to external which will connect this virtual machine to our externally facing hyper-v switch now we need to create a virtual hard drive and i'm going to give mine 250 gigabytes worth of space now that is a dynamically expanding drive which means it will only take up as much space as it is actually using in the virtual machine so by creating a 250 gig drive you're not actually taking 250 gigs of your hard drive space now you need to say how you plan on installing an operating system most people will probably be selecting an iso so click on an operating system from a bootable image click on browse and then browse to your windows deployable image in my case i have a windows 10 21 h1 iso in my downloads folder with that selected go ahead and click on next and then click on finish now even though we clicked on finish through the create new vm wizard there's one more setting that we need to change because windows has yet to implement this one very crucial setting into the hyper-v wizard so go ahead and click on your new virtual machine and go down to settings go down to processor and give it more than one cpu thread are you listening microsoft in this case i have an 8 core 16 threaded chip and i'm going gonna give it eight cpu threads so we'll balance this machine pretty much 50 50. there's one last thing we need to do which is required for gpup and that is to turn off checkpoints so go down to checkpoints and uncheck the enable checkpoints box with both of those things changed go ahead and click on apply and then click on ok with everything out of the way let's go ahead and start up our virtual machine so double click on your newly created vm and click on start and from here you're going to install windows as you normally would once you've got windows installed go ahead and come back here and we can start on the gpu partitioning so you've completed your windows inception and you have windows running inside your windows because dog i heard you like windows anyway you might be wondering why i bothered putting a gpup tutorial at the end of a gaming pc build the reason being is because gpup turns out to be very simple to install so as you can see i've got windows installed in a vm and it is booted up here but the first thing i'm going to do is actually minimize that and work on my host pc i'm going to open up a new file browser go to my computer go to the c drive then windows system 32 and then driver store open up file repository and then if you have an nvidia card the folder we are looking for is named nv underscore d-i-s-p-i dot inf underscore amd64 followed by the uuid of the particular card that you are going to be partitioning if you have multiple graphics cards installed you will see multiple versions of this folder with different uuids at the end in my case we only have the single 3070 so that is indeed the folder we want i'm going to take that folder and make a copy of it on my desktop next up we need a couple more files so i'm going to create a new folder on my desktop and i'm just going to name this one system32 in your file browser go back to system 32 and type in nv until you reach the files that start with nv then you're going to copy all of them because all of these files are nvidia driver files that you will need to forward on to your client vm and i'm going to make a copy of these over in the system 32 folder i just created so now i have the nvidia display driver and the driver contents from the system 32 folder as it relates to my nvidia graphics card but i need to copy both of these onto my virtual machine now the method in which you do that will vary depending on what you have set up in your home network for me i'm just going to copy it to my home nas and then copy it onto my virtual machine you can do this direct on the pc with powershell commands or even copy these to a usb device and then forward the usb device onto your client vm the choice is entirely up to you so for me i'm just going to copy those onto a folder on my network share once you have those copied over go ahead and close out of that folder as we are done in there on the host go ahead and go to your virtual machine and i'm going to map the network share and copy them onto the desktop so again here i am on my virtual machine i'm going to copy those two folders onto the desktop with them copied over we actually need to move them to their permanent home and the reason you can't do that direct from a network share is you're disallowed to copy things from a network share to your system folders by default at least with standard microsoft permissions if you've disabled uac or some other crazy things then maybe you could do that but copying to the desktop is a sure way to make this file transfer work so yet again on the virtual machine i'm going to go to the c drive windows and then system32 i'm going to open that up open up the system32 folder you created on the desktop copy all of the files in there to the system32 directory on your virtual machine so now your vm should look something like that next up inside of the system32 folder we're going to create a new directory and then select yes on uac and we're going to name this host driver store and again select yes go ahead and open up that folder we're going to create a new directory inside of here called file repository and then we're going to drag our nvidia driver folder into file repository continue all right and with the files moved go ahead and shut down your virtual machine with the vm shutdown we're going to go ahead and open up powershell ise so go to the start menu and type in powershell and we're going to run ise as administrator this will actually open up the powershell script editor and it's much easier to do the next step inside of here for download down in the video description is a powershell script that you will need and i'm going to go ahead and open that up now it is called gpup partition the script itself is pretty simple as all we do is we add a vm partition adapter to a particular virtual machine and all you need to do is change the name of the virtual machine so in this case i'm going to apply a new gpu partition to gpup-02 now there's one thing we need to do before we actually run this script and that's enable scripting to run on your system as it is disabled by default so i'm going to type in set dash execution policy and then i'm going to type in unrestricted i'm going to say yes to all and that will allow this script to actually run next all i need to do is hit play and we're done you're done you've split up your 3070 into multiple chunks your host will now dynamically assign memory depending on the load between your client virtual machine and your host machine you can also set this up to split into multiple virtual machines and run your own quasi cloud server inside your home it's really that easy but i guess you'd rather me show you than just tell you that it works alright i guess that's fair enough go ahead and turn your virtual machine back on so i'm going to click on start once you've logged into windows go ahead and go down to the start menu right click on it and go up to device manager and if we click on display adapters you can see we now have an nvidia geforce rtx 3070 inside of our virtual machine it just works now i will note if you come up with a code 43 make sure you verify that you copied all of the correct driver files and you have also created them with the correct names inside of system system32 that is probably the biggest issue that i ran into when trying to get this whole thing working but once you have it up and running it's actually very very simple so now there's just a couple more pieces of software that we need to make this a fully remotely accessible virtual machine first up we need a piece of software called vbcable and that is a virtual audio driver and i used that in the previous proxmox vgpu tutorial and by the way if you want to run just a complete server with no windows access whatsoever go ahead and click the little card right up here to find out how to do that on a proxmox server i'm going to go ahead and install that driver and we're going to need parsec so we can actually remotely access this machine i'm going to install parsec as a shared user that way we have access to the login screen just in case and once that's installed go ahead and log into your parsec account and finally there's one last piece of software we need to make this whole thing work seamlessly and that is a usb monitor virtual driver now that seems like kind of a weird thing to make parsec work but here's the full story parsec will only work if it has a monitor plugged into a video card now the way hyper-v works is when you open up this hyper-v window right here you're technically plugging a monitor into the hyper-v graphics driver now parsec will technically run so long as this hyper-v preview window is open but you also lose the ability to change resolutions or go full screen on applications using a usb monitor adapter makes parsec work flawlessly so i'm going to copy this over to my desktop and then i'm going to install this using the batch script found inside so run as administrator yes and it should say driver installed successfully and if that's the case you can go ahead and close your hyper-v monitor and you're ready to connect all right so i'm going to try to demo this in the way that makes the most sense and so up here in the top left screen is actually our virtual machine so this is the machine running inside hyper-v uh down in the bottom right is the physical machine and so this is the machine that is running hyper-v and then this display right here shows both screens so hope that kind of makes sense so as you can see on both the physical machine and the virtual machine i have reva tuner opened up because i need to set frame rate limits for both of these machines the reason being is the gpu will actually give all priority to the physical machine if you are trying to render 3d graphics now while the power allocation for the gpu is fairly dynamic meaning that the virtual machine can access up to 100 of the gpu's power it also prioritizes the physical machine if the physical machine is trying to run a game so if we don't find a way to cap the power of the physical machine as soon as we fire up a game that means the virtual machine won't be able to play games anyway kind of negating the whole point of this video so on the physical machine i'm going to use reva tuner and set a frame rate limit of 120 fps i think that's a pretty good number assuming we have a high refresh rate monitor and something with either g-sync or freesync enabled over on the virtual machine i'm going to do the same thing but instead of a 120 fps cap i'm going to set a 60 fps cap as i only have a free version of parsec and i'm limited to 60 frames per second anyway so now let's go ahead and see how this thing works first off i'm going to fire up heaven benchmark on the virtual machine we're going to set this at full screen directx 11 high quality and i'm going to set tessellation and let's go ahead and set it at extreme just to see what we can possibly get out of it meanwhile over on my physical computer i'm going to play some cyberpunk 2077 just to really run this thing through its paces so as you can see heaven benchmark on the virtual machine is cruising around right at 60 frames per second at that capped frame rate and honestly if i wanted to set up like a raspberry pi 400 and have my kids be able to play on my graphics card that's a perfectly acceptable frame rate for a second computer jumping on over to the physical pc let's go ahead and get into the game real quick so with heaven running in the background you can see that our gpu load sitting right around 30 to 40 percent so here we are in cyberpunk 2077 this is that rtx on at medium settings and high quality for the rest of it uh we're cruising right along at about 50 frames per second but if i jump into the dual view you can see that heaven is still indeed running at 60 fps so if we were having a two-player gaming session side-by-side on the same computer this is more than playable up in the top right of the physical machine you can see the uh riva tuner statistics the gpu is sitting at 98 utilization and is hovering right around 74 degrees celsius give or take uh you can see depending on where we're at in the map we are getting right about 60 fps but heaven seems to be doing just fine at 60 fps on its own and now to go ahead and show you how dynamic the graphics power is i'm going to go ahead and quit out of heaven right here and you can see we're hovering right around 60 fps standing still inside cyberpunk so i'm gonna go ahead and hit quit let's get out of that and you can see immediately we jump up to about 84 fps so about a 25 to 35 increase in frame rate once we exit heaven and that is how you have two copies of windows running on the same cpu and same graphics card and have multiple gamers able to play at the same time now as you saw the rtx 3070 handled two games at the same time pretty easily in fact you could actually probably get a third gaming machine in and running on there if you wanted to depending on the game that you were playing and as you saw with my cloud gaming server the more hardware you have the more you're able to partition out so if i had something like a 5950x and let's say a 3090 or even a pair of 3090s that would make for a pretty incredible multi-headed gaming setup this process is fairly straightforward and the best part is it's free minus the windows licenses that you need to run this so windows pro licenses you can pick up for about five dollars a piece on ebay and if you wanted to have a second gaming pc instead of building a second gaming pc right now you could just split the one you already have no extra hardware required and i think that's all i've got for you in this one i hope you liked the build itself as well as found the tutorial helpful if you liked this video make sure to hit that thumbs up button and subscribe to craft computing if you haven't done so already if you're interested in any of the parts from today's build i will have affiliate links down in the video description go give those a look and if you like the content you see on this channel and want to help support me in what i do consider joining the patreon or float plane links are also down in the video description as a bonus you'll get exclusive access to my discord server where you can chat with myself and the other hosts from talking heads thank you all so much for watching this one and as always i will see you in the next video cheers guys
Info
Channel: Craft Computing
Views: 76,106
Rating: 4.9542799 out of 5
Keywords:
Id: XLLcc29EZ_8
Channel Id: undefined
Length: 28min 40sec (1720 seconds)
Published: Sat Jul 31 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.