PixarAnimationStudios / OpenUSD

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

error: only precision qualifiers may be applied to structure members #2009

Closed macton closed 1 year ago

macton commented 2 years ago

Description of Issue

Viewport does not render in usdview.

Warning: in _ValidateCompilation at line 227 of /opt/USD/pxr/imaging/hdSt/glslProgram.cpp -- Failed to compile shader (FRAGMENT_SHADER): 0:365(2): error: only precision qualifiers may be applied to structure members
0:366(2): error: only precision qualifiers may be applied to structure members

Warning: in _ValidateCompilation at line 227 of /opt/USD/pxr/imaging/hdSt/glslProgram.cpp -- Failed to compile shader (FRAGMENT_SHADER): 0:365(2): error: only precision qualifiers may be applied to structure members
0:366(2): error: only precision qualifiers may be applied to structure members

ERROR: Usdview encountered an error while rendering.
        Error in 'pxrInternal_v0_22__pxrReserved__::HdSt_DrawBatch::_GetDrawingProgram' at line 278 in file /opt/USD/pxr/imaging/hdSt/drawBatch.cpp : 'Failed to compile shader for prim /sphere.'
        Error in 'pxrInternal_v0_22__pxrReserved__::HdSt_DrawBatch::_GetDrawingProgram' at line 297 in file /opt/USD/pxr/imaging/hdSt/drawBatch.cpp : 'Failed verification: ' res ' -- Failed to compile with fallback material network'
        Error in 'pxrInternal_v0_22__pxrReserved__::HdSt_IndirectDrawBatch::_ExecuteDraw' at line 1116 in file /opt/USD/pxr/imaging/hdSt/indirectDrawBatch.cpp : 'Failed verification: ' program.IsValid() ''

also

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

Steps to Reproduce

$ usdview /usr/local/USD/share/usd/tutorials/convertingLayerFormats/Sphere.usda

System Information (OS, Hardware)

$ glxinfo | grep version

server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
    Max core profile version: 4.5
    Max compat profile version: 4.5
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
OpenGL core profile version string: 4.5 (Core Profile) Mesa 22.1.7
OpenGL core profile shading language version string: 4.50
OpenGL version string: 4.5 (Compatibility Profile) Mesa 22.1.7
OpenGL shading language version string: 4.50
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 22.1.7
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
    GL_EXT_shader_implicit_conversions, GL_EXT_shader_integer_mix,

Package Versions

Build Flags

python USD/build_scripts/build_usd.py --examples --tutorials --tools --usd-imaging --ptex --openvdb --usdview --openimageio --opencolorio --materialx /usr/local/USD
macton commented 2 years ago

Running with --renderer HydraDisabled outputs:

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

and viewport is black.

tcauchois commented 2 years ago

Hi!

It looks like you're failing to get a GL context (which is surprising, Qt should provide one before it calls into Pixar code); and in your first message it looks like (from my best guess) somehow you've asked our shaders to compile against an old GLSL version, despite us saying that these are GL 4.5 shaders in the shader prologue. In short, this looks like a GL version issue. It's hard for me to narrow it down more than that, since we don't have a Mesa setup to test on.

Storm (our GL renderer) should function ok as long as you have a GL 4.5-compatible implementation. I know Mesa claims 4.5 compatibility, but there might be something weird going on in the Qt OpenGL code, or Mesa 4.5 support might be missing something. Is it possible to try with a GPU?

Another thing you can try is to use the "Embree" renderer, which is an optional plugin. It has the same geometry support as Storm, though only ambient occlusion lighting.

Hope that helps! Tom

sunyab commented 2 years ago

Filed as internal issue #USD-7584

beersandrew commented 2 years ago

I had a similar issue on RHEL 8.6 and was able to get it to pick up a GL renderer by installing the following:

sudo yum install libXmu-devel libXi-devel libGL-devel

hope this helps

expenses commented 1 year ago

I'm also getting this on Linux with the USD 22.08, Python 3.7 binary provided by Nvidia: https://developer.nvidia.com/usd

spitzak commented 1 year ago

Same error message,it is produced by Mesa when NVidia OpenGL is not used: #1429

It has been suggested this is a Mesa bug, it should ignore the attribute (maybe with a warning) rather than fail to compile.

davidgyu commented 1 year ago

Hi Mike! This has been fixed in USD since v23.02 w/ OpenSubdiv 3.5.x

We fixed this use of non-standard "centroid" qualifiers in OpenSubdiv 3.5.x and also improved some related GL shader compiler concerns in USD v23.02.

I don't have a system which matches your configuration but I did just test USD v23.05-rc1 on a system with Mesa 22.2.5 as well as several other system configurations with NVIDIA, AMD, and Intel GPUs.

We're going to mark this closed, but please let us know if there are additional new issues. Thanks!