Jump to content

gpu passthrough on linux

Hi, I used to have a dual boot system(windows, arch) on sperate disks but as stupid as it may sound I was too lazy too constantly reboot my pc and boot into windows so I decided to use vmware on arch linux for gaming but since I only have 1 gpu passthrough is not possible until I read a post that the reason two gpus are needed for passthrough is so that one can be dedicated to the guest Os and the other one to the Host Os but since linux dosent require a gui I wanted to know if there was a way to passthtough my one gpu without having to care for a gui in the Host Os. Thanks in advance 馃檪

聽My system specs are:

12700KF(I regret buying the cpu without an igpu now 馃槥)

rtx 3070ti

32gb ram 3600mhz

msi z690 edge wifi ddr4 motherboard

Note I may consider using kvm or qemu as I can "hijack my gpu" and it is bare metal.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, goatedpenguin said:

but since linux dosent require a gui I wanted to know if there was a way to passthtough my one gpu without having to care for a gui in the Host Os.

While Linux doesn't require a GUI as such, if you want to see what the guest OS is doing, Linux needs to be able to show its screen. Which means it very much requires a GUI in this case.

You can run VMs in a "headless state", which means Linux renders the VMs UI in a virtual frame buffer, but you won't be able to see anything on your screen. You would then need to somehow forward that virtual frame buffer to another machine with a GPU to show the frame buffers contents. Normally the host shows the contents of the VMs screen, by rendering it on its own GPU/showing the image generated by the guest as part of its own UI.

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

what's the point of running the windows VM on top of a headless linux install?

as far as i'm aware you cant "hotswap" a GPU back and forth between the host OS and the VM, so if you'd want to use it for the VM, you cant rely on it for the host OS.

Link to comment
Share on other sites

Link to post
Share on other sites

6 hours ago, manikyath said:

as far as i'm aware you cant "hotswap" a GPU back and forth between the host OS and the VM, so if you'd want to use it for the VM, you cant rely on it for the host OS.

You can but you have to kill any active Display Servers (X.org/Wayland).

if you just search for single gpu passthrough you will probably find a few guides on how to do it, for instance https://github.com/QaidVoid/Complete-Single-GPU-Passthrough

Personally I don't see the point.

  • It won't be any faster than dual booting. You still need to exit your session and boot Windows each time you want to use your VM.
  • Unless your passing a Physical Disk, it will probably consume slightly more space
  • Your going to take a performance hit
  • Your adding more room for things to go wrong
  • Linux will be mostly unusable while the VM is running
    • You can ssh from windows, but you might as well just be using WSL which will be more usable.
  • If your goal is to Play Games, some games such as Valorant have Active VM detection and consider it a bannable offense.

My Recommendation would be to either buy a second GPU, Dual-Boot, or just use Windows with WSL.

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Nayr438 said:

if you just search for single gpu passthrough you will probably find a few guides on how to do it, for instance https://github.com/QaidVoid/Complete-Single-GPU-Passthrough

my biggest worry here would be getting the GPU back after coming out of the VM.

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, manikyath said:

my biggest worry here would be getting the GPU back after coming out of the VM.

While that linked guide does include libvirt hooks to detach and reattach it to the host, it does go with the whole "more room for things to go wrong".

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, Nayr438 said:

While that linked guide does include libvirt hooks to detach and reattach it to the host, it does go with the whole "more room for things to go wrong".

couldnt I go into a tty session and do all that stuff to get my gpu back after exiting the vm?

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, Nayr438 said:

You can but you have to kill any active Display Servers (X.org/Wayland).

if you just search for single gpu passthrough you will probably find a few guides on how to do it, for instance https://github.com/QaidVoid/Complete-Single-GPU-Passthrough

Personally I don't see the point.

  • It won't be any faster than dual booting. You still need to exit your session and boot Windows each time you want to use your VM.
  • Unless your passing a Physical Disk, it will probably consume slightly more space
  • Your going to take a performance hit
  • Your adding more room for things to go wrong
  • Linux will be mostly unusable while the VM is running
    • You can ssh from windows, but you might as well just be using WSL which will be more usable.
  • If your goal is to Play Games, some games such as Valorant have Active VM detection and consider it a bannable offense.

My Recommendation would be to either buy a second GPU, Dual-Boot, or just use Windows with WSL.

I think its clear it wont work becuase I usallly play games like valorant which will detect vms so instead can someone help me fix the grub secure boot policy error which requires me to disable secure boot as it needs to load an unsigned package/ module and windows requires secure boot to be on

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now