Setting up gpu passthrough on a nvidia optimus laptop

Hey guys, so I have an asus rog gl551J which has an nvidia optimus graphics card allowing me to switch between the intel integrated graphics and nvidia gtm960m. I would like to boot linux with the intel integrated graphics card and then virtualize windows 7 with my gtx960m, is this possible? If you need more info about my system, here it is:

Conceptually....yes it should work, the CPU supports VT-d and VT-x so as long as the MB supports virtualization then it is conceivable, for me the deciding factor would be if you can drive two different monitors one internal (host) and one external (guest), I don't think it would be possible for them to share the same display without issues since both will be fighting over who controls the display. When you start the KVM with pass through the underlying OS (Linux) is still running, the hardware you are passing through has been removed from Linux control at boot up, and is basically dead until the KVM is started and the guest OS fires up initializing the GPU and it's connected display.

The other issue is using a Nvidia GPU in a KVM, Nvidia has gimped it's driver stack to look for virtualization and if it see's it's in a virtual environment it will refuse to load giving a error in Windows, there are work-arounds to solve the issue but it does require more steps and added configuration.

Be a neat project to try though...let us know how it works out.

OK, thanks, I will start as soon as I get home today. If I succeed, I am going to make a wrapper so it is easier next time.

1 Like

As long as you're going about it with the intent to learn it will be fine, but if you have plans on using it for lets say like gaming in Windows running in the KVM your system really doesn't offer enough resources to share to run modern games very well since you will probably be giving the KVM 2 CPU cores along with it's hyper threads and probably half of your RAM which will be 8gig, while that is enough resources to run Win 7 in my opinion it's a bare minimum requirements to run Win 7 reliably....add the overhead of a semi-modern game and it will bring the OS to it's knees rather quickly....but that is just my opinion.