VMware Communities
mw73
Enthusiast
Enthusiast

VM freezes when 3d graphics acceleration is enabled in VMware Workstation Pro for Linux 16.2.3

When I enable 3D graphics acceleration in a VM running under VMware Workstation Pro for Linux 16.2.3 the VM will freeze and this is happening with both Windows and Linux VM's. I've tried this with Dell, Lenovo and HP laptops and they all have the same problem if they have discrete graphics cards. If I don't enable acceleration everything works fine. Is anyone else seeing this? 

Reply
0 Kudos
7 Replies
ajgringo619
Hot Shot
Hot Shot

I had an issue with lag in terminals (see https://communities.vmware.com/t5/VMware-Workstation-Pro/Noticeable-typing-lag-in-Linux-VM-terminals...), but not outright freezing. What distros have you tried?

Reply
0 Kudos
bluefirestorm
Champion
Champion

One thing about discrete graphics on laptops is the automatic switching between discrete graphics and the CPU integrated graphics based on battery/plugged in power.

At least with Fusion on macOS (in past versions), it is/was always a bad idea to have that automatic switching as basically the dGPU is turned off even though VM(s) might have been powered up using the dGPU.

With Windows hosts (with Nvidia dGPU) or macOS hosts that automatic switching between dGPU/iGPU can be disabled. I don't know about Linux hosts if there is such an OFF switch. The automatic switching might be a culprit for such freezing.

 

Reply
0 Kudos
mw73
Enthusiast
Enthusiast

For the VM's I'm using Ubuntu 20.04 and Fedora 35 and they were both doing this behavior also Windows 10 and 11 VM's are doing it too. On the Lenovo you can disable the discrete graphics and when I do that I can run acceleration but the GPU performance on the host starts running a lot slower.  

Reply
0 Kudos
bluefirestorm
Champion
Champion

I was not referring to switching off the dGPU but switching off the ability for the host OS to switch between using iGPU and dGPU (typically to preserve battery power).

On macOS, when it switches to iGPU (such as when the power is unplugged and it starts running using battery power) while the Fusion VM is running (and VM powered up using the dGPU), it results in the VM hanging and/or vmware-vmx process crashing.

In Windows hosts with Nvidia, the Nvidia Control Panel allows you to set "Preferred graphics processor" from Auto-select to either the iGPU or Nvidia. On macOS, it is a checkbox in the Power settings.

So need to find out if there is such an option within Linux laptop host that allows you to switch off the switching between iGPU and dGPU. My guess there is a switching between iGPU and dGPU based on power (at least with Nvidia Optimus).

Reply
0 Kudos
mw73
Enthusiast
Enthusiast

You were correct, thats what I needed to do. Here are the steps I did under Ubuntu 20.04;

1. First to determine which video GPU's are installed in the system;

1. $xrandr --listproviders 

1. on my system Provider 0 was the nVidia GPU and Provider 1 was the Intel GPU

2. In order for 3D acceleration to work within the VM's I had to start VMware using the Intel GPU so I issued the following command; 

2. $DRI_PRIME=1 vmware

2. This will run vmware using the Intel GPU and the 3D acceleration works!

That's it, thanks for your help!

 

Reply
0 Kudos
bravo88
Contributor
Contributor

for the acceleration related issue the only solution for me was to make the vulkan be forced to support my card 

mks.vk.allowUnsupportedDevices = "TRUE"

i also added this but not sure if the below is necessary  

mks.forceDiscreteGPU = "TRUE"

now i have great acceleration 16.2.3  

Reply
0 Kudos
KhaimovMR
Contributor
Contributor

I've resolved the issue on my machine by upgrading to the recent version of kernel. Using `ukuu` I've selected the 6.1.4. Now everything is working fast and doesn't freeze over time.

It seems like the issue was indeed in the `vmwgfx` kernel driver. 

Reply
0 Kudos