VirtualGL / virtualgl

Main VirtualGL repository
https://VirtualGL.org
Other
701 stars 106 forks source link

EGL back end: VMWare Player crashes on VM startup #162

Closed Mr-Shibari closed 3 years ago

Mr-Shibari commented 3 years ago

Hi

There seems to be a problem running VMWare Player with the VirtualGL EGL back end. Running Player works, I see the window in the VNC session but after starting a VM (with 3D support) Player crashes and the VNC session is closed.

I start VMware Player this way:

Startup script:

/opt/TurboVNC/bin/vncserver -geometry 1024x768 -xstartup "start_vmware_player_vnc_script.sh" -fg

Application script (start_vmware_player_vnc_script.sh):

export LD_PRELOAD=libvglfaker.so:libdlfaker.so vglrun +v +tr -d /dev/dri/card1 /usr/bin/vmplayer

Instead of the -d option I also tried with export VGL_DISPLAY=egl, same result.

nVidia Driver Version is: 460.67, VirtualGL version is: v2.6.80 64-bit (Build 20210315)

Here is the TurboVNC/VirtGL log: virt_gl_vmware_player.log

Running Virtualbox this way works fine and I have 3D acceleration. Glmark2 also works fine.

Mr-Shibari commented 3 years ago

Well, I got it to work, but not really as intended...

When I start it this way it works and I have 3D acceleration which makes use of the GPU, confirmed by nvidia-smi: /opt/TurboVNC/bin/vncserver -extension GLX -vgl -geometry 1024x768 -xstartup "start_xp_vnc_script.sh" -fg

The start_xp_vnc_script.sh simply contains the line: /usr/bin/vmplayer "Windows XP Professional.vmx"

VMware player complains that there is no hardware acceleration available but 3D games in the VM work great doing it this way. I have the line in the config to make sure that blacklisted drivers are allowed.

The thing is I see this in de vmware.log file:

2021-04-02T12:41:33.513Z| mks| I005: MKS-RenderMain: PowerOn allowed MKSBasicOps GLRenderer GLBasic VKRenderer
2021-04-02T12:41:33.513Z| mks| I005: MKS-RenderMain: Collecting RenderOps caps from GLRenderer
2021-04-02T12:41:33.513Z| mks| I005: MKS-RenderMain: Starting GLRenderer
2021-04-02T12:41:33.515Z| mks| I005: MKSXInput: XI major version 2, minor version 3
2021-04-02T12:41:33.515Z| mks| I005: GLHostX11: DISPLAY: ":1" doesn't support GLX extension.
2021-04-02T12:41:33.515Z| mks| I005: GLHostX11: Console display (:1) does not support direct rendering.
2021-04-02T12:41:33.515Z| mks| I005: GLHostX11: env DISPLAY (:1) matches console display.
2021-04-02T12:41:33.516Z| mks| I005: GLHostX11: DISPLAY: "unix:1" doesn't support GLX extension.
2021-04-02T12:41:33.516Z| mks| W003: GLHostX11: GLX_Init error: No X11 Display is available!
2021-04-02T12:41:33.516Z| mks| W003: GLWindow: GLHost init failed
2021-04-02T12:41:33.516Z| mks| I005: MKS-RenderMain: Failed to start the renderer GLRenderer
2021-04-02T12:41:33.516Z| mks| I005: MKS-RenderMain: Collecting RenderOps caps from VKRenderer
2021-04-02T12:41:33.516Z| mks| I005: MKS-RenderMain: Starting VKRenderer
2021-04-02T12:41:36.706Z| mks| I005: Vulkan Renderer: Using device 0 of 1
2021-04-02T12:41:36.708Z| mks| W003: Vulkan Renderer: VK_EXT_sample_locations extension not supported. MSAA disable will not work.
2021-04-02T12:41:36.734Z| mks| I005: Vulkan Renderer: VKRDevice_Create: Succeeded with DISPLAY=:1
2021-04-02T12:41:36.734Z| mks| I005: Vulkan Renderer: Device Info:
2021-04-02T12:41:36.734Z| mks| I005: Vulkan Renderer:   Vendor: 'NVIDIA'
2021-04-02T12:41:36.734Z| mks| I005: Vulkan Renderer:   ID: 0x1287
2021-04-02T12:41:36.734Z| mks| I005: Vulkan Renderer:   Type: 0x2
2021-04-02T12:41:36.734Z| mks| I005: Vulkan Renderer:   Name: 'GeForce GT 730'
2021-04-02T12:41:36.734Z| mks| I005: Vulkan Renderer:   Chip: 'Kepler (Kepler)'
2021-04-02T12:41:36.734Z| mks| I005: Vulkan Renderer:   Driver Name: 'NVIDIA'
2021-04-02T12:41:36.734Z| mks| I005: Vulkan Renderer:   Driver Info: '460.67'
2021-04-02T12:41:36.734Z| mks| I005: Vulkan Renderer: API Version: 1.2.155

Which suggests it is falling back to Vulkan, which does work somehow. If I remove the switch '-extension GLX' this does not show up in the log and Player does not throw the warning about the missing 3D support, the problem is that the GPU is not used and 3D performance in the VM is very bad.

It is nice that it works with Vulkan but I would like to be able to use vglrun and have the OpenGL render available.

dcommander commented 3 years ago

I'll test it. I just haven't had time yet.

dcommander commented 3 years ago

There's a good chance that https://github.com/VirtualGL/virtualgl/commit/9d04f00f965fa75fb0903d9550dea1d1fe950446 fixed this issue. Can you confirm whether the issue still exists with the latest code in dev or the latest dev pre-release build?

Mr-Shibari commented 3 years ago

I've tested it with the new build, this indeed fixed the issue. Thanks for the great work :)