# GLSLClutAnimDemo fail on MS Windows XPSSP2 with latest NVidia drivers and cards

**URL:** <https://psychtoolbox.discourse.group/t/glslclutanimdemo-fail-on-ms-windows-xpssp2-with-latest-nvidia-drivers-and-cards/1881>\
**Category:** Uncategorized\
**Created:** [September 10, 2007, 8:39pm UTC](https://psychtoolbox.discourse.group/t/glslclutanimdemo-fail-on-ms-windows-xpssp2-with-latest-nvidia-drivers-and-cards/1881 "2007-09-10T20:39:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)\
**Post date:** [September 10, 2007, 8:39pm UTC](https://psychtoolbox.discourse.group/t/glslclutanimdemo-fail-on-ms-windows-xpssp2-with-latest-nvidia-drivers-and-cards/1881/1 "2007-09-10T20:39:17Z")

</div>

We have some machine on which the fake lookup table animation works,  
and several on which it fails, including ones with very new cards and  
drivers.  
  
The GLSLClutAnimDemo program fails with   
MOGL-ERROR: Compilation of the GLSL shader object 2 via  
glCompileShader(2) failed!  
The shader info log for shader 2 tells us the following:  
(2) : error C7531: global type sampler2DRect requires "#extension  
GL\_ARB\_texture\_rectangle : enable" before use  
  
??? Shader compilation failed!  
  
Error in ==\> GLSLCLUTAnimDemo at 114  
 psychrethrow(psychlasterror);  
similarly on two machines.  
  
I tested the OpenGL functionality on all machines using  
OpneGL Extensions Viewer 2.29 from realtech-vr.com (GLView.exe free  
for noncommercial use), and it reports that GL\_ARB\_texture\_rectangle  
is enabled.  
  
Here are links to log fles from two machines that fail   
(one NVidia GeForce FX 5200/AGP/SSE/3DNOW! and   
one NVidea GeForce 7025 / NVIDIA nForce 630a/PCI/SSE2/3DNOW!)  
and one machine that works fine (GeForce 6600/PCI/SSE2/3DNOW!),  
all with the latest drivers and full OpenGL functionality according to  
 GLView.  
  
The log files below have the GLView report, the results of the "opengl  
info" command from MatLab (R2006b), and the results of the  
"GLSLCLUTAnimDemo" command from MatLab.  
  
FAILS:  
[http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc15.txt](http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc15.txt)  
[http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc18.txt](http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc18.txt)  
WORKS:  
[http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc23-WORKS.txt](http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc23-WORKS.txt)  
  
I imagine that the fix must be small, but a few hours of looking into  
it has not made things make sense to me.  
  
I would love help, if anyone has ideas. From what I have read on the  
forum, both setups that fail OUGHT to work.  
  
--Michael Stryker [stryker@...](mailto:stryker@...) 415.476-5443

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [September 10, 2007, 9:08pm UTC](https://psychtoolbox.discourse.group/t/glslclutanimdemo-fail-on-ms-windows-xpssp2-with-latest-nvidia-drivers-and-cards/1881/2 "2007-09-10T21:08:17Z")

</div>

What a nice bug report :-)  
  
Try this:  
  
Edit the file  
Psychtoolbox/PsychOpenGL/PsychGLSLShaders/ClutBlutShader.frag.txt  
  
Replace:  
#version 110  
  
by:  
  
#version 110  
#extension GL\_ARB\_texture\_rectangle : enable  
  
Retest and tell me the result. If this fixes it, i'll update all shaders  
for the next 'beta' release to fix it.  
  
Seems that the latest NVidia GLSL compilers are more strict in  
their code checking...  
  
best,  
-mario  
  

> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "mpstryker@..." \<mpstryker@...\> wrote:  
> \>  
> \> We have some machine on which the fake lookup table animation works,  
> \> and several on which it fails, including ones with very new cards and  
> \> drivers.  
> \>   
> \> The GLSLClutAnimDemo program fails with   
> \> MOGL-ERROR: Compilation of the GLSL shader object 2 via  
> \> glCompileShader(2) failed!  
> \> The shader info log for shader 2 tells us the following:  
> \> (2) : error C7531: global type sampler2DRect requires "#extension  
> \> GL\_ARB\_texture\_rectangle : enable" before use  
> \>   
> \> ??? Shader compilation failed!  
> \>   
> \> Error in ==\> GLSLCLUTAnimDemo at 114  
> \> psychrethrow(psychlasterror);  
> \> similarly on two machines.  
> \>   
> \> I tested the OpenGL functionality on all machines using  
> \> OpneGL Extensions Viewer 2.29 from realtech-vr.com (GLView.exe free  
> \> for noncommercial use), and it reports that GL\_ARB\_texture\_rectangle  
> \> is enabled.  
> \>   
> \> Here are links to log fles from two machines that fail   
> \> (one NVidia GeForce FX 5200/AGP/SSE/3DNOW! and   
> \> one NVidea GeForce 7025 / NVIDIA nForce 630a/PCI/SSE2/3DNOW!)  
> \> and one machine that works fine (GeForce 6600/PCI/SSE2/3DNOW!),  
> \> all with the latest drivers and full OpenGL functionality according to  
> \> GLView.  
> \>   
> \> The log files below have the GLView report, the results of the "opengl  
> \> info" command from MatLab (R2006b), and the results of the  
> \> "GLSLCLUTAnimDemo" command from MatLab.  
> \>   
> \> FAILS:  
> \> [http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc15.txt](http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc15.txt)  
> \> [http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc18.txt](http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc18.txt)  
> \> WORKS:  
> \> [http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc23-WORKS.txt](http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc23-WORKS.txt)  
> \>   
> \> I imagine that the fix must be small, but a few hours of looking into  
> \> it has not made things make sense to me.  
> \>   
> \> I would love help, if anyone has ideas. From what I have read on the  
> \> forum, both setups that fail OUGHT to work.  
> \>   
> \> --Michael Stryker stryker@... 415.476-5443  
> \>

---

<div class="post-metadata">

**Author:** ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)\
**Post date:** [June 4, 2008, 4:56pm UTC](https://psychtoolbox.discourse.group/t/glslclutanimdemo-fail-on-ms-windows-xpssp2-with-latest-nvidia-drivers-and-cards/1881/3 "2008-06-04T16:56:57Z")

</div>

ah.. Seems to be another error after the update, still upon the  
'OpenWindow' command:  
  
Building a fragment shader:Reading shader from file  
C:\Psychtoolbox\PsychOpenGL/PsychGLSLShaders/GenericLuminanceToRGBA8\_FormattingShader.frag.txt  
...  
MOGL-ERROR: Linking of the GLSL shader program 2 via glLinkProgram(2)  
failed!  
The program info log for program 2 tells us the following:  
Fragment info  
-------------  
(0) : fatal error C9999: Bad scope in ConvertLocalReferences()  
  
??? Error using ==\> moglcore  
GLSL link operation failed!  
  
--- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Mario Kleiner"  
\<mario.kleiner@...\> wrote:  

> \>  
> \> Hi again,  
> \>   
> \> update from 'trunk', then retry and give feedback --  
> \> as soon as possible!  
> \>   
> \> I want to push out a beta update this week, preferrably  
> \> tomorrow latest.  
> \>   
> \> I've only fixed Screen for Matlab R2007a and later  
> \> for now, not yet Screen for older Matlabs.   
> \>   
> \> The problem was "fixed", but apparently not in the  
> \> correct way. That fix caused the driver to accept the  
> \> shaders and only spill out warnings about non-conformant  
> \> behaviour. Seems NVidia decided to turn the warnings into  
> \> errors in their latest driver release. OS/X et al. still accepted  
> \> the non-conformant shaders.  
> \>   
> \> Hopefully this fixes it.  
> \> -mario  
> \>   
> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "amhaun01" \<amhaun01@\> wrote:  
> \> \>  
> \> \> Okay, context: we're using a GeForce 8600GT. As far as I can tell,  
> \> \> all drivers are current, and everything should work, but I can't get  
> \> \> past this error.  
> \> \>   
> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "amhaun01" \<amhaun01@\> wrote:  
> \> \> \>  
> \> \> \> Is this solution applied to the current 'trunk' version?

Because I've  

> \> \> \> encountered this same error, upon the 'OpenWindow' command on the  
> \> \> \> bitsPlusAdditiveBlending~ demo (line 88).  
> \> \> \>   
> \> \> \> "global type sampler2DRect requires '#extension  
> \> \> \> GL\_ARB\_texture\_rectangle : enable'"  
> \> \> \>   
> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Mario Kleiner"  
> \> \> \> \<mario.kleiner@\> wrote:  
> \> \> \> \>  
> \> \> \> \> Jap. Tried it on our machine after driver update. Fails as well.  
> \> \> \> \>   
> \> \> \> \> Anyway i found a solution that works. Just updated 'beta' a  
> \> \> \> \> minute ago. Undo all your changes, then update your PTB beta  
> \> \> \> \> via UpdatePsychtoolbox.  
> \> \> \> \>   
> \> \> \> \> thanks for reporting this - and for the nice and efficient  
> \> \> \> \> bug report,  
> \> \> \> \> -mario  
> \> \> \> \>   
> \> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Michael P Stryker"

\<stryker@\>  

> \> \> \> wrote:  
> \> \> \> \> \>  
> \> \> \> \> \> I added the line  
> \> \> \> \> \> #extension GL\_ARB\_texture\_rectangle : enable  
> \> \> \> \> \> under the line   
> \> \> \> \> \> #version 110  
> \> \> \> \> \> in the file   
> \> \> \> \> \>

Psychtoolbox/PsychOpenGL/PsychGLSLShaders/ClutBlitShader.frag.txt  

> \> \> \> \> \> [presumably the "ClutBlutShader" in your message was a typo]  
> \> \> \> \> \> and restarted MatLab, and  
> \> \> \> \> \> GLSLClutAnimDemo failed identiacally to its previous failure

on the   

> \> \> \> \> \> "NVidea GeForce 7025 / NVIDIA nForce 630a/PCI/SSE2/3DNOW!"

machine  

> \> \> \> \> \> (pc15). So it looks like that fix does not work. Sorry.  
> \> \> \> \> \>   
> \> \> \> \> \> More ideas?  
> \> \> \> \> \> --Michael Stryker  
> \> \> \> \> \>   
> \> \> \> \> \>   
> \> \> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Mario Kleiner"  
> \> \> \> \> \> \<mario.kleiner@\> wrote:  
> \> \> \> \> \> \>  
> \> \> \> \> \> \> What a nice bug report :-)  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> Try this:  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> Edit the file  
> \> \> \> \> \> \>

Psychtoolbox/PsychOpenGL/PsychGLSLShaders/ClutBlutShader.frag.txt  

> \> \> \> \> \> \>   
> \> \> \> \> \> \> Replace:  
> \> \> \> \> \> \> #version 110  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> by:  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> #version 110  
> \> \> \> \> \> \> #extension GL\_ARB\_texture\_rectangle : enable  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> Retest and tell me the result. If this fixes it, i'll

update all  

> \> \> \> shaders  
> \> \> \> \> \> \> for the next 'beta' release to fix it.  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> Seems that the latest NVidia GLSL compilers are more strict in  
> \> \> \> \> \> \> their code checking...  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> best,  
> \> \> \> \> \> \> -mario  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "mpstryker@" \<mpstryker@\>  
> \> \> \> wrote:  
> \> \> \> \> \> \> \>  
> \> \> \> \> \> \> \> We have some machine on which the fake lookup table

animation  

> \> \> \> works,  
> \> \> \> \> \> \> \> and several on which it fails, including ones with very new  
> \> \> \> cards and  
> \> \> \> \> \> \> \> drivers.  
> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> The GLSLClutAnimDemo program fails with   
> \> \> \> \> \> \> \> MOGL-ERROR: Compilation of the GLSL shader object 2 via  
> \> \> \> \> \> \> \> glCompileShader(2) failed!  
> \> \> \> \> \> \> \> The shader info log for shader 2 tells us the following:  
> \> \> \> \> \> \> \> (2) : error C7531: global type sampler2DRect requires  
> \> \> "#extension  
> \> \> \> \> \> \> \> GL\_ARB\_texture\_rectangle : enable" before use  
> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> ??? Shader compilation failed!  
> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> Error in ==\> GLSLCLUTAnimDemo at 114  
> \> \> \> \> \> \> \> psychrethrow(psychlasterror);  
> \> \> \> \> \> \> \> similarly on two machines.  
> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> I tested the OpenGL functionality on all machines using  
> \> \> \> \> \> \> \> OpneGL Extensions Viewer 2.29 from realtech-vr.com

(GLView.exe  

> \> \> \> free  
> \> \> \> \> \> \> \> for noncommercial use), and it reports that  
> \> \> \> GL\_ARB\_texture\_rectangle  
> \> \> \> \> \> \> \> is enabled.  
> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> Here are links to log fles from two machines that fail   
> \> \> \> \> \> \> \> (one NVidia GeForce FX 5200/AGP/SSE/3DNOW! and   
> \> \> \> \> \> \> \> one NVidea GeForce 7025 / NVIDIA nForce

630a/PCI/SSE2/3DNOW!)  

> \> \> \> \> \> \> \> and one machine that works fine (GeForce

6600/PCI/SSE2/3DNOW!),  

> \> \> \> \> \> \> \> all with the latest drivers and full OpenGL functionality  
> \> \> \> according to  
> \> \> \> \> \> \> \> GLView.  
> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> The log files below have the GLView report, the results

of the  

> \> \> \> "opengl  
> \> \> \> \> \> \> \> info" command from MatLab (R2006b), and the results of the  
> \> \> \> \> \> \> \> "GLSLCLUTAnimDemo" command from MatLab.  
> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> FAILS:  
> \> \> \> \> \> \> \> [http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc15.txt](http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc15.txt)  
> \> \> \> \> \> \> \> [http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc18.txt](http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc18.txt)  
> \> \> \> \> \> \> \> WORKS:  
> \> \> \> \> \> \> \> [http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc23-WORKS.txt](http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc23-WORKS.txt)  
> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> I imagine that the fix must be small, but a few hours of  
> \> \> \> looking into  
> \> \> \> \> \> \> \> it has not made things make sense to me.  
> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> I would love help, if anyone has ideas. From what I

have read  

> \> \> \> on the  
> \> \> \> \> \> \> \> forum, both setups that fail OUGHT to work.  
> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> --Michael Stryker stryker@ 415.476-5443  
> \> \> \> \> \> \> \>  
> \> \> \> \> \> \>  
> \> \> \> \> \>  
> \> \> \> \>  
> \> \> \>  
> \> \>  
> \>

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [June 4, 2008, 11:16pm UTC](https://psychtoolbox.discourse.group/t/glslclutanimdemo-fail-on-ms-windows-xpssp2-with-latest-nvidia-drivers-and-cards/1881/4 "2008-06-04T23:16:52Z")

</div>

Ok, UpdatePsychtoolbox your 'trunk' again and retest.  
  
Last time it was my fault, this time it seems to be  
NVidias fault -- a well known driver bug in all of  
their recent drivers, unfixed since multiple months.  
  
see for example:  
  
\<[http://www.stevestreeting.com/2007/12/27/nvidia-16921-driver-bug-in-glsl/](http://www.stevestreeting.com/2007/12/27/nvidia-16921-driver-bug-in-glsl/)\>  
  
"Crysis" and "Second life" were affected by the same  
bug, and 1 million+ users don't seem to be a  
reason for a quick fix ;-)  
  
Anyway, work-around implemented, keep your fingers  
crossed that it works. It worked perfectly fine on my  
WinXP test machine with GF7800 and drivers updated  
sometimes last winter...  
  
-mario  
  
  

> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "amhaun01" \<amhaun01@...\> wrote:  
> \>  
> \> ah.. Seems to be another error after the update, still upon the  
> \> 'OpenWindow' command:  
> \>   
> \> Building a fragment shader:Reading shader from file  
> \>   
> C:\Psychtoolbox\PsychOpenGL/PsychGLSLShaders/GenericLuminanceToRGBA8\_Formatting  
> Shader.frag.txt  
> \> ...  
> \> MOGL-ERROR: Linking of the GLSL shader program 2 via glLinkProgram(2)  
> \> failed!  
> \> The program info log for program 2 tells us the following:  
> \> Fragment info  
> \> -------------  
> \> (0) : fatal error C9999: Bad scope in ConvertLocalReferences()  
> \>   
> \> ??? Error using ==\> moglcore  
> \> GLSL link operation failed!  
> \>   
> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Mario Kleiner"  
> \> \<mario.kleiner@\> wrote:  
> \> \>  
> \> \> Hi again,  
> \> \>   
> \> \> update from 'trunk', then retry and give feedback --  
> \> \> as soon as possible!  
> \> \>   
> \> \> I want to push out a beta update this week, preferrably  
> \> \> tomorrow latest.  
> \> \>   
> \> \> I've only fixed Screen for Matlab R2007a and later  
> \> \> for now, not yet Screen for older Matlabs.   
> \> \>   
> \> \> The problem was "fixed", but apparently not in the  
> \> \> correct way. That fix caused the driver to accept the  
> \> \> shaders and only spill out warnings about non-conformant  
> \> \> behaviour. Seems NVidia decided to turn the warnings into  
> \> \> errors in their latest driver release. OS/X et al. still accepted  
> \> \> the non-conformant shaders.  
> \> \>   
> \> \> Hopefully this fixes it.  
> \> \> -mario  
> \> \>   
> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "amhaun01" \<amhaun01@\> wrote:  
> \> \> \>  
> \> \> \> Okay, context: we're using a GeForce 8600GT. As far as I can tell,  
> \> \> \> all drivers are current, and everything should work, but I can't get  
> \> \> \> past this error.  
> \> \> \>   
> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "amhaun01" \<amhaun01@\> wrote:  
> \> \> \> \>  
> \> \> \> \> Is this solution applied to the current 'trunk' version?   
> \> Because I've  
> \> \> \> \> encountered this same error, upon the 'OpenWindow' command on the  
> \> \> \> \> bitsPlusAdditiveBlending~ demo (line 88).  
> \> \> \> \>   
> \> \> \> \> "global type sampler2DRect requires '#extension  
> \> \> \> \> GL\_ARB\_texture\_rectangle : enable'"  
> \> \> \> \>   
> \> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Mario Kleiner"  
> \> \> \> \> \<mario.kleiner@\> wrote:  
> \> \> \> \> \>  
> \> \> \> \> \> Jap. Tried it on our machine after driver update. Fails as well.  
> \> \> \> \> \>   
> \> \> \> \> \> Anyway i found a solution that works. Just updated 'beta' a  
> \> \> \> \> \> minute ago. Undo all your changes, then update your PTB beta  
> \> \> \> \> \> via UpdatePsychtoolbox.  
> \> \> \> \> \>   
> \> \> \> \> \> thanks for reporting this - and for the nice and efficient  
> \> \> \> \> \> bug report,  
> \> \> \> \> \> -mario  
> \> \> \> \> \>   
> \> \> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Michael P Stryker"  
> \> \<stryker@\>  
> \> \> \> \> wrote:  
> \> \> \> \> \> \>  
> \> \> \> \> \> \> I added the line  
> \> \> \> \> \> \> #extension GL\_ARB\_texture\_rectangle : enable  
> \> \> \> \> \> \> under the line   
> \> \> \> \> \> \> #version 110  
> \> \> \> \> \> \> in the file   
> \> \> \> \> \> \>  
> \> Psychtoolbox/PsychOpenGL/PsychGLSLShaders/ClutBlitShader.frag.txt  
> \> \> \> \> \> \> [presumably the "ClutBlutShader" in your message was a typo]  
> \> \> \> \> \> \> and restarted MatLab, and  
> \> \> \> \> \> \> GLSLClutAnimDemo failed identiacally to its previous failure  
> \> on the   
> \> \> \> \> \> \> "NVidea GeForce 7025 / NVIDIA nForce 630a/PCI/SSE2/3DNOW!"  
> \> machine  
> \> \> \> \> \> \> (pc15). So it looks like that fix does not work. Sorry.  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> More ideas?  
> \> \> \> \> \> \> --Michael Stryker  
> \> \> \> \> \> \>   
> \> \> \> \> \> \>   
> \> \> \> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Mario Kleiner"  
> \> \> \> \> \> \> \<mario.kleiner@\> wrote:  
> \> \> \> \> \> \> \>  
> \> \> \> \> \> \> \> What a nice bug report :-)  
> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> Try this:  
> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> Edit the file  
> \> \> \> \> \> \> \>  
> \> Psychtoolbox/PsychOpenGL/PsychGLSLShaders/ClutBlutShader.frag.txt  
> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> Replace:  
> \> \> \> \> \> \> \> #version 110  
> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> by:  
> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> #version 110  
> \> \> \> \> \> \> \> #extension GL\_ARB\_texture\_rectangle : enable  
> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> Retest and tell me the result. If this fixes it, i'll  
> \> update all  
> \> \> \> \> shaders  
> \> \> \> \> \> \> \> for the next 'beta' release to fix it.  
> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> Seems that the latest NVidia GLSL compilers are more strict in  
> \> \> \> \> \> \> \> their code checking...  
> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> best,  
> \> \> \> \> \> \> \> -mario  
> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "mpstryker@" \<mpstryker@\>  
> \> \> \> \> wrote:  
> \> \> \> \> \> \> \> \>  
> \> \> \> \> \> \> \> \> We have some machine on which the fake lookup table  
> \> animation  
> \> \> \> \> works,  
> \> \> \> \> \> \> \> \> and several on which it fails, including ones with very new  
> \> \> \> \> cards and  
> \> \> \> \> \> \> \> \> drivers.  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> The GLSLClutAnimDemo program fails with   
> \> \> \> \> \> \> \> \> MOGL-ERROR: Compilation of the GLSL shader object 2 via  
> \> \> \> \> \> \> \> \> glCompileShader(2) failed!  
> \> \> \> \> \> \> \> \> The shader info log for shader 2 tells us the following:  
> \> \> \> \> \> \> \> \> (2) : error C7531: global type sampler2DRect requires  
> \> \> \> "#extension  
> \> \> \> \> \> \> \> \> GL\_ARB\_texture\_rectangle : enable" before use  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> ??? Shader compilation failed!  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> Error in ==\> GLSLCLUTAnimDemo at 114  
> \> \> \> \> \> \> \> \> psychrethrow(psychlasterror);  
> \> \> \> \> \> \> \> \> similarly on two machines.  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> I tested the OpenGL functionality on all machines using  
> \> \> \> \> \> \> \> \> OpneGL Extensions Viewer 2.29 from realtech-vr.com  
> \> (GLView.exe  
> \> \> \> \> free  
> \> \> \> \> \> \> \> \> for noncommercial use), and it reports that  
> \> \> \> \> GL\_ARB\_texture\_rectangle  
> \> \> \> \> \> \> \> \> is enabled.  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> Here are links to log fles from two machines that fail   
> \> \> \> \> \> \> \> \> (one NVidia GeForce FX 5200/AGP/SSE/3DNOW! and   
> \> \> \> \> \> \> \> \> one NVidea GeForce 7025 / NVIDIA nForce  
> \> 630a/PCI/SSE2/3DNOW!)  
> \> \> \> \> \> \> \> \> and one machine that works fine (GeForce  
> \> 6600/PCI/SSE2/3DNOW!),  
> \> \> \> \> \> \> \> \> all with the latest drivers and full OpenGL functionality  
> \> \> \> \> according to  
> \> \> \> \> \> \> \> \> GLView.  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> The log files below have the GLView report, the results  
> \> of the  
> \> \> \> \> "opengl  
> \> \> \> \> \> \> \> \> info" command from MatLab (R2006b), and the results of the  
> \> \> \> \> \> \> \> \> "GLSLCLUTAnimDemo" command from MatLab.  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> FAILS:  
> \> \> \> \> \> \> \> \> [http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc15.txt](http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc15.txt)  
> \> \> \> \> \> \> \> \> [http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc18.txt](http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc18.txt)  
> \> \> \> \> \> \> \> \> WORKS:  
> \> \> \> \> \> \> \> \> [http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc23-WORKS.txt](http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc23-WORKS.txt)  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> I imagine that the fix must be small, but a few hours of  
> \> \> \> \> looking into  
> \> \> \> \> \> \> \> \> it has not made things make sense to me.  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> I would love help, if anyone has ideas. From what I  
> \> have read  
> \> \> \> \> on the  
> \> \> \> \> \> \> \> \> forum, both setups that fail OUGHT to work.  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> --Michael Stryker stryker@ 415.476-5443  
> \> \> \> \> \> \> \> \>  
> \> \> \> \> \> \> \>  
> \> \> \> \> \> \>  
> \> \> \> \> \>  
> \> \> \> \>  
> \> \> \>  
> \> \>  
> \>

---

<div class="post-metadata">

**Author:** ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)\
**Post date:** [June 5, 2008, 3:24pm UTC](https://psychtoolbox.discourse.group/t/glslclutanimdemo-fail-on-ms-windows-xpssp2-with-latest-nvidia-drivers-and-cards/1881/5 "2008-06-05T15:24:09Z")

</div>

The demo is working, many thanks! Now, I'll see what I can do with it...  
  
thanks-  
-andrew  
  
--- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Mario Kleiner"  
\<mario.kleiner@...\> wrote:  

> \>  
> \> Ok, UpdatePsychtoolbox your 'trunk' again and retest.  
> \>   
> \> Last time it was my fault, this time it seems to be  
> \> NVidias fault -- a well known driver bug in all of  
> \> their recent drivers, unfixed since multiple months.  
> \>   
> \> see for example:  
> \>   
> \>

\<[http://www.stevestreeting.com/2007/12/27/nvidia-16921-driver-bug-in-glsl/](http://www.stevestreeting.com/2007/12/27/nvidia-16921-driver-bug-in-glsl/)\>  

> \>   
> \> "Crysis" and "Second life" were affected by the same  
> \> bug, and 1 million+ users don't seem to be a  
> \> reason for a quick fix ;-)  
> \>   
> \> Anyway, work-around implemented, keep your fingers  
> \> crossed that it works. It worked perfectly fine on my  
> \> WinXP test machine with GF7800 and drivers updated  
> \> sometimes last winter...  
> \>   
> \> -mario  
> \>   
> \>   
> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "amhaun01" \<amhaun01@\> wrote:  
> \> \>  
> \> \> ah.. Seems to be another error after the update, still upon the  
> \> \> 'OpenWindow' command:  
> \> \>   
> \> \> Building a fragment shader:Reading shader from file  
> \> \>   
> \>

C:\Psychtoolbox\PsychOpenGL/PsychGLSLShaders/GenericLuminanceToRGBA8\_Formatting  

> \> Shader.frag.txt  
> \> \> ...  
> \> \> MOGL-ERROR: Linking of the GLSL shader program 2 via glLinkProgram(2)  
> \> \> failed!  
> \> \> The program info log for program 2 tells us the following:  
> \> \> Fragment info  
> \> \> -------------  
> \> \> (0) : fatal error C9999: Bad scope in ConvertLocalReferences()  
> \> \>   
> \> \> ??? Error using ==\> moglcore  
> \> \> GLSL link operation failed!  
> \> \>   
> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Mario Kleiner"  
> \> \> \<mario.kleiner@\> wrote:  
> \> \> \>  
> \> \> \> Hi again,  
> \> \> \>   
> \> \> \> update from 'trunk', then retry and give feedback --  
> \> \> \> as soon as possible!  
> \> \> \>   
> \> \> \> I want to push out a beta update this week, preferrably  
> \> \> \> tomorrow latest.  
> \> \> \>   
> \> \> \> I've only fixed Screen for Matlab R2007a and later  
> \> \> \> for now, not yet Screen for older Matlabs.   
> \> \> \>   
> \> \> \> The problem was "fixed", but apparently not in the  
> \> \> \> correct way. That fix caused the driver to accept the  
> \> \> \> shaders and only spill out warnings about non-conformant  
> \> \> \> behaviour. Seems NVidia decided to turn the warnings into  
> \> \> \> errors in their latest driver release. OS/X et al. still accepted  
> \> \> \> the non-conformant shaders.  
> \> \> \>   
> \> \> \> Hopefully this fixes it.  
> \> \> \> -mario  
> \> \> \>   
> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "amhaun01" \<amhaun01@\> wrote:  
> \> \> \> \>  
> \> \> \> \> Okay, context: we're using a GeForce 8600GT. As far as I can

tell,  

> \> \> \> \> all drivers are current, and everything should work, but I

can't get  

> \> \> \> \> past this error.  
> \> \> \> \>   
> \> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "amhaun01" \<amhaun01@\> wrote:  
> \> \> \> \> \>  
> \> \> \> \> \> Is this solution applied to the current 'trunk' version?   
> \> \> Because I've  
> \> \> \> \> \> encountered this same error, upon the 'OpenWindow' command

on the  

> \> \> \> \> \> bitsPlusAdditiveBlending~ demo (line 88).  
> \> \> \> \> \>   
> \> \> \> \> \> "global type sampler2DRect requires '#extension  
> \> \> \> \> \> GL\_ARB\_texture\_rectangle : enable'"  
> \> \> \> \> \>   
> \> \> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Mario Kleiner"  
> \> \> \> \> \> \<mario.kleiner@\> wrote:  
> \> \> \> \> \> \>  
> \> \> \> \> \> \> Jap. Tried it on our machine after driver update. Fails as

well.  

> \> \> \> \> \> \>   
> \> \> \> \> \> \> Anyway i found a solution that works. Just updated 'beta' a  
> \> \> \> \> \> \> minute ago. Undo all your changes, then update your PTB beta  
> \> \> \> \> \> \> via UpdatePsychtoolbox.  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> thanks for reporting this - and for the nice and efficient  
> \> \> \> \> \> \> bug report,  
> \> \> \> \> \> \> -mario  
> \> \> \> \> \> \>   
> \> \> \> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Michael P Stryker"  
> \> \> \<stryker@\>  
> \> \> \> \> \> wrote:  
> \> \> \> \> \> \> \>  
> \> \> \> \> \> \> \> I added the line  
> \> \> \> \> \> \> \> #extension GL\_ARB\_texture\_rectangle : enable  
> \> \> \> \> \> \> \> under the line   
> \> \> \> \> \> \> \> #version 110  
> \> \> \> \> \> \> \> in the file   
> \> \> \> \> \> \> \>  
> \> \> Psychtoolbox/PsychOpenGL/PsychGLSLShaders/ClutBlitShader.frag.txt  
> \> \> \> \> \> \> \> [presumably the "ClutBlutShader" in your message was a typo]  
> \> \> \> \> \> \> \> and restarted MatLab, and  
> \> \> \> \> \> \> \> GLSLClutAnimDemo failed identiacally to its previous failure  
> \> \> on the   
> \> \> \> \> \> \> \> "NVidea GeForce 7025 / NVIDIA nForce 630a/PCI/SSE2/3DNOW!"  
> \> \> machine  
> \> \> \> \> \> \> \> (pc15). So it looks like that fix does not work. Sorry.  
> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> More ideas?  
> \> \> \> \> \> \> \> --Michael Stryker  
> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Mario Kleiner"  
> \> \> \> \> \> \> \> \<mario.kleiner@\> wrote:  
> \> \> \> \> \> \> \> \>  
> \> \> \> \> \> \> \> \> What a nice bug report :-)  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> Try this:  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> Edit the file  
> \> \> \> \> \> \> \> \>  
> \> \> Psychtoolbox/PsychOpenGL/PsychGLSLShaders/ClutBlutShader.frag.txt  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> Replace:  
> \> \> \> \> \> \> \> \> #version 110  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> by:  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> #version 110  
> \> \> \> \> \> \> \> \> #extension GL\_ARB\_texture\_rectangle : enable  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> Retest and tell me the result. If this fixes it, i'll  
> \> \> update all  
> \> \> \> \> \> shaders  
> \> \> \> \> \> \> \> \> for the next 'beta' release to fix it.  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> Seems that the latest NVidia GLSL compilers are more

