Passing a GPU to a Proxmox VM with PCI Passthrough
Вставка
- Опубліковано 25 сер 2024
- #Proxmox #Hypervisor #GPU #Passthrough
Full steps can be found at i12bretro.gith...
--------------------------------------------------------------------
Enabling PCI Passthrough
--------------------------------------------------------------------
01. Log into ProxMox VE either via SSH or the web based shell
02. Run the following commands
edit grub configuration to enable IOMMU
nano /etc/default/grub
03. Press CTRL+W and search for GRUB_CMDLINE_LINUX_DEFAULT=
04. Add the following value to GRUB_CMDLINE_LINUX_DEFAULT
a. If running an Intel CPU, intel_iommu=on
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on"
b. If running an AMD CPU, amd_iommu=on
GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on"
07. Press CTRL+O, Enter, CTRL+X to write the changes
08. Continue with the following commands
update grub with config change
update-grub
add vfio modules
nano /etc/modules
09. Add the following to the bottom of the file
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd
10. Press CTRL+O, Enter, CTRL+X to write the changes
11. Continue with the following commands
IOMMU interrupt mapping
echo "options vfio_iommu_type1 allow_unsafe_interrupts=1" ≫ /etc/modprobe.d/iommu_unsafe_interrupts.conf
echo "options kvm ignore_msrs=1" ≫ /etc/modprobe.d/kvm.conf
blacklist drivers
echo "blacklist radeon" ≫≫ /etc/modprobe.d/blacklist.conf
echo "blacklist nouveau" ≫≫ /etc/modprobe.d/blacklist.conf
echo "blacklist nvidia" ≫≫ /etc/modprobe.d/blacklist.conf
list pci devices
lspci -v
12. Scroll through the output and find the GPU (usually a video and audio device associated with it) and make note of the device identifier (ex 01:00.0, 01:00.1)
13. Continue with the following commands
output the vendor ID(s) of the devices
replace the device identifier (01:00) as needed
lspci -n -s 01:00
14. Make note of the vendor ID(s) output in the format abcd:1234
15. Continue with the following commands
replace the vendor ids from the output of the previous step as needed
echo "options vfio-pci ids=1002:6611,1002:aab0 disable_vga=1"≫ /etc/modprobe.d/vfio.conf
update initramfs
update-initramfs -u
reboot proxmox host
reboot now
--------------------------------------------------------------------
Passing GPU to A VM
--------------------------------------------------------------------
01. Log into the ProxMox web UI
02. Expand the target node and select the target VM from the left navigation menu
03. Select Hardware from the left sub-navigation menu
04. Click Add ≫ PCI Device
05. Select the GPU from the listing
NOTE: I have found that there is some trial and error required to get the GPU to work properly depending on the guest operating system. If you find that the GPU isn't working with all options checked, stop the VM, and edit the PCI hardware, unchecking one option at a time to see if you can find a working combination
06. Select Display ≫ Set the dropdown to none (none) ≫ Click OK
07. If you intend to use the VM at the console (not via RDP or VNC), you will need to passthrough a USB keyboard and mouse by clicking Add ≫ USB Device ≫ Select the USB device(s) or port(s) to pass to the VM
08. Click Start at the top right of the page
09. Watch the output of the GPU on an external display
If there is no output from the GPU, stop the VM and adjust the PCI hardware options as noted above
10. Once the VM has booted and is outputting to the GPU, install drivers for the GPU as necessary
Source: / the_ultimate_beginners...
Documentation: pve.proxmox.co...
Connect with me and others ###
★ Discord: / discord
★ Reddit: / i12bretro
★ Twitter: / i12bretro
Dude thank you very much! I've been struggling for days trying to make steamOS work on Proxmox with GPU passthrough until I found your videos. Thanks!
You're welcome! Glad it was helpful
Okay.. so doing this with another machine now.. and it's a 5700XT. Gets to the open core boot menu.. I boot OS12 and after about 1/3 of the status bar under the apple logo. It crashes and the screen goes black. I've heard about a reset bug? Anyone get this to work with a 5700xt?
God bless you man!
Hopefully everything works well for you
Question, I was able to passthrough my RX580 without any of these steps. Would a problem manifest later on I should know about?
I passthrough my rX 550 too just with the final steps. the only thing i had to do was the step of /etc/default/grub becouse my PM was complaining about IOMMU, but with my NVIDIA GTX 1650, worked fine, but with all the steps. PS, in the end, i got no video, but let the machine update the drivers and then work fine!
Question... If i switch my gpu and plug it into the same slot that i used for the old gpu. Do i have to do this process all over?? Example: 6600 XT replaced with 5700 XT
I'd guess that would depend on if the hardware IDs changed, but I've never tried it. You wouldn't have to do the whole process over, just update the parts referencing hardware IDs
thanks, did you do it for the lxc container?
I've never tried PCI passthrough to a LXC to be honest
@@i12bretro I have a task to make PCI passthrough to a docker container inside an lxc container, in lxc I made passthrough access, but have not yet been able to install the driver
@@i12bretro As I understand it, there is no need to install the driver on the host machine, only in the container?
I had already done 1-8 steps with my proxmox setup. I do not apply next steps. Then i go to Proxpox GUI and pass my 3060 videocard. But when i run VM i get: Error: Failed to run vncproxty. And i have no video. Should i do all the steps in this article?
Hmmmm, but via RDP i got passthrough.
Came for the PCIE passthrough advice. Stayed for the music. What's the track playing in the background?
Haha, just something I wrote and recorded to use in my videos. It's apparently polarizing. Some people like it, others tell me to stop using it
@@i12bretro If you don't already have one, you should start a Soundcloud or something!
one more question, do I have to boot to proxmox on my main system so it can pass? please explain
I don't understand what you're asking
He wants to know if you launched the system (win10) directly on the server that ships the proxmox.
Does the Proxmox's interface itself need its own GPU? I mean if my system only have single GPU (no iGPU) this can be done?
No it doesn't. If all you have is a dedicated GPU you can pass that through to a VM. You'd just lose console access on the Proxmox host if you ever needed to troubleshoot
Hello friend, my proxmox server is on a mini PC a beelink u59 mini s, with Intel Celeron n5095 processor, can you tell me if it is possible to do this procedure with only video on it? is it compatible?
The short answer is probably not. The integrated graphics, or iGPU, on some hardware can be passed through, but I haven't found a reliable way to get it to work. There's a lot of discussion on the topic in the Proxmox forums if you want to get into it.
@@i12bretro Got it, thanks a lot for answering.
2.21 Why did you check Rom-Bar Did you provide anywhere the rom.bin file of the gpu?
I believe it's checked by default, and no, I didn't specify a file anywhere
Thank you very much for the video. Hi I have one issue. I followed every step by step. I have Nvidia Quadro P400, pass through to my Dell PowerEdge R630, Proxmox. I found the gpu under hardware, added to my vm on the web GUI. I plugged the gpu to a external monitor, it even displays the Windows vm on that monitor. However, problem is, Device manager only shows "Microsoft Basic Display Adapter". I saw yours show that too, but after a black screen, it refreshes to show the gpu.... What did you do there? Thanks again.
Windows automatically found and installed the drivers for the GPU I had installed. Sounds like you need to install the driver for your P400 so Windows knows what hardware is there
Follow the steps without missing any steps. But press start Windows, the screen does not display and makes me very discouraged, try to repeat many times, it doesn't work. Help me Pls. 😭
GPU : NVIDIA GTX1050
CPU : i5 3330s
MAINBOARD : ASROCK H61M VS-3
Check lspci -knn to confirm the GPU is using the VFIO module and run dmesg --follow while starting the VM to watch for errors. GPU passthrough isn't always straightforward
Egarly waiting for igpu passthrough. 😀
I've spent about 8 hours trying to get it working. I can see the VM take control of the iGPU output, and it shows in device manager or macos system report, but can't get it to output anything
Just a quick update, I got iGPU passthrough working. It's a pain and so far I've only gotten output from Linux VMs
Would this also work for a mac vm? I plan to run Mac OS Ventura with an RX 570
Yes, as long as MacOS supports the GPU.
I followed all the steps carefully , But when I start my Hackintosh-VM than display goes blank and not showing anything on display
I am using RTX3050 graphics card , Is RTX3050 supported ?
PCI passthrough should work, but the GPU is likely not supported by MacOS: dortania-github-io.thrrip.space/OpenCore-Install-Guide/macos-limits.html#gpu-support
Now I changed my graphics card to gt710 , Now I am getting follow error when I start VM
i.imgur.com/FjHvAl1.png
I have 940m laptop and don't work this for me, i think this pc hardware so can you show us laptop hardware version to?
Laptop hardware is basically the same, but very very dependent on how the hardware and motherboard are configured (and in my experience, a pain to get working). The 940m is an Nvidia chip and hasn't been supported in MacOS since OSX 10.13, so it won't work with any recent MacOS version.
@@i12bretro i want to use windows and ubuntu hardware acceleration to some program but i cant figure out so thanks anyway. 👍
Ahh I see. I just got a laptop with a GTX 1650. If I can get passthrough working I'll make a video on it. Getting integrated Intel GPUs working with passthrough has been inconsistent at best. I've spent too much time on it the past 18 months and it only works under certain conditions
@@i12bretro I asked because I couldn't find it anywhere, I thought maybe you might know. it would be nice if you could teach us, thanks.
I'll try to do some testing this week and see if it works. I'll let you know what I find out
Thanks, but how do I boot macOS / windows on the host machine, I mean without using the browser’s web vm, but boot macOS from the server machine?
You would need to pass physical GPU hardware and keyboard/mouse to the VM
@@i12bretro How do I do that?
Hey , I want to shutdown proxmox when my hackintosh vm goes shutdown , How can I do that?
There's no built-in way, but here's some suggestions www.reddit.com/r/Proxmox/comments/sfwdsx/question_is_there_a_way_to_automatically_shut/?
Bad very Bad, after done, proxmox cant boot, you need all reinstall new!!!!
can you Passthrough a GPU (which is supported by Apple) to macOS? Thank you
Yes you can. I actually have a video posting tomorrow on that exact topic
this maybe a stretch but you can help out with my amd threadripper 3970 with gigabyte trx40 master having such a hard time with this
I don't have any AMD hardware to test on, sorry. What part are you having trouble with? You can also hop on the Discord channel to see if anyone is able to help you through any issues
I am getting the error: Cannot bind 0000:03:00.0 to vfio, what can I do or what could be the issue?
PCI passthrough isn't perfect, so there's alot of variables. I'd suggest scrolling through the official docs and verifying everything is setup correctly and no typos
pve.proxmox.com/wiki/Pci_passthrough
@@i12bretro I see, i had tried multiple guides and all the same issue. For reference I am using r7 3700x and AMD RX 480 (trying to pass through) and with the 5700xt being used for the host. Either way thanks ill try that, thanks!
@@wali8976Google for "BUILDING A 2U AMD RYZEN SERVER (PROXMOX GPU PASSTHROUGH / OBS OR XSPLIT IN VM)" - that was the guide that worked for me.
@@m.l.9385 Thanks man, ill give it a shot
i tried this method and it wont work for me. idk whats wrong tho it keep showing black screen on my monitor
i changed the efi configuration too for changing my resolution and some flag, but it wont work
any suggestion sir? itll be very helpful
thanks a lot btw
btw im on nvidia gtx 1650
Proxmox GPU passthrough isn't perfect. I'd suggest searching on their forums to see if anyone has discussed your exact GPU and gotten it working and how
OK! Can you do it with iGPU, UHD630 or HD4600????
I'm working on an iGPU tutorial. Haven't gotten it working yet, just outputting a black screen
@@i12bretro I think the main problem is that the iGPU is busy with the HOST operating system when the system starts
Well you add the iGPU to the blocklist, just like a dedicated GPU. So once Proxmox hits loading initram it releases the iGPU. From what I've been researching, I'm thinking it has more to do with IOMMU groups and the iGPU being grouped with other integrated devices, but I haven't had time to test the theory
@@i12bretro subscribed to comments
@@i12bretro If you get it working please let me know u.u ❤️
can you pass 3 vms on 3 monitors with the same pc?
You would need 3 separate GPUs
@@i12bretro I meant can u pass to a server with 3 monitors on 1 gpu on 1 pc (because you can use triple monitors with a usb something I don't know)
No, as far as I know it would require a GPU per VM. I haven't seen any way to use one GPU for multiple VMs
alright that is sad
make a passthrough for macos vm and the cards that are supported !!!!!!
my proxmox is alive because of your videos thnx a lot
Glad to hear it. I don't currently have a GPU that Mac supports, but the steps are the same. I was able to get output on this GPU from Big Sur, but it didn't recognize what it was
@@i12bretro you had almost similar user experience like a Mac with gpu pass ? Because after the steps you give on your bigsur video the experience is bad in my case
Yeah, the input lag that the Proxmox console has was gone. I don't have much experience with Mac aside from VMs and Hackintosh, but the experience was fine for me
@@i12bretro thnx a lot for your time and your answers. We all look forward I believe for igpu pass 😂
great and clean, please can u make a video about iphone usb passthrough with xcode and god bless u
Hi, thanks a lot for you guide, It helps me a lot on how to install, it's only lacking to configure the passthrough
how can I solve this problem?
TASK ERROR: cannot prepare PCI pass-through, IOMMU not present
when this comman is executed, an error message appears:
update-initramfs -u
Running hook script 'zz-proxmox-boot'..
Re-executing '/etc/kernel/postinst.d/zz-proxmox-boot' in new private mount namespace..
No /etc/kernel/proxmox-boot-uuids found, skipping ESP sync.
I can't run IOMMU, cloud you help me please? tell me a tip...
It could be a lot of things, PCI passthrough is far from perfect and according to Proxmox, it's experiemental. I'd suggest making sure your hardware supports IOMMU and that you didn't typo anything in the GRUB file (I've done this before). Here is the official documentation as well pve.proxmox.com/wiki/Pci_passthrough
@@i12bretro could you help me on create an EFI for old way hackintosh? How could I contact you?