# &#39;PutImage&#39; error in PTB3

**URL:** <https://psychtoolbox.discourse.group/t/39-putimage-39-error-in-ptb3/2015>\
**Category:** Uncategorized\
**Created:** [October 10, 2008, 6:09pm UTC](https://psychtoolbox.discourse.group/t/39-putimage-39-error-in-ptb3/2015 "2008-10-10T18:09:59Z")\
**Posts on this page:** 4\
**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:** [October 10, 2008, 6:09pm UTC](https://psychtoolbox.discourse.group/t/39-putimage-39-error-in-ptb3/2015/1 "2008-10-10T18:09:59Z")

</div>

> \>\> GratingDemo

INTERNAL PSYCHTOOLBOX ERROR  
 error: Psycherror\_OpenGL  
 general description: OpenGL call returned an error  
 specific description: GL\_INVALID\_ENUM  
 module name: Screen  
 subfunction call: PutImage  
 file name: Common\Screen\SCREENPutImage.c  
 function name: UNKNOWN  
 line number: 245  
??? Error using ==\> Screen  
(null)  
  
Error in ==\> GratingDemo at 158  
 Screen('PutImage', window, grayscaleImageMatrix);  
  
  
  
  
When I run the GratingDemo, the 'PutImage' keeps showing errors.  
Does anyone have a solution?  
  
Thanks!

---

<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:** [October 14, 2008, 7:41pm UTC](https://psychtoolbox.discourse.group/t/39-putimage-39-error-in-ptb3/2015/2 "2008-10-14T19:41:48Z")

</div>

Almost certainly a graphics driver bug --\> Update your  
graphics drivers.  
  

> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "cathykao2001" \<cathykao2001@...\> wrote:  
> \>  
> \> \>\> GratingDemo  
> \> INTERNAL PSYCHTOOLBOX ERROR  
> \> error: Psycherror\_OpenGL  
> \> general description: OpenGL call returned an error  
> \> specific description: GL\_INVALID\_ENUM  
> \> module name: Screen  
> \> subfunction call: PutImage  
> \> file name: Common\Screen\SCREENPutImage.c  
> \> function name: UNKNOWN  
> \> line number: 245  
> \> ??? Error using ==\> Screen  
> \> (null)  
> \>   
> \> Error in ==\> GratingDemo at 158  
> \> Screen('PutImage', window, grayscaleImageMatrix);  
> \>   
> \>   
> \>   
> \>   
> \> When I run the GratingDemo, the 'PutImage' keeps showing errors.  
> \> Does anyone have a solution?  
> \>   
> \> Thanks!  
> \>

---

<div class="post-metadata">

**Author:** ![ah\_javadi](https://avatars.discourse-cdn.com/v4/letter/a/b5ac83/32.png) [@ah\_javadi](https://psychtoolbox.discourse.group/u/ah_javadi)\
**Post date:** [October 26, 2010, 2:12am UTC](https://psychtoolbox.discourse.group/t/39-putimage-39-error-in-ptb3/2015/3 "2010-10-26T02:12:19Z")

</div>

Dear Mario 
  

I receive the same error message trying to run GratindDemo

  

> > INTERNAL PSYCHTOOLBOX ERROR  
> > error: Psycherror\_OpenGL   
> > general description: OpenGL call returned an error  
> > specific description: GL\_INVALID\_ENUM  
> > module name: Screen  
> > subfunction call: PutImage  
> > file name: Common\Screen\SCREENPutImage.c  
> > function name: UNKNOWN  
> > line number: 245  
> > ??? Error using ==\> Screen  
> > (null)  
> >   
> > Error in ==\> GratingDemo at 158  
> > Screen('PutImage', window, grayscaleImageMatrix);
> 
>   
> 
> I've updated my graphics driver. My graphics card is NVIDIA GeForce 4 Ti4200, 64MB. The driver is dated November 2006. I have to add that I used to run PTB on this machine, but I didn't use the machine for a while and my colleagues' used it. Now, I don't know what's happened to it. I've installed PTB3 on MATLAB 2008 under Windows XP OS. Would you please let me know what I should? Thanks.
>  
>   
> Have a good time :-)
> Amir
> 
>   
> 
>   
>   
>   
> 
> On 14 October 2008 20:41, Mario Kleiner \<[mario.kleiner@...](mailto:mario.kleiner@...)\> wrote:  
> 
> > Almost certainly a graphics driver bug --\> Update your  
> > graphics drivers.
> > 
> >   
> >   
> > --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox%40yahoogroups.com), "cathykao2001" \<cathykao2001@...\> wrote:  
> > \>  
> > \> \>\> GratingDemo  
> > \> INTERNAL PSYCHTOOLBOX ERROR  
> > \> error: Psycherror\_OpenGL  
> > \> general description: OpenGL call returned an error  
> > \> specific description: GL\_INVALID\_ENUM  
> > \> module name: Screen  
> > \> subfunction call: PutImage  
> > \> file name: Common\Screen\SCREENPutImage.c  
> > \> function name: UNKNOWN  
> > \> line number: 245  
> > \> ??? Error using ==\> Screen  
> > \> (null)  
> > \>   
> > \> Error in ==\> GratingDemo at 158  
> > \> Screen('PutImage', window, grayscaleImageMatrix);  
> > \>   
> > \>   
> > \>   
> > \>   
> > \> When I run the GratingDemo, the 'PutImage' keeps showing errors.  
> > \> Does anyone have a solution?  
> > \>   
> > \> Thanks!  
> > \>

---

<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:** [October 29, 2010, 4:15am UTC](https://psychtoolbox.discourse.group/t/39-putimage-39-error-in-ptb3/2015/4 "2010-10-29T04:15:38Z")

</div>

Sorry, but there isn't much you can do. It's a graphics driver bug, for a card that is old enough that NVidia or anybody else certainly wouldn't care about bug reports anymore. You can try to download and install different versions of the driver and hope one of them works. Or try to avoid using the function which causes the error.  
  
Ok, maybe you can work around it.  
  
Add InitializeMatlabOpenGL([],[],1); to the top of the script. Call gluErrorString() between each call to Screen() to find out, which function really causes the error and to reset the error state. Maybe silencing the error handling this way is enough and stuff will work despite the error.  
  
-mario  
  
  

> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), Amir H Javadi \<a.h.javadi@...\> wrote:  
> \>  
> \> Dear Mario  
> \>   
> \> I receive the same error message trying to run GratindDemo  
> \>   
> \> INTERNAL PSYCHTOOLBOX ERROR  
> \> error: Psycherror\_OpenGL  
> \> general description: OpenGL call returned an error  
> \> specific description: GL\_INVALID\_ENUM  
> \> module name: Screen  
> \> subfunction call: PutImage  
> \> file name: Common\Screen\SCREENPutImage.c  
> \> function name: UNKNOWN  
> \> line number: 245  
> \> ??? Error using ==\> Screen  
> \> (null)  
> \>   
> \> Error in ==\> GratingDemo at 158  
> \> Screen('PutImage', window, grayscaleImageMatrix);  
> \>   
> \>   
> \> I've updated my graphics driver. My graphics card is NVIDIA GeForce 4  
> \> Ti4200, 64MB. The driver is dated November 2006. I have to add that I used  
> \> to run PTB on this machine, but I didn't use the machine for a while and my  
> \> colleagues' used it. Now, I don't know what's happened to it. I've installed  
> \> PTB3 on MATLAB 2008 under Windows XP OS. Would you please let me know what I  
> \> should? Thanks.  
> \>   
> \> Have a good time :-)  
> \> Amir  
> \>   
> \>   
> \>   
> \>   
> \> On 14 October 2008 20:41, Mario Kleiner \<mario.kleiner@...\>wrote:  
> \>   
> \> \> Almost certainly a graphics driver bug --\> Update your  
> \> \> graphics drivers.  
> \> \>  
> \> \>  
> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com) \<psychtoolbox%40yahoogroups.com\>,  
> \> \> "cathykao2001" \<cathykao2001@\> wrote:  
> \> \> \>  
> \> \> \> \>\> GratingDemo  
> \> \> \> INTERNAL PSYCHTOOLBOX ERROR  
> \> \> \> error: Psycherror\_OpenGL  
> \> \> \> general description: OpenGL call returned an error  
> \> \> \> specific description: GL\_INVALID\_ENUM  
> \> \> \> module name: Screen  
> \> \> \> subfunction call: PutImage  
> \> \> \> file name: Common\Screen\SCREENPutImage.c  
> \> \> \> function name: UNKNOWN  
> \> \> \> line number: 245  
> \> \> \> ??? Error using ==\> Screen  
> \> \> \> (null)  
> \> \> \>  
> \> \> \> Error in ==\> GratingDemo at 158  
> \> \> \> Screen('PutImage', window, grayscaleImageMatrix);  
> \> \> \>  
> \> \> \>  
> \> \> \>  
> \> \> \>  
> \> \> \> When I run the GratingDemo, the 'PutImage' keeps showing errors.  
> \> \> \> Does anyone have a solution?  
> \> \> \>  
> \> \> \> Thanks!  
> \> \> \>  
> \> \>  
> \> \>   
> \> \>  
> \>
