PixarAnimationStudios / OpenUSD

Universal Scene Description
http://www.openusd.org
Other
6k stars 1.18k forks source link

usdview Error: 'HgiGL minimum OpenGL requirements not met' #2756

Open michsiu opened 10 months ago

michsiu commented 10 months ago

Description of Issue

I have installed the USD with the build script, and add the path and python to env variables I tried to run usdview but it turns out get errors

the error information is below

State file not found, a new one will be created.
Warning: in operator () at line 74 of C:\Users\download\3dtest\OpenUSD-release\pxr\imaging\hgiGL\hgi.cpp -- HgiGL minimum OpenGL requirements not met. Please ensure that OpenGL is initialized and supports version 4.5.
ERROR: Usdview encountered an error while updating selection.
        Error in 'pxrInternal_v0_23__pxrReserved__::HdRendererPluginRegistry::CreateRenderDelegate' at line 100 in file C:\Users\download\3dtest\OpenUSD-release\pxr\imaging\hd\rendererPluginRegistry.cpp : 'Couldn't find plugin for id '
        Error in 'pxrInternal_v0_23__pxrReserved__::UsdImagingGLEngine' at line 208 in file C:\Users\download\3dtest\OpenUSD-release\pxr\usdImaging\usdImagingGL\engine.cpp : 'No renderer plugins found!'
Traceback (most recent call last):
  File "C:\USD\bin\usdview", line 35, in <module>
    Usdviewq.Launcher().Run()
  File "C:\USD\lib\python\pxr\Usdviewq\__init__.py", line 86, in Run
    self.__LaunchProcess(arg_parse_result)
  File "C:\USD\lib\python\pxr\Usdviewq\__init__.py", line 396, in __LaunchProcess
    (app, appController) = self.LaunchPreamble(arg_parse_result)
  File "C:\USD\lib\python\pxr\Usdviewq\__init__.py", line 386, in LaunchPreamble
    appController = AppController(arg_parse_result, contextCreator)
  File "C:\USD\lib\python\pxr\Usdviewq\appController.py", line 1140, in __init__
    self._drawFirstImage()
  File "C:\USD\lib\python\pxr\Usdviewq\appController.py", line 1152, in _drawFirstImage
    QtWidgets.QApplication.processEvents()
  File "C:\USD\lib\python\pxr\Usdviewq\stageView.py", line 1621, in paintGL
    renderer = self._getRenderer()
  File "C:\USD\lib\python\pxr\Usdviewq\stageView.py", line 943, in _getRenderer
    self._renderer = UsdImagingGL.Engine()
pxr.Tf.ErrorException:
        Error in 'pxrInternal_v0_23__pxrReserved__::HdRendererPluginRegistry::CreateRenderDelegate' at line 100 in file C:\Users\download\3dtest\OpenUSD-release\pxr\imaging\hd\rendererPluginRegistry.cpp : 'Couldn't find plugin for id '
        Error in 'pxrInternal_v0_23__pxrReserved__::UsdImagingGLEngine' at line 208 in file C:\Users\download\3dtest\OpenUSD-release\pxr\usdImaging\usdImagingGL\engine.cpp : 'No renderer plugins found!'

Steps to Reproduce

  1. open x64 dev command tool
  2. type command usdview C:\Users\download\3dtest\OpenUSD-release\pxr\usdImaging\bin\testusdview\testenv\testUsdviewAdditive\test.usda

System Information (OS, Hardware)

Window10 Platform

Package Versions

Python 3.8 PyOpenGL-3.1.7-py3-none-any

sunyab commented 10 months ago

Filed as internal issue #USD-8878

MikeWise2718 commented 10 months ago

Would love to know what those minimum requirements are. Sigh.

dinelanthony commented 10 months ago

I'm not sure if it helps, but I came across a similar error when trying to create my own "renderer." My error occurred due to my OpenGL context not being properly set up, but that should be taken care of for usdview. I was able to find that at least for my system (USD 23.08, Windows 10, PySide6, PyOpenGL 3.1.7), it was asking for OpenGL 13

AlexRamallo commented 9 months ago

I ran into the same issue and after some print debugging, I figured out that usdview was choosing OpenGL ES 3.2 when creating the GL context for some reason, even though OpenGL 4.6 is available.

I think it's a wayland/Qt issue, as setting the environment variable QT_QPA_PLATFORM=xcb when launching usdview fixes it. usdview launches and displays the content correctly, but interacting with the viewport spams this error message in the console:

ERROR: Usdview encountered an error while rendering.Attempt to retrieve context when no valid context

But despite that error, everything seems to work.

EDIT: just noticed the original report was on Windows 10 and not Linux, my bad!

brianebeling commented 4 months ago

@dinelanthony Running across the very same issue, but on Linux / Arch with Wayland and not with usdview, but when building my own. Unfortunately, it is not quite clear why it happens as the error message is not very specific about it. Did you eventually figure it out?

glxinfo | grep "OpenGL"
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) Xe Graphics (TGL GT2)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 24.0.6-arch1.2
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6 (Compatibility Profile) Mesa 24.0.6-arch1.2
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 24.0.6-arch1.2
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

I guess I run into the same issue, where it is choosing OpenGL ES 3.2 because of the mentioned Wayland/Qt issue. Setting the environment variable did not fix it however. Time to do some more debugging...