Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#3161 closed defect (fixed)

camera 360sbs: Shader does not have uniform variable "model_view_matrix"

Reported by: gokhan_tolun@… Owned by: Tom Goddard
Priority: normal Milestone:
Component: Graphics Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

The following bug report has been submitted:
Platform:        Windows-10-10.0.18362
ChimeraX Version: 0.93 (2020-04-03)
Description
Run 'camera sbs' command while have a structure with surface charge coloring open.

OpenGL version: 3.3.0 NVIDIA 419.67
OpenGL renderer: GeForce GTX 1060/PCIe/SSE2
OpenGL vendor: NVIDIA Corporation
Manufacturer: Microsoft Corporation
Model: Surface Book 2
OS: Microsoft Windows 10 Pro (Build 18363)
Memory: 17,101,164,544
MaxProcessMemory: 137,438,953,344
CPU: 8 Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz"

Change History (10)

in reply to:  1 ; comment:1 by gokhan@…, 5 years ago

I realized that the actual command that messed it up was camera 360sbs which gives the error:

An OpenGL graphics error occurred. Most often this is caused by a graphics driver bug. The only way to fix such bugs is to update your graphics driver. Redrawing graphics is now stopped to avoid a continuous stream of error messages. To restart graphics use the command "graphics restart" after changing the settings that caused the error.

Shader does not have uniform variable "model_view_matrix"
shader capabilities SHADER_SHIFT_AND_SCALE, SHADER_VERTEX_COLORS, SHADER_STEREO_360

When certain models are open. This does not prompt an error report window.

Once this error shows up, the graphics window becomes unresponsive and executing any other came commands result in the error reported.

Cheers,

Gökhan


-----Original Message-----
From: ChimeraX <ChimeraX-bugs-admin@cgl.ucsf.edu> 
Sent: Friday, 8 May 2020 10:55 AM
To: Gokhan Tolun <gokhan@uow.edu.au>
Subject: [ChimeraX] #3161: ChimeraX bug report submission

#3161: ChimeraX bug report submission
----------------------------+-----------------------------
 Reporter:  gokhan_tolun@…  |                Type:  defect
   Status:  new             |            Priority:  normal
Component:  Unassigned      |          Blocked By:
 Blocking:                  |  Notify when closed:
----------------------------+-----------------------------
 {{{
 The following bug report has been submitted:
 Platform:        Windows-10-10.0.18362
 ChimeraX Version: 0.93 (2020-04-03)
 Description
 Run 'camera sbs' command while have a structure with surface charge  coloring open.

 OpenGL version: 3.3.0 NVIDIA 419.67
 OpenGL renderer: GeForce GTX 1060/PCIe/SSE2  OpenGL vendor: NVIDIA Corporation
 Manufacturer: Microsoft Corporation
 Model: Surface Book 2
 OS: Microsoft Windows 10 Pro (Build 18363)
 Memory: 17,101,164,544
 MaxProcessMemory: 137,438,953,344
 CPU: 8 Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz"

 }}}

--
Ticket URL: <https://plato.cgl.ucsf.edu/trac/ChimeraX/ticket/3161>
ChimeraX <http://www.rbvi.ucsf.edu/chimerax/>
ChimeraX Issue Tracker

comment:2 by pett, 5 years ago

Component: UnassignedGraphics
Owner: set to Tom Goddard
Platform: all
Project: ChimeraX
Status: newassigned
Summary: ChimeraX bug report submissioncamera 360sbs: Shader does not have uniform variable "model_view_matrix"

comment:3 by Tom Goddard, 5 years ago

I open a PDB (1a0m) and map (1a0m from EDS) and colored the 1a0m molecular surface by map value and used camera 360sbs and it all worked without errors. This bug was reported long ago and I was never able to reproduce it.

Maybe you can attach a session file where "camera 360sbs" fails.

I'll keep looking -- the error seems like plenty of info for debugging it, trying to set a variable in an OpenGL shader that does not exist.

comment:4 by Tom Goddard, 5 years ago

Aha! I think I understand it now. The ChimeraX OpenGL shader definitely defines the model_view_matrix variable. But when 360 stereo is used and no shadows are being shown that matrix is only used to set a local variable, and then that local variable is not used in the shader. So a smart driver could optimize that all out. I've seen this before where the OpenGL compiler eliminates global variables that are not used.

Unfortunately I have not found a computer system that does this optimization. I'll try my Windows GTX 1080 Ti since that is the closest I have to your driver.

Also I have to think of how to handle this. The ChimeraX code assumes that globally declared shader variable can't just vanish from shader programs. While I could check if the variable exists, in most cases I want missing variables to generate an error.

comment:5 by Tom Goddard, 5 years ago

My 1080 Ti Windows system does not produce this error. It is using a much newer driver Nvidia 442.19 (Feb 3, 2020) while the bug is reported with 419.67 (March 25, 2019).

