Jump to content

Running Windows games on Linux in a VM using the GPU?

Guest

Hi

 

I want to switch to Linux completely, but I have some games that I want to play(Train SIm World, GTA V) that I can't get to work in wine.(Program to run windows apps on Linux natively)

I also have some other things I'd like to be able to test on a windows VM. So my question is, is it possible to have a VM use a GPU using pass through, but have the OS(Ubuntu) also use it.

I know it can be done with an extra GPU, which I luckily do have(RX480), but I prefer to use my Titan Xp(which then would be shared with Ubuntu).

The reason I don't just use my RX480 is because It isn't as fast, and it requires a pcie power connector(which I only have 2 of, which are connected to my Titan Xp). I'll try to run my Titan Xp with one PCIe power connector now though, but I guess that won't work.

 

So in short: How can I passthrough my GPU to a windows vm, and allow Ubuntu to use it too?(So no DirectX emulation layer and stuff, as that's slow)

(If that's actually possible)

 

Thx!

Link to comment
Share on other sites

Link to post
Share on other sites

What CPU do you have? Does your CPU have an iGPU? Enable that in the bios as primary display source for Linux then pass through the TitanXP through to the VM.

 

Have you tried the new Steam compatibility tool for Linux; Proton? It's largely based off of WINE and is still in early days so you may not see improved compatibility over WINE, but might be worth trying.

 

Alternatively could you just dual boot in to Windows, or do you need the Linux OS running at the same time?

 

4 minutes ago, timl132 said:

The reason I don't just use my RX480 is because It isn't as fast, and it requires a pcie power connector(which I only have 2 of, which are connected to my Titan Xp).

What PSU do you have?

CPU: Intel i7 6700k  | Motherboard: Gigabyte Z170x Gaming 5 | RAM: 2x16GB 3000MHz Corsair Vengeance LPX | GPU: Gigabyte Aorus GTX 1080ti | PSU: Corsair RM750x (2018) | Case: BeQuiet SilentBase 800 | Cooler: Arctic Freezer 34 eSports | SSD: Samsung 970 Evo 500GB + Samsung 840 500GB + Crucial MX500 2TB | Monitor: Acer Predator XB271HU + Samsung BX2450

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, AshKetchup said:

Stop using Linux and go back to Windows if you want to actually be able to play video games

I only play video games like once a week for one hour. I want to use Linux because of multiple reasons:

1. I can finally have my privacy back. Since the Windows installer has literally an option to enable a keylogger.(which ofc is enabled by default and hidden)

2. I am more familliar with it, even though I kinda like the Windows 10 GUI.

3. Less wasted resources and forced updates. Plus all the standard crap ware like Minecraft and Candy Crush will be gone too.(which it reinstalls after deletion lol)

 

I tried running a GPU with one power cord:

IMG_20180917_165010021.jpg.d3f0f06c4c5117d33beb283b78bc3f68.jpg

That doesn't work. I'm surprised it did anything at all actually.

Link to comment
Share on other sites

Link to post
Share on other sites

6 minutes ago, timl132 said:

I also have some other things I'd like to be able to test on a windows VM. So my question is, is it possible to have a VM use a GPU using pass through, but have the OS(Ubuntu) also use it.

Sadly, no - you need a separate card for passthrough. You can use your lower end card for ubuntu and play all games on the VM though.

 

-edit-

for the power cord, you can use adapters from the sata connectors.

5 minutes ago, AshKetchup said:

Stop using Linux and go back to Windows if you want to actually be able to play video games

There's no reason to when he can use kvm...

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

7 minutes ago, timl132 said:

Hi

 

I want to switch to Linux completely, but I have some games that I want to play(Train SIm World, GTA V) that I can't get to work in wine.(Program to run windows apps on Linux natively)

I also have some other things I'd like to be able to test on a windows VM. So my question is, is it possible to have a VM use a GPU using pass through, but have the OS(Ubuntu) also use it.

I know it can be done with an extra GPU, which I luckily do have(RX480), but I prefer to use my Titan Xp(which then would be shared with Ubuntu).

The reason I don't just use my RX480 is because It isn't as fast, and it requires a pcie power connector(which I only have 2 of, which are connected to my Titan Xp). I'll try to run my Titan Xp with one PCIe power connector now though, but I guess that won't work.

 

So in short: How can I passthrough my GPU to a windows vm, and allow Ubuntu to use it too?(So no DirectX emulation layer and stuff, as that's slow)

(If that's actually possible)

 

Thx!

You can't share a consumer grade between a vm and a host. Grid, tesla and some radeon pro cards allow this. But the easy option is to get a second gpu.

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Sauron said:

Sadly, no - you need a separate card for passthrough. You can use your lower end card for ubuntu and play all games on the VM though.

There's no reason to when he can use kvm...

Ok, guess I'll have to buy a sata to pcie power connector then. I can't use my lower end card for ubuntu as I do 3D gmae engine programming, and I quite need the power. But I think the games should run pretty well on a RX480.

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Electronics Wizardy said:

You can't share a consumer grade between a vm and a host. Grid, tesla and some radeon pro cards allow this. But the easy option is to get a second gpu.

Wait.... SO it can be done actually? Didn't expect that to be honest. ;)

Isn't there some driver hack maybe to allow it?

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, Spotty said:

What CPU do you have? Does your CPU have an iGPU? Enable that in the bios as primary display source for Linux then pass through the TitanXP through to the VM.

 

Have you tried the new Steam compatibility tool for Linux; Proton? It's largely based off of WINE and is still in early days so you may not see improved compatibility over WINE, but might be worth trying.

 

Alternatively could you just dual boot in to Windows, or do you need the Linux OS running at the same time?

 

What PSU do you have?

Ryzen R7 1700, it doesn't have an IGPU. I don't use steam actually, I don't like it. I need Linux to run at the same time.

I have a seasonic 620W 12something. I am sure it only has 2 power connectors.

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, timl132 said:

Ok, guess I'll have to buy a sata to pcie power connector then. I can't use my lower end card for ubuntu as I do 3D gmae engine programming, and I quite need the power. But I think the games should run pretty well on a RX480.

why not just dual boot here?

 

1 minute ago, timl132 said:

Wait.... SO it can be done actually? Didn't expect that to be honest. ;)

Isn't there some driver hack maybe to allow it?

no easy driver hack.

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Electronics Wizardy said:

why not just dual boot here?

I NEED Linux to run at the same time, for now I'll do the dual booting thing. But I don't want to reboot every time I want to play a game for 10 minutes before I get bored. Also, I use the Windows VM for testing applications, for which I need to also have Linux running.

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, Electronics Wizardy said:

You can't share a consumer grade between a vm and a host. Grid, tesla and some radeon pro cards allow this. But the easy option is to get a second gpu.

Wow, I didn't know this. It's still much cheaper to get another titan x than to buy a tesla though :P

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, timl132 said:

Ryzen R7 1700, it doesn't have an IGPU. I don't use steam actually, I don't like it. I need Linux to run at the same time.

I have a seasonic 620W 12something. I am sure it only has 2 power connectors.

I'd replace the PSU. The Seasonic S12ii isn't a great power supply and not what I would recommend for a TitanXP. Upgrade the PSU then you can run the RX480 for Windows VM. RX480 is still a decent card and should have no issues running GTA V and Train Sim at 1080p as long as the VM is allocated enough CPU resources (cores).
Look at PSUs like the Seasonic Focus Plus Gold (650W+), Corsair RMx (650W+) or Corsair TXM (650W+) as they will have the required PCIe connectors.

CPU: Intel i7 6700k  | Motherboard: Gigabyte Z170x Gaming 5 | RAM: 2x16GB 3000MHz Corsair Vengeance LPX | GPU: Gigabyte Aorus GTX 1080ti | PSU: Corsair RM750x (2018) | Case: BeQuiet SilentBase 800 | Cooler: Arctic Freezer 34 eSports | SSD: Samsung 970 Evo 500GB + Samsung 840 500GB + Crucial MX500 2TB | Monitor: Acer Predator XB271HU + Samsung BX2450

Link to comment
Share on other sites

Link to post
Share on other sites

4 hours ago, timl132 said:

Hi

 

I want to switch to Linux completely, but I have some games that I want to play(Train SIm World, GTA V) that I can't get to work in wine.(Program to run windows apps on Linux natively)

I also have some other things I'd like to be able to test on a windows VM. So my question is, is it possible to have a VM use a GPU using pass through, but have the OS(Ubuntu) also use it.

I know it can be done with an extra GPU, which I luckily do have(RX480), but I prefer to use my Titan Xp(which then would be shared with Ubuntu).

The reason I don't just use my RX480 is because It isn't as fast, and it requires a pcie power connector(which I only have 2 of, which are connected to my Titan Xp). I'll try to run my Titan Xp with one PCIe power connector now though, but I guess that won't work.

 

So in short: How can I passthrough my GPU to a windows vm, and allow Ubuntu to use it too?(So no DirectX emulation layer and stuff, as that's slow)

(If that's actually possible)

 

Thx!

It is possible but not convenient. You would need a separate, and preferably not a power hungry video card, maybe some nvidia low end ones, and PCI passthroughing requires a lot of steps. You have also to make sure your IOMMU groups are separate for your PCI slots, IOMMU correctly supported and enabled, dumping the GPU bios, etc.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, jpenguin said:

Did you try https://fdossena.com/?p=wined3d/index.frag to run it it in wine?

W8...Why not just use Lutris which uses DXVK, that is far better than opengl. Also Wined3d is included in the recent versions of wine but is useless since DXVK came out

Link to comment
Share on other sites

Link to post
Share on other sites

19 hours ago, Lukyp said:

W8...Why not just use Lutris which uses DXVK, that is far better than opengl. Also Wined3d is included in the recent versions of wine but is useless since DXVK came out

I tried lutris, but whenever I check the "Use DXVK" option, the game never opens. Unchecking it does allow GTA V to open, but with really weired graphics with overexposure and all.

I confirmed that DXVK dll's are installed in the correct folder(it did that automatically), and the correct version is selected. It just wont launch with that.

Any idea what might be wrong?

 

Thx!

Link to comment
Share on other sites

Link to post
Share on other sites

22 hours ago, timl132 said:

I tried lutris, but whenever I check the "Use DXVK" option, the game never opens. Unchecking it does allow GTA V to open, but with really weired graphics with overexposure and all.

I confirmed that DXVK dll's are installed in the correct folder(it did that automatically), and the correct version is selected. It just wont launch with that.

Any idea what might be wrong?

 

Thx!

That is really strange, are you sure you got the Vulkan loader installed?

Link to comment
Share on other sites

Link to post
Share on other sites

6 hours ago, Lukyp said:

That is really strange, are you sure you got the Vulkan loader installed?

I believe so, how do I check?

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, timl132 said:

I believe so, how do I check?

apt install libvulkan1 mesa-vulkan-drivers vulkan-utils I suppose, those should be installed out the box btw.
Link to comment
Share on other sites

Link to post
Share on other sites

On 9/17/2018 at 11:11 AM, timl132 said:

I only play video games like once a week for one hour. I want to use Linux because of multiple reasons:

1. I can finally have my privacy back. Since the Windows installer has literally an option to enable a keylogger.(which ofc is enabled by default and hidden)

2. I am more familliar with it, even though I kinda like the Windows 10 GUI.

3. Less wasted resources and forced updates. Plus all the standard crap ware like Minecraft and Candy Crush will be gone too.(which it reinstalls after deletion lol)

 

I tried running a GPU with one power cord:

IMG_20180917_165010021.jpg.d3f0f06c4c5117d33beb283b78bc3f68.jpg

That doesn't work. I'm surprised it did anything at all actually.

candy crush is crapware? OMG!!!!

Im gonna get a mob armed with pitch forks and march it towards your house. 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

On 9/17/2018 at 11:06 AM, timl132 said:

Hi

 

I want to switch to Linux completely, but I have some games that I want to play(Train SIm World, GTA V) that I can't get to work in wine.(Program to run windows apps on Linux natively)

I also have some other things I'd like to be able to test on a windows VM. So my question is, is it possible to have a VM use a GPU using pass through, but have the OS(Ubuntu) also use it.

I know it can be done with an extra GPU, which I luckily do have(RX480), but I prefer to use my Titan Xp(which then would be shared with Ubuntu).

The reason I don't just use my RX480 is because It isn't as fast, and it requires a pcie power connector(which I only have 2 of, which are connected to my Titan Xp). I'll try to run my Titan Xp with one PCIe power connector now though, but I guess that won't work.

 

So in short: How can I passthrough my GPU to a windows vm, and allow Ubuntu to use it too?(So no DirectX emulation layer and stuff, as that's slow)

(If that's actually possible)

 

Thx!

who needs GTA V when you have awesome open sourced games on linux like this one. I love this game. It works with my Logitech f310 joypad out of the box

 

Screenshot from 2018-09-23 00-18-04.pngif you really must game....

well, linus can show you around a bit. No GTA support(yet) but witcher 3 seems to run fine.

 

Sudo make me a sandwich 

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

×