| Reference | Downloads | Github

Ubuntu, no experiments will run: ValueError, 'Shader compilation failed'

Hello! Psychopy has been working without problems for me for at least a year, but today a new error cropped up, which won’t let me run any experiments whatsoever, since the error occurs during window creation.

This is the error:

 Running: /home/daniel/Documents/PsychoPyTests/TypingDemo/ 
Traceback (most recent call last):
  File "/home/daniel/Documents/PsychoPyTests/TypingDemo/", line 56, in <module>
    blendMode='avg', useFBO=True)
  File "/home/daniel/Documents/sourceCode/psychopy/psychopy/visual/", line 340, in __init__
  File "/home/daniel/Documents/sourceCode/psychopy/psychopy/visual/", line 1593, in _setupGL
  File "/home/daniel/Documents/sourceCode/psychopy/psychopy/visual/", line 1610, in _setupShaders
    _shaders.vertSimple, _shaders.fragSignedColorTexFont)
  File "/home/daniel/Documents/sourceCode/psychopy/psychopy/visual/", line 58, in compileProgram
    vertexSource, GL.GL_VERTEX_SHADER_ARB
  File "/home/daniel/Documents/sourceCode/psychopy/psychopy/visual/", line 51, in compileShader
    raise ValueError, 'Shader compilation failed'
ValueError: Shader compilation failed
Exception AttributeError: "'Window' object has no attribute 'useNativeGamma'" in <bound method Window.__del__ of <psychopy.visual.window.Window object at 0x7f7a5a025f10>> ignored

I assume the second AttributeError is simply a result of the window never having been created properly and the real problem is this Shader compilation problem. I’m hoping you guys could help me figure out what the deal with this is since I literally can’t run anything.

Here’s some system information:
Psychopy: 1.84.2
System: Ubuntu 14.04
Graphics Card: Nvidia GeForce GT 650M
Graphics driver: nvidia 304.132

My best guess is some other package was updated that’s causing this problem? A ton of packages were updated for me this past Monday, notably, it looks like my graphics driver was updated, and there were some python updates as well. But yet, I know I ran some things the day after on Tuesday, so I don’t know what to make of that. I’m attaching a complete list of those updates here, just in case you can spot something else, sorry that it’s so long:

packages-Out.csv (20.1 KB)

Detailed description of the trace

Just to give more info than the trace shows, in _setupShaders() in, the fail begins in the first call:

def _setupShaders(self):
    self._progSignedTexFont = _shaders.compileProgram(_shaders.vertSimple, _shaders.fragSignedColorTexFont)

which takes us to, compileProgram(), where at line 56:

if vertexSource:
    vertexShader = compileShader(
        vertexSource, GL.GL_VERTEX_SHADER_ARB

It calls the internal function compileShader() on line 32, and the error happens around line 48:

# check for errors
status = c_int()
GL.glGetShaderiv(shader, GL.GL_COMPILE_STATUS, byref(status))
if not status.value:
    raise ValueError, 'Shader compilation failed'
return shader

The value of ‘shader’ shown in the debugger was c_int(0), so status.value is 0.

I have no idea what any of this means, Any ideas where this could’ve gone wrong?

Hope you guys can help, let me know what further information I can provide. Take care,

Definitely looks like a change in the driver, but conceivably it’s just giving the wrong return value. Just for kicks see what happens if you comment out the error-checking code (if not status.value...)

Other options:

You could try a newer(?) version of the nvidia driver or you could try the open-source “Nouveau” driver for nvidia under ubuntu?

Also, by the way, I’ve updated my linux boxes to 16.04 and found no problems. In fact I think that issue with halved frame rate (with waitBlanking=True) might have gone away. Certainly it isn’t there on my 16.04 system but I don’t now know if another change is responsible or whether it was the 16.04 update. If someone has a machine currently showing the halved frame rate that they could upgrade to 16.04 I’d love to hear if it went away.

Hey Jon,

Yeah, I figured as much. In short, I commented out the error check and things are running no problem so far, so I’ll just be happy with that for now.

I remember when I updated this machine from 12.04 to 14.04 I ran into some driver issues so I’m well aware of the non-proprietary driver, and know that switching to nouveau is not an option in this case. There was some reason I’m using the version I am…

I damn near updated to 16.04 the other week, but am just dreading reinstalling everything (because I need a fresh install!), and don’t want to gank my dual boot, it took me DAYS to get visual studio and friends up and running for another project. When that’s through I’ll bite the bullet and will be happy to let you know if the screen refresh problem goes away.

Thanks, I somehow didn’t think to just comment that out and hope for the best!