strict in  

> \> \> \> \> \> \> \> \> their code checking...  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> best,  
> \> \> \> \> \> \> \> \> -mario  
> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "mpstryker@"

\<mpstryker@\>  

> \> \> \> \> \> wrote:  
> \> \> \> \> \> \> \> \> \>  
> \> \> \> \> \> \> \> \> \> We have some machine on which the fake lookup table  
> \> \> animation  
> \> \> \> \> \> works,  
> \> \> \> \> \> \> \> \> \> and several on which it fails, including ones with

very new  

> \> \> \> \> \> cards and  
> \> \> \> \> \> \> \> \> \> drivers.  
> \> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> \> The GLSLClutAnimDemo program fails with   
> \> \> \> \> \> \> \> \> \> MOGL-ERROR: Compilation of the GLSL shader object 2 via  
> \> \> \> \> \> \> \> \> \> glCompileShader(2) failed!  
> \> \> \> \> \> \> \> \> \> The shader info log for shader 2 tells us the following:  
> \> \> \> \> \> \> \> \> \> (2) : error C7531: global type sampler2DRect requires  
> \> \> \> \> "#extension  
> \> \> \> \> \> \> \> \> \> GL\_ARB\_texture\_rectangle : enable" before use  
> \> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> \> ??? Shader compilation failed!  
> \> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> \> Error in ==\> GLSLCLUTAnimDemo at 114  
> \> \> \> \> \> \> \> \> \> psychrethrow(psychlasterror);  
> \> \> \> \> \> \> \> \> \> similarly on two machines.  
> \> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> \> I tested the OpenGL functionality on all machines using  
> \> \> \> \> \> \> \> \> \> OpneGL Extensions Viewer 2.29 from realtech-vr.com  
> \> \> (GLView.exe  
> \> \> \> \> \> free  
> \> \> \> \> \> \> \> \> \> for noncommercial use), and it reports that  
> \> \> \> \> \> GL\_ARB\_texture\_rectangle  
> \> \> \> \> \> \> \> \> \> is enabled.  
> \> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> \> Here are links to log fles from two machines that fail   
> \> \> \> \> \> \> \> \> \> (one NVidia GeForce FX 5200/AGP/SSE/3DNOW! and   
> \> \> \> \> \> \> \> \> \> one NVidea GeForce 7025 / NVIDIA nForce  
> \> \> 630a/PCI/SSE2/3DNOW!)  
> \> \> \> \> \> \> \> \> \> and one machine that works fine (GeForce  
> \> \> 6600/PCI/SSE2/3DNOW!),  
> \> \> \> \> \> \> \> \> \> all with the latest drivers and full OpenGL