The missing variable model_view_matrix is actually used by a variable vshadow exported from the vertex shader to the fragment shader. But if no shadows are being rendered then neither the vertex or fragment shader uses that variable. Still it is amazing (and possibly contrary to the OpenGL shader spec) that the OpenGL shader linker can optimize out such a variable that is passed between compilaton units. Make me wonder whether this really is the bug.

Another remote possibility is that the ChimeraX error message is wrong. It reports that the shader last activated does not have the model_view_matrix variable even though the the shader it describes declares the variable. But maybe that is not actually the active shader because somehow another shader was activated without the ChimeraX OpenGL knowing, possibly even the wrong OpenGL context is active. These seem very unlikely because having the wrong shader active would generate all kinds of OpenGL errors and these would have been reported.

comment:6 by Tom Goddard, 5 years ago

The model_view_matrix will always be used unless lighting is also turned off. In this error lighting is off since the error message does not mention SHADER_LIGHTING as a capability. It may be lighting is off just due to an internal render pass like shadow depth map computation.

Aha, turning on soft lighting with 360 sbs on my Windows 1080 Ti system reproduces the error. Does not reproduce on Mac.

I have a test case now and will put in a fix.

comment:7 by Tom Goddard, 5 years ago

Resolution: fixed
Status: assignedclosed

Fixed

in reply to:  8 ; comment:8 by gokhan@…, 5 years ago

Hi Tom,

Good to hear that you could reproduce the error.

Also thanks for the entertaining play-by-play. 😄

It was neat to see what goes in the background while tro
ubleshooting an error/bug.

Cheers,

Gökhan

_____________________________
Sent from a mobile device
Please excuse brevity, typos and autocorrect errors.
On 9 May 2020, at 4:25 am, ChimeraX <ChimeraX-bugs-admin@cgl.ucsf.edu<mailto:ChimeraX-bugs-admin@cgl.ucsf.edu>> wrote:

#3161: camera 360sbs: Shader does not have uniform variable "model_view_matrix"
________________________________
+-------------------------
          Reporter:  gokhan_tolun@…  |      Owner:  Tom Goddard
              Type:  defect          |     Status:  assigned
          Priority:  normal          |  Milestone:
         Component:  Graphics        |    Version:
        Resolution:                  |   Keywords:
        Blocked By:                  |   Blocking:
Notify when closed:                  |   Platform:  all
           Project:  ChimeraX        |
________________________________
+-------------------------

Comment (by Tom Goddard):

 The model_view_matrix will always be used unless lighting is also turned
 off.  In this error lighting is off since the error message does not
 mention SHADER_LIGHTING as a capability.  It may be lighting is off just
 due to an internal render pass like shadow depth map computation.

 Aha, turning on soft lighting with 360 sbs on my Windows 1080 Ti system
 reproduces the error.  Does not reproduce on Mac.

 I have a test case now and will put in a fix.

--
Ticket URL: <https://plato.cgl.ucsf.edu/trac/ChimeraX/ticket/3161#comment:6>
ChimeraX <http://www.rbvi.ucsf.edu/chimerax/>
ChimeraX Issue Tracker

in reply to:  9 ; comment:9 by goddard@…, 5 years ago

Apologies for the play-by-play.  Those bugs that are on the edge of solvability are fun (especially when the other work to do is writing grants).

in reply to:  10 ; comment:10 by gokhan@…, 5 years ago

No need to apologise Tom, I really do enjoy things like that, too. So, I was sincere. :-)

It's unbelievable that a team like yours still needs to struggle with getting money.

It should be obvious that the software you put together helps hundreds, if not thousands, of research groups in doing their research.

Groups like yours should be funded like the labs at the NIH! Just given money, as long as they are productive. Your group has been productive for decades! What more proof do funding agencies need? Jeeez...

Best of luck in your grants.

Cheers,
Gökhan

_____________________________
Sent from a mobile device
Please excuse brevity, typos and autocorrect errors.
On 9 May 2020, at 10:25 am, ChimeraX <ChimeraX-bugs-admin@cgl.ucsf.edu<mailto:ChimeraX-bugs-admin@cgl.ucsf.edu>> wrote:

#3161: camera 360sbs: Shader does not have uniform variable "model_view_matrix"
________________________________
+-------------------------
          Reporter:  gokhan_tolun@…  |      Owner:  Tom Goddard
              Type:  defect          |     Status:  closed
          Priority:  normal          |  Milestone:
         Component:  Graphics        |    Version:
        Resolution:  fixed           |   Keywords:
        Blocked By:                  |   Blocking:
Notify when closed:                  |   Platform:  all
           Project:  ChimeraX        |
________________________________
+-------------------------

Comment (by goddard@…):

 {{{
 Apologies for the play-by-play.  Those bugs that are on the edge of
 solvability are fun (especially when the other work to do is writing
 grants).

 }}}

--
Ticket URL: <https://plato.cgl.ucsf.edu/trac/ChimeraX/ticket/3161#comment:9>
ChimeraX <http://www.rbvi.ucsf.edu/chimerax/>
ChimeraX Issue Tracker
Note: See TracTickets for help on using tickets.