Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OGRE doesn't display meshes anymore with Intel GPU enabled #744

Open
rhaschke opened this issue May 23, 2022 · 13 comments
Open

OGRE doesn't display meshes anymore with Intel GPU enabled #744

rhaschke opened this issue May 23, 2022 · 13 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists GPU

Comments

@rhaschke
Copy link

rhaschke commented May 23, 2022

I'm maintaining an OpenGL application, called rviz, that doesn't correctly display meshes since a few weeks: ros-visualization/rviz#1748

Simple geometries are correctly rendered. As the program runs fine on Linux natively and we didn't changed the rendering pipeline recently, I'm afraid this issue is related to some recent change in WSLg or Mesa.

Looks like WSLg forwards OpenGL via the Mesa driver to the NVIDIA card. I tried building against both, Ogre 1.9 (default) and Ogre 1.12 (which is the underlying rendering library). Both fail to display meshes. Using another application, meshlab, the meshes render correctly.

Was there any change released recently that could explain this regression?

Environment

Windows build number: Microsoft Windows [Version 10.0.22000.675]
Your Distribution version: Ubuntu 20.04
Your WSLg version: 1.0.26

WSL logs following these instructions: WslLogs-2022-05-24_14-22-30.zip

I'm using a laptop with an integrated Intel UHD and an NVIDIA GeForce graphics card. I'm using default graphics settings (power saving using Intel UHD). However, OpenGL (glxinfo) lists the NVIDIA card being used by WSLg:

OpenGL vendor string: Microsoft Corporation
OpenGL renderer string: D3D12 (NVIDIA GeForce GTX 1050)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 21.2.6
@rhaschke
Copy link
Author

On another laptop, having an Intel GPU only, the meshes are displayed correctly. Here OpenGL (glxinfo) reports:

OpenGL vendor string: Mesa/X.org
OpenGL renderer string: llvmpipe (LLVM 12.0.0, 256 bits)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 21.2.6

I conclude that the issue is related to Microsoft's D3D12 renderer.

@rhaschke
Copy link
Author

rhaschke commented May 26, 2022

As a workaround, you can set the environment variable LIBGL_ALWAYS_SOFTWARE=true, thus disabling accelerated rendering and instead enabling software rendering via llvmpipe.

@rhaschke
Copy link
Author

Can I provide any more information to resolve this issue?

@IoTDan
Copy link

IoTDan commented Aug 1, 2022

I have this happening with an Intel Iris XE graphics card, with the MESA drivers installed. setting LIBGL_ALWAYS_SOFTWARE=true does correctly render. So looking for a hardware accelerated fix.

@hideyukn88 hideyukn88 added the GPU label Aug 2, 2022
@hideyukn88 hideyukn88 changed the title OGRE doesn't display meshes anymore OGRE doesn't display meshes anymore with Intel GPU enabled Aug 2, 2022
@hideyukn88
Copy link
Member

This looks like dup of #554.

@hideyukn88 hideyukn88 added the duplicate This issue or pull request already exists label Aug 3, 2022
@IoTDan
Copy link

IoTDan commented Aug 5, 2022 via email

@rhaschke
Copy link
Author

rhaschke commented Aug 7, 2022

@hideyukn88, I don't think this is only related to Intel GPUs, but to D3D12 in general. Above, I stated that WSLg picks my NVIDIA card and the D3D12 driver showing these problems (as well).

@hideyukn88
Copy link
Member

@rhaschke, we did verification internally at our side, and it is working fine on NVIDIA GPU, while Intel Iris Xe renders black contents (but interestingly it works fine with Intel UHD 620 GPU). Would you please let us know your NVIDIA GPU model and driver version? And if you can take screenshot of app, it's helpful too, thanks!

@rhaschke
Copy link
Author

I have a Laptop with an integrated Intel UHD GPU and an NVIDIA GeForce MX250.

software rendering via llvmpipe accelerated rendering via D3D12
image image
OpenGL device: llvmpipe (LLVM 12.0.0, 256 bits) OpenGL device: D3D12 (NVIDIA GeForce MX250)
OpenGl version: 3.1 (GLSL 1.4) OpenGl version: 3.1 (GLSL 1.4)

I don't know how to switch to the Intel GPU to report results for it as well. Is there an environment variable to set?

@hideyukn88
Copy link
Member

@rhaschke, please refer below for switching GPUs, and if it reproduces with NVIDIA, would you please share the driver version, thanks!

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10710

@rhaschke
Copy link
Author

Switching the GPU via the env variable MESA_D3D12_ADAPTER_NAME=intel doesn't work for me. glxinfo always reports the NVIDIA GPU being selected.

NVIDIA driver: 30.0.15.1236
Intel driver: 30.0.101.1338

Looks like my WSL wasn't updated for a while. However, Windows Update doesn't report any pending updates.

> ver
Microsoft Windows [Version 10.0.22000.856]

> wsl --status
Default Distribution: Ubuntu
Default Version: 2

Windows Subsystem for Linux was last updated on 26.05.2022
WSL automatic updates are on.

Kernel version: 5.10.102.1

@jorolf
Copy link

jorolf commented Sep 25, 2022

Switching the GPU via the env variable MESA_D3D12_ADAPTER_NAME=intel doesn't work for me

They changed the variable name from MESA_D3D12_ADAPTER_NAME to MESA_D3D12_DEFAULT_ADAPTER_NAME before merging the merge request. (See also: https://docs.mesa3d.org/drivers/d3d12.html#envvar-MESA_D3D12_DEFAULT_ADAPTER_NAME)

@xiayip
Copy link

xiayip commented Nov 28, 2023

@jorolf
Use MESA_D3D12_DEFAULT_ADAPTER_NAME, the GPU switched, but the problem still exist. I think its the problem with D3D12, not GPU hardware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists GPU
Projects
None yet
Development

No branches or pull requests

5 participants