functionality  

> \> \> \> \> \> according to  
> \> \> \> \> \> \> \> \> \> GLView.  
> \> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> \> The log files below have the GLView report, the results  
> \> \> of the  
> \> \> \> \> \> "opengl  
> \> \> \> \> \> \> \> \> \> info" command from MatLab (R2006b), and the results

of the  

> \> \> \> \> \> \> \> \> \> "GLSLCLUTAnimDemo" command from MatLab.  
> \> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> \> FAILS:  
> \> \> \> \> \> \> \> \> \> [http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc15.txt](http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc15.txt)  
> \> \> \> \> \> \> \> \> \> [http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc18.txt](http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc18.txt)  
> \> \> \> \> \> \> \> \> \> WORKS:  
> \> \> \> \> \> \> \> \> \> [http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc23-WORKS.txt](http://keck.ucsf.edu/~stryker/ptb/OpenGL-pc23-WORKS.txt)  
> \> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> \> I imagine that the fix must be small, but a few hours of  
> \> \> \> \> \> looking into  
> \> \> \> \> \> \> \> \> \> it has not made things make sense to me.  
> \> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> \> I would love help, if anyone has ideas. From what I  
> \> \> have read  
> \> \> \> \> \> on the  
> \> \> \> \> \> \> \> \> \> forum, both setups that fail OUGHT to work.  
> \> \> \> \> \> \> \> \> \>   
> \> \> \> \> \> \> \> \> \> --Michael Stryker stryker@ 415.476-5443  
> \> \> \> \> \> \> \> \> \>  
> \> \> \> \> \> \> \> \>  
> \> \> \> \> \> \> \>  
> \> \> \> \> \> \>  
> \> \> \> \> \>  
> \> \> \> \>  
> \> \> \>  
> \> \>  
> \>
