Passing a GPU through to a Proxmox container

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right so you've installed proxmox you started a container through plex on it uh got yourself a little media library going on you start telling your friends and family about it invited them to it at first they just ignored it because you know people are scared of whatever technology i guess but eventually they start using it and after a while multiple people are using at the same time and a few of them come back and say hey what's uh what's going on with the plex server i noticed a lot of buffering going on and it just kind of took forever just to watch a movie well you check out the usage you see what's going on there's a lot of transcoding going on which just takes your cpu you usage and spikes it all the way up to 80 100 percent and there's just no head room left well if you're having that issue like i was we're going to solve that next by taking something like this this is a quadro k 620 video card it's a i don't know it's a 10 12 year old card it's pretty old card but we're gonna pass it through to that container and we're going to uh set up the transcoding or the hardware encoding i guess you would say on plex to utilize our graphics card instead of the cpu take care of that buffering problem next on low res diy [Music] all right so the quadro k 620 like i said it's an older card it's a single slot low profile card and if you don't really realize how small this thing is here let me show you something this is my uh evga rtx 2060 and this is the k620 quite a bit of difference i guess i'll put it that way and get the mount out of your way but in my hand how about that it's quite a bit of difference you know it's an older car he said it's an older card but for what we're going to do with it it's perfectly capable it's uh it's based off the maxwell architecture it has a base clock of uh 1058 megahertz a boost clock up to 1124 so still it's not even hitting the base clocks of today's gpus your memory only has two gigabytes of gd gddr3 memory with a clock speed of 900 megahertz again this is an old card but perfectly capable of doing what we want it to do it's a pci express 2.0 by 16 and a max power of 45 watts we'll probably won't get to that but that that is the max power of it just figured i'd give you a couple quick specs on this guy in case you're interested in one i'll leave a link to a website that shows the specs and uh if it's still available on ebay i bought this thing for i want to say it was 35 off of ebay um if that seller still has some i'll throw the link up in the description also just in case you're interested in getting one no affiliation or anything like that i i just don't do that um so with that let's jump into proxmox and get this card pass through to to a plex container and uh see what it can do okay i have logged into my test server here it's a brand new uh setup and everything well i say brand new but the parts are old probably older than your kids are but they still work so we're using them as a like a test bench or whatever so first thing you're going to want to do is uh we're going to want to update everything on our node so i'm going to take this repository and we're going to add the no subscription repository we're going to go back to updates we're going to refresh it all right that task is complete so now we're going to actually do the upgrade and we're going to let it run of course we're going to agree with it one thing i want to point out to you is this line right down here says uh cemu seems you installed a kernel update please consider rebooting go ahead and just after you get done uh updating your system make sure you didn't have a kernel update if you did go ahead and reboot i'm going to reboot right now all right so i'm back up and running and with that done let's get down to the brass tacks of it here we're going to go to our node and we're going to the shell of our node first thing we're going to want to do is we're going to want to run a you name dash r and what this does is it tells you what version of the kernel we're running and actually it's updated since the last time i i tested this you know obviously i test this stuff a little bit before i come on here and show you guys uh how to do it and with that i want to make sure that all the updates are there for the kernel and if i run this uh apache dash cache search pve header command it's gonna show all of the uh different versions of the the uh kernel that are out there all the updates that have went through and we are on the 51319-6pve kernel so uh i want to update that so the way we're going to do that this guy right here it's an apt install install pve dash headers and what we're going to want to put in there is the version that we are currently running so i'm just going to highlight it i'll right click i'm going to copy it we're going to get rid of all that up to the install part right click paste and we're going to hit enter and it's just going to double check everything if there are for some reason when proxmox put this out which there you go it's updating some information right there so now i am sure that my kernel is up to date and if you don't know what the kernel is it's basically um when your system starts up it's the first group of commands that will tell your operating system like hey we've got this type of cpu we've got this type of the video card this type of ram and this these this is the parameters form so your cpu or you're not your cpu your operating system knows what equipment it has to it that's available to it and how it's set up all right next step is we're going to want to blacklist something and the way we're going to do that is we're going to edit the blacklist file with the nano space forward slash etc forward slash mod probe dash dot d slash blacklist dot com same file that we use when we did the gpu pass through to a virtual machine and the drivers that we're going to want to blacklist are these guys right here i don't know how you say that novu novada whatever i you know again midwestern accent i'd slaughter that doggone thing but that is those are the drivers that proxmox utilizes for the video card well we're going to replace those drivers with our new drivers for our quadro card so we don't want those drivers loading up at all so add that line we're going to go control x hit the y for yes and enter and that will save that file we're going to want to update the initro memphis file basically that's the the again back to the first line of stuff that's going on before the operating system really starts up and it's going to throw that additional stuff in there about blacklisting that driver so we'll hit enter and it's going to take a few minutes to uh make it happen you can see right there the the kernel is being edited and everything all right now that that's complete we're going to want to reboot the system again so reboot all right next up let's go ahead and install the drivers for the quadro card but first we're going to have to install the dependencies that the driver file is going to need to install everything we're going to do that with an apt install and it's a build oh my typing is horrible build uh essentials and i'm sure i didn't spell something right so let's see build uh oh not essentials he sent chol click yes and let it run okay now that that's complete we actually need to download the drivers from the nvidia website which i've got it up right here now i'll have again i'll have a link to this website in the descriptions as well as a list of all of the uh well a list of the instructions so it it's easier for you to find all this stuff now the website what we're going to want to do is click on search well let's go back there you're going to want to fill in your information about your video card that you're using so if you're not using the quadro k620 you're going to need to adjust these options to your video card you're going to do a search and then you can download it but right here it's going to tell you right there's the version the release date it's for linux and everything this is all stuff that i had uh requested in the screen prior uh if you want you can go through and double check to make your car make sure your card is listed in these drivers i i know the k620 is in these and then you'll want to download the drivers when you click download that brings you to the actual download page and what we want to do is we want to right click on it and we want to copy the link address we'll go back to the shell of our node and we'll do a w get and then we'll right click and paste that address in hit enter and it's going to start downloading the file for us it'll take a couple minutes let's do an ls and there it is there's our file that we just downloaded right there now that we've got the file downloaded we need to make it an executable file and the way we're going to do that is with a chrome mod space plus x space capital n and if we hit tab it's going to actually fill the rest of it in for us we'll hit enter and that will now make that file an executable file next up we're going to run it with a dot forward slash capital n again we're going to hit tab and we're going to hit enter and it's going to start initializing it's going to uh start building the kernel module which is like i said it's what starts before really the os does to let it know that hey use these drivers guys all right and video installer was forced to guess where the x library path is all right cool okay uh install the nvidia 32-bit compatibility library sure all right would you like to run the nvidia xconfig utility to automatically update your x configuration file so that the nvidia x driver will be used when you restart x i'm not using x so i i think that just actually has to do with the user with the with the graphics as in if you're using the graphics for something uh on a monitor or something i'm not doing this this system is headless i'm just going to use it for transcoding so i'm not going to install that so no and the installation of the nvidia accelerated graphics driver for linux is now complete we hit enter all right everything is done and said over with well let's check to make sure it's actually working so nvidia dash smi we hit enter and there we go it is up and running so we can see driver version uh 510.54 uh cuda version is right there 11.6 we have no processes running right now so i'm happy everything is up and running but let's go ahead and we're going to make sure that the drivers load every time we restart the system with a server like this you're probably not restarting it very often but just in case let's go ahead and make sure and to do that we're going to edit edit this file right here nano space forward slash etc slash modules dash load dot d forward slash modules dot config and wow i could hear my midwestern accent again there with the slashes and everything we're going to hit enter we're going to tab down to the bottom and we are going to add all the files that are the nvidia drivers the uh nvidia nvidia mod set and the nvidia uvm control x yes we want to save it and we're going to hit enter again we're going to want to update the integer methods file and enter all right now for some reason when the installation process happens it doesn't create certain device files that are required to run the nvidia card and pass it through to the config so i got the this information from wendell over at a level one tech actually article he wrote i'll have a link to that article in the description if you want to check it out but we need to create this file right here and it's a a 70-nvidia dot rules file i don't know what the 70s for maybe that's the no idea but that's what wendell used so i don't know if you know this or not but he's very smart about this stuff this is his life's work basically so we're just going to follow his example we're going to hit enter and we're going to add these rules right here there's three different rules and what they're basically doing is it's saying when the driver the nvidia driver or the mod set driver or the uvm driver are loaded it's going to run a bash command which is this file or that file or that file and it's going to it's going to set the permissions my goodness i was tongue tied there for these drivers uh when it loads up just in case well like i said because for some reason the drivers when you install the drivers it didn't do that automatically for you so let's go control x yes enter and uh control x yes enter save the file next up we're going to want to reboot it again so let's go ahead and reboot the system yeah that's right gas prices have got me crushing silver bullets i ain't proud i like me some cords light here and there probably gonna be drinking more of it here with the way it's going but hey to each their own okay with the system rebooted let's go ahead and make sure the driver's loaded properly yep everything is up and running we're good to go we're happy with that finally we're at the point where we are going to uh pass it through to the container now new system i haven't set the container up yet or anything so i'll hop off screen real quick and set that up we'll be right back actually let's go through all the steps together so there's no questions about what um operating system i used or how many cores i used or anything like that we're not going to waste a lot of time on this we're just going to speed through it real quick but we are going to create a container 100 is fine let's call it plex test and give it a password actually that's too complicated i won't remember that and let's do this one let's make sure we type it right and sure we're going to make it a privileged container we're going to hit next the only thing i've downloaded is ubuntu 21.10 so we're going to use that as our operating system eight gigabytes of disk space is just fine let's go ahead and crank the cpus up a little bit heck this thing's got a whole six on it so let's go ahead and with six to just try to speed stuff up the 512 is fine well here let's give it two gig of ram we'll hit next we'll make it dhcp we'll hit next dns is fine confirm and works for me so you'll notice i didn't hit the start after creation because we got a little bit of uh editing we need to do before we start up the container so there it is the container is created but actually what we need to do first is we need to edit let me look at my notes here we need to edit the configuration file for that container so nano space forward slash etc forward slash mpve slash lxe slash config and it says id we're gonna give it the id number of our new container of 100 and we're going to hit enter so we're going to scroll down and we've got a bunch of information to copy and paste in so we're going to copy and we're going to paste some stuff in here okay so we're looking at a lot of different stuff here this first section right here all of this their numbers the numbers here correspond to the files that are down here and what i mean by that is uh we'll use phone numbers as an example let's see say you uh want to call your buddy chris or something something like that you need the phone number to get a hold of him well that's basically what these numbers up here are like 195 uh oh that is actually like the phone number for this file right here the nvidia dot zero file so keep that in mind let's go ahead and clear this guy out and these are the phone numbers for these files that correspond to the card and drivers that i have installed yours may be different they may be different numbers and files so i want to save this and i want to save this guy where did i get these phone numbers from and the files from so if we do an ls space dash l space forward slash dev forward slash nv and we're going to use star so star just any file that starts with nb in that directory in the dev directory will be listed here and we'll hit enter and if you look right here we have there's your two numbers right there that correspond to this file so if you look below it there's two more numbers that correspond to that file so if we go back to our config file you'll see those numbers these numbers corresponding to these files are the same as when we ran the ls command like i said now yours may be different so you may need to adjust this this is not a simple copy and paste for every single video card out there you might actually have to do a little research a little hunting for this stuff but typically when you do that ls command it will uh no it's not a gun when you do that ls command it will give you the telephone numbers that you need all right now that that is finished we are going to go ahead we're going to start up our new container all right let's go ahead and log into it as always let's do an apt update and and app upgrade dash y all right so we've updated everything we've passed the video card through right well let's do an nvidia dash uh what is smt smi and there's nothing there okay it knows how to get to the video card but it doesn't know how to utilize the video card when i did the nvidia smi it gave you a list of all the drivers that are available for different nvidia cards so we know that when we went to nvidia and checked our video card it was the 510.54 drivers that we used so what we need to do is we need to install those drivers or download those in drivers install them in the container and exactly like we did in the shell for the node well not exactly let's just go ahead and do it and we'll see so we'll right click copy link back to our container and we're going to do a w get we're going to paste that in next up we're going to go ahead and run it with the dot slash capital n tab and we're going to add the extension dash dash no dash kernel dash module and what we're doing is um the container doesn't have a kernel it uses the kernel from the base operating system in this case it's proxmox debian and we're telling it that hey ignore the kernel part don't build a kernel uh stuff for it or anything like that just install everything else so we'll hit enter let it go through all right now this is up it's just telling you you specified no kernel which we're good with that nvidia installer was forced to guess again where the x library is that's cool whatever install the nvidia 32-bit compatibility library cool let's do that again i'm not it's utilizing x so we're not going to install that and the ins and the uh drivers are installed now so next up let's go ahead and do a reboot for good measure log back in and let's do an nvidia dash smi bam there you go drivers are installed it's up and running the container knows it's there everything is passed through we're happy uh i haven't installed plex on this yet uh i'm gonna go ahead and do that real quick off camera if you don't know how to install plex check out this video right here it'll run you through how to quickly do that but we'll be right back and we are back with a video of our hero queued up here so if we press play here i've got it muted so you're not gonna hear it uh and we're gonna minimize that guy if we go to our dashboard and if we look right here it says direct play on it which means it's playing it directly if we scroll down our cpu not getting hit too bad or anything like that but if we go back to our video and it's someone else is viewing it and their equipment is say not as good as yours or whatever and they need to transcode it down to like let's say 720p so all of a sudden the video stopped it'll start back up here and we still see right there that it says a direct stream and everything well if we scroll down it will notice that our cpu spiked up it went down if we let it play for a while it'll go up and down up and down up and down because it's having to figure out how to transcode from the 1080p or the 4k or the whatever back down to 720p so that's the whole reason we added this gpu in there because uh you know you get two three four five people doing that stuff that cpu is going to be pegged out all the time so if we stop that the way that we go ahead and and get uh hardware acceleration working well one thing is if you're doing it on plex you need a plex pass which i got a lifetime membership so that's no big deal for me but if you don't you'll have to subscribe and and get a plex pass or if you don't want to do that you can get something like jellyfin or mb that doesn't cost you anything to utilize transcoding and use those instead but four plex will scroll all the way down here to transcoding and we scroll down to this option right here where it says use acceleration when available we'll click it we'll hit save we'll go back to plex and start our movie from the beginning again with our hero here and we will go ahead and we'll change it back to that 720. we'll minimize this guy we'll go to our dashboard right here give it a few seconds and that that right there that is what you call the look of disappointment and this may so let's go back we'll press play oh did you see that the big sigh you know up here i was saying mud off okay but i did a little looking back into it to see what happened you remember way back when when i was talking about the phone numbers and how they correspond to each file and you need the right phone number to get a hold of that file yeah i went back i checked it same video card same machine as what i used before in my testing and the phone number changed on a couple of those files so throwing it out there i'm not going to skip ahead and say everything was perfect and i got everything right all the time because i definitely don't nobody does but seriously check those numbers out get them right and when you do well let's do it and go back to showing you after i change those fun phone numbers all right phone numbers are changed let's go ahead and change this over to the 720 like we tried to do it originally we go back let's go to our desktop we can see it still says direct play nothing much going on on the cpu give it a few seconds let it go ahead and catch up and that right there that's what i wanted to see before it said transcoding hw when it said just transcoding that meant the cpu was transcoding for you which we don't that's not why we made this video we want the graphics card to do the transcoding so there you go hardware transcoding is working graphic or the cpu hasn't done anything not a blip everything is hunky-dory with that thing if we go back into our container and we do an nvidia dash smi all of a sudden down here at the bottom right there we have one program running or one instance running whatever you want to call it sorry my phone started buzzing there and that is the transcoding of the video that we were watching so it takes a little while to get there you got to make sure you cross your eyes and dot your t's get everything working but it will eventually work all right it took a little effort to get there a little mistake along the way but we got it figured out everybody's happy my mother-in-law she can watch golden girls now and not have to worry about it buffering and i could sit down stairs and throw sanford and sun on for hours and not have a problem with it so hopefully you get the same outcome that i got and uh it works out for you and everything just remember follow everything step by step the instructions will be in the description the link to the nvidia driver page will be down there the link to wendell's article will be down there and i'm gonna throw a link down there that will tell you how many trans codes your video card is capable of because although my card is a quadro it's an old one so it's stuck with the same limit of just three trans codes it's the more expensive ones uh that and when i say more expensive you're in the three four five hundred dollar range for a used one that will do the unlimited transcodes but from what i understand there is a way to bypass that and i'm going to look into it and if i get it ironed out and think i can get some easy instructions down on how to do it i'll make that video next so if that interests you do me a favor reach down and karate drop the like button and roundhouse kick the subscribe button and we'll catch you later
Info
Channel: LoRes DIY
Views: 22,600
Rating: undefined out of 5
Keywords: lxc passthrough usb, lxc passthrough pci, lxc passthrough gpu, container passthrough, gpu passthrough linux, gpu passthrough proxmox, proxmox passthrough gpu, proxmox passthrough disk, proxmox passthrough, plex transcoder settings, plex transcoder, plex transcoding, plex transcoding gpu, plex transcoding settings, plex server, proxmox plex media server, proxmox plex container, proxmox plex gpu passthrough
Id: -Us8KPOhOCY
Channel Id: undefined
Length: 33min 17sec (1997 seconds)
Published: Sun Mar 13 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.