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

КОМЕНТАРІ • 85

  • @faustomarquez1975
    @faustomarquez1975 10 місяців тому

    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!

    • @i12bretro
      @i12bretro  10 місяців тому

      You're welcome! Glad it was helpful

  • @joetalkshow
    @joetalkshow 2 роки тому

    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?

  • @wali8976
    @wali8976 2 роки тому +1

    God bless you man!

    • @i12bretro
      @i12bretro  2 роки тому +1

      Hopefully everything works well for you

  • @mansley1281
    @mansley1281 Рік тому +1

    Question, I was able to passthrough my RX580 without any of these steps. Would a problem manifest later on I should know about?

    • @jlgiorio
      @jlgiorio Рік тому

      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!

  • @GeekShhh
    @GeekShhh 7 місяців тому

    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

    • @i12bretro
      @i12bretro  7 місяців тому

      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

  • @EvgenMo1111
    @EvgenMo1111 8 місяців тому

    thanks, did you do it for the lxc container?

    • @i12bretro
      @i12bretro  8 місяців тому

      I've never tried PCI passthrough to a LXC to be honest

    • @EvgenMo1111
      @EvgenMo1111 8 місяців тому

      ​@@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

    • @EvgenMo1111
      @EvgenMo1111 8 місяців тому

      @@i12bretro As I understand it, there is no need to install the driver on the host machine, only in the container?

  • @user-ub3pm6wo2y
    @user-ub3pm6wo2y 10 місяців тому

    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.

  • @itspaafekuto
    @itspaafekuto 2 роки тому

    Came for the PCIE passthrough advice. Stayed for the music. What's the track playing in the background?

    • @i12bretro
      @i12bretro  2 роки тому

      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

    • @itspaafekuto
      @itspaafekuto 2 роки тому

      @@i12bretro If you don't already have one, you should start a Soundcloud or something!

  • @Gamingking-wt7zg
    @Gamingking-wt7zg 2 роки тому +1

    one more question, do I have to boot to proxmox on my main system so it can pass? please explain

    • @i12bretro
      @i12bretro  2 роки тому +1

      I don't understand what you're asking

    • @josuen.6719
      @josuen.6719 2 роки тому

      He wants to know if you launched the system (win10) directly on the server that ships the proxmox.

  • @andreasrichman5628
    @andreasrichman5628 Рік тому

    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?

    • @i12bretro
      @i12bretro  Рік тому +1

      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

  • @danielanderson2532
    @danielanderson2532 Рік тому

    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?

    • @i12bretro
      @i12bretro  Рік тому

      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.

    • @danielanderson2532
      @danielanderson2532 Рік тому

      @@i12bretro Got it, thanks a lot for answering.

  • @ierosgr
    @ierosgr 2 роки тому

    2.21 Why did you check Rom-Bar Did you provide anywhere the rom.bin file of the gpu?

    • @i12bretro
      @i12bretro  2 роки тому

      I believe it's checked by default, and no, I didn't specify a file anywhere

  • @yedeng.827
    @yedeng.827 Рік тому

    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.

    • @i12bretro
      @i12bretro  Рік тому

      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

  • @reverseanonymous3850
    @reverseanonymous3850 2 роки тому

    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

    • @i12bretro
      @i12bretro  2 роки тому

      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

  • @heromasum
    @heromasum 2 роки тому

    Egarly waiting for igpu passthrough. 😀

    • @i12bretro
      @i12bretro  2 роки тому

      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

    • @i12bretro
      @i12bretro  2 роки тому

      Just a quick update, I got iGPU passthrough working. It's a pain and so far I've only gotten output from Linux VMs

  • @thorium9190
    @thorium9190 Рік тому

    Would this also work for a mac vm? I plan to run Mac OS Ventura with an RX 570

    • @i12bretro
      @i12bretro  Рік тому

      Yes, as long as MacOS supports the GPU.

  • @krishkapadia5704
    @krishkapadia5704 2 роки тому

    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 ?

    • @i12bretro
      @i12bretro  2 роки тому

      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

    • @krishkapadia5704
      @krishkapadia5704 2 роки тому

      Now I changed my graphics card to gt710 , Now I am getting follow error when I start VM
      i.imgur.com/FjHvAl1.png

  • @gokselk
    @gokselk Рік тому

    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?

    • @i12bretro
      @i12bretro  Рік тому

      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.

    • @gokselk
      @gokselk Рік тому

      @@i12bretro i want to use windows and ubuntu hardware acceleration to some program but i cant figure out so thanks anyway. 👍

    • @i12bretro
      @i12bretro  Рік тому

      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

    • @gokselk
      @gokselk Рік тому

      @@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.

    • @i12bretro
      @i12bretro  Рік тому

      I'll try to do some testing this week and see if it works. I'll let you know what I find out

  • @mrcow5834
    @mrcow5834 2 роки тому

    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?

    • @i12bretro
      @i12bretro  2 роки тому

      You would need to pass physical GPU hardware and keyboard/mouse to the VM

    • @mrcow5834
      @mrcow5834 2 роки тому

      @@i12bretro How do I do that?

  • @krishkapadia5704
    @krishkapadia5704 2 роки тому

    Hey , I want to shutdown proxmox when my hackintosh vm goes shutdown , How can I do that?

    • @i12bretro
      @i12bretro  2 роки тому

      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/?

  • @smarthome10
    @smarthome10 8 місяців тому

    Bad very Bad, after done, proxmox cant boot, you need all reinstall new!!!!

  • @hth3858
    @hth3858 Рік тому

    can you Passthrough a GPU (which is supported by Apple) to macOS? Thank you

    • @i12bretro
      @i12bretro  Рік тому

      Yes you can. I actually have a video posting tomorrow on that exact topic

  • @lavellefloyd4639
    @lavellefloyd4639 2 роки тому

    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

    • @i12bretro
      @i12bretro  2 роки тому

      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

  • @wali8976
    @wali8976 2 роки тому

    I am getting the error: Cannot bind 0000:03:00.0 to vfio, what can I do or what could be the issue?

    • @i12bretro
      @i12bretro  2 роки тому

      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

    • @wali8976
      @wali8976 2 роки тому

      ​@@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!

    • @m.l.9385
      @m.l.9385 2 роки тому +1

      @@wali8976Google for "BUILDING A 2U AMD RYZEN SERVER (PROXMOX GPU PASSTHROUGH / OBS OR XSPLIT IN VM)" - that was the guide that worked for me.

    • @wali8976
      @wali8976 2 роки тому

      @@m.l.9385 Thanks man, ill give it a shot

  • @royale8847
    @royale8847 2 роки тому

    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

    • @royale8847
      @royale8847 2 роки тому

      btw im on nvidia gtx 1650

    • @i12bretro
      @i12bretro  2 роки тому

      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

  • @user-qe3ip6yh4c
    @user-qe3ip6yh4c 2 роки тому +1

    OK! Can you do it with iGPU, UHD630 or HD4600????

    • @i12bretro
      @i12bretro  2 роки тому +2

      I'm working on an iGPU tutorial. Haven't gotten it working yet, just outputting a black screen

    • @user-qe3ip6yh4c
      @user-qe3ip6yh4c 2 роки тому

      @@i12bretro I think the main problem is that the iGPU is busy with the HOST operating system when the system starts

    • @i12bretro
      @i12bretro  2 роки тому +3

      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

    • @artemkonoplin2143
      @artemkonoplin2143 2 роки тому

      @@i12bretro subscribed to comments

    • @raular5513
      @raular5513 2 роки тому

      @@i12bretro If you get it working please let me know u.u ❤️

  • @Gamingking-wt7zg
    @Gamingking-wt7zg 2 роки тому

    can you pass 3 vms on 3 monitors with the same pc?

    • @i12bretro
      @i12bretro  2 роки тому

      You would need 3 separate GPUs

    • @Gamingking-wt7zg
      @Gamingking-wt7zg 2 роки тому

      @@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)

    • @i12bretro
      @i12bretro  2 роки тому

      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

    • @Gamingking-wt7zg
      @Gamingking-wt7zg 2 роки тому

      alright that is sad

  • @babissk
    @babissk 2 роки тому

    make a passthrough for macos vm and the cards that are supported !!!!!!

    • @babissk
      @babissk 2 роки тому

      my proxmox is alive because of your videos thnx a lot

    • @i12bretro
      @i12bretro  2 роки тому

      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

    • @babissk
      @babissk 2 роки тому

      @@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

    • @i12bretro
      @i12bretro  2 роки тому

      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

    • @babissk
      @babissk 2 роки тому

      @@i12bretro thnx a lot for your time and your answers. We all look forward I believe for igpu pass 😂

  • @abdelkadergnichi6643
    @abdelkadergnichi6643 2 роки тому

    great and clean, please can u make a video about iphone usb passthrough with xcode and god bless u

  • @eduardo.bortolato
    @eduardo.bortolato 2 роки тому

    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...

    • @i12bretro
      @i12bretro  2 роки тому +1

      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

    • @eduardo.bortolato
      @eduardo.bortolato 2 роки тому

      @@i12bretro could you help me on create an EFI for old way hackintosh? How could I contact you?