One Nvidia GPU for Linux Host OS & Windows 10 Guest OS / VM

I’ve been researching on how to use one Nvidia GPU for the Linux host & Windows 10 guest / VM. What I found so far is that the GPU has to be unbind and X-org has to stop on the host, then binding it in the guest. Once done with the VM, you have to have the GPU be rebind and X-org start again. I haven’t found any videos or test that shows this works. Is this possible?

My Goals:

  • Swich my Host to Linux from Windows 10
  • Able to use the same GPU under Linux Host & under Windows 10 guest when needed.
  • Only plug three LG 25" Ultrawide monitors in one Nvidia GPU.
  • Use of one GPU card only (No iGPU)

Current Specs:

  • AsRock Z170 Pro 4
  • i5-6600K
  • Nvidia GTX 1070
  • 8Gb RAM, will upgrade to 16Gb
  • 3x LG 25" Ultrawide monitors with each Res of 2560 x 1080

I know it is possible to run the host with no graphics at all, but it is not ideal. You would have to be able to ssh to the host from another computer to get back video. The other question is can you detach the nvidia proprietary driver from the GPU once it is attached? I remember hearing somewhere that this was not possible, where as it is with mesa. Assuming that detaching the driver on nvidia even works, you’re still only getting dualboot level functionality when using a single card.

Was there a reason that you wanted to do it this way?

Yes/Maybe but…

You are in for a world of pain with that approach.

  1. Search for “looking glass” here on L!, you may find this a far easier approach.
    Looking Glass - Guides, Help and Support
  2. 3x 2560x1080 is a lot to ask of a 1070 does that run acceptably in windows for you now?
  3. It’s far, far easier when not using spyglass to have a $10 GPU as your primary because…
  4. while you can bind and unbind the GPU from the driver in linux/X, you’ll find the driver is not well vetted for this flow. It’s buggy. 50/50 as to whether any given unbind/re-bind cycle will work from my personal experiences in arch and centOS. I was trying it with 2 1080’s - unbinding one and dedicating it to a windows VM.

This was pre-spyglass though. When I do this again, I will be starting with that approach as it appears very promising. I got all the GPU stuff settled, but had issues with sound/usb stability myself on my test system. I have a new system to try, but haven’t had time to try it.

EDIT: oops - looking, not spy - that’s the benchmark - and added a link

Yes all 3 monitors run very well in Windows 10 and in games. The 1070 is able to run them with no problems.

Also, I been thinking of having 2 VMs one Linux and other Windows 10 running on a very light weight Linux. What is the prefromance of Linux in VM?

Depends wildly on what you want to do with it - someone else posted a link to a recent test comparing VMs and docker to WSL to bare metal:
https://www.phoronix.com/scan.php?page=article&item=wsl-february-2018&num=2

Short version is generally does pretty well. virtual-box isn’t as good as vmware or kvm either.
BUT I/O performance is pretty terrible on WSL specifically.

Personally I find WSL for daily-driver linux activity gets annoying. Little strange things don’t work that you won’t notice for quite a while (menus not functioning, Z-depth - aka: thing X on top of thing Y - breaks now and then and then there is cut&paste - though linux is never 100% with that either in a gui).

Take a look at looking-glass. It will allow you to divorce your windows from needing a specific monitor dedicated. It will run in a window with very, very low overhead. It still needs a 2nd GPU, but frankly absent a serial console capable motherboard or server MB with a dedicated VGA port, you are asking for trouble trying to do that with one GPU.

EDIT: you could try to look into USB serial console as a solution. That would at least give you some ability to connect up directly to the “host” if you needed to. It doesn’t solve the instability of nvidia drivers connecting and disconnecting to them to switch back and forth though.

Why do you want to compartmentalize everything? What purpose does it serve for you to swap to a linux host and virtualize windows and also have a linux guest? are you planning on using the same GPU on both guests? Is this all because you dont like to reboot? because a dual boot setup would scratch this itch with a lot less work to do it.

2 Likes

if i was to do it it would be to clean the slate of the windows VM with ease and not cause to many headaches.( disposable sandboxes FTW)

Yes, same GPU on both.

You would have to update the image still…or at least you really should. That would make game saves a real headache since you have to now move them from their default location to some persistent storage.

As I stated on your other thread, the virtualization tech isnt quite there yet. You need a GPU for your host (if you want to use its GUI) and one for each guest. You’ll either have to suck it up and buy another one or deal with the IGPU for linux. Maybe in another year or so you might be able to do what youre asking to do. The tech is evolving quickly and theres a lot of development going on. As @cekim stated, its technically possible but a PITA and doesnt always work.

Again, a dual boot setup is going to server you better.

Be aware that if you want to compartmentalize everything ala unRAID, you will not be able to run VAC secured titles like CS:GO cause the Anti-cheat now looks for if you’re using virtualization and boots you from a game if you’re using a VM.

When did that start to happen? I used to play CS:GO in a vm a while back.

I talked about it a while back. @wendell can back me up on this. He said it in a livestream too.

You need a card that supports SR-VIO. Only some enterprise grade hardware supports this and as far as I know the Linux Kernel does not have facilities to deal with this at this time. AMD is working on this problem though as they have line of cards that supposedly supports this. I think some of the NV Quattros support this as well.

In the meant time, Looking glass is your bets bet.

Good Luck