title: GPU driver errors handling
body: <p>I'm writting OpenGL-based rendering application and I'm wondering if there is a way to intercept errors sent by the GPU driver? </p>
  
  <p>For now I get MB with error information and then app just closes. I'm not saying that is bad ;) but I would like to do some on-close operations based on what is going on in the app.</p>
  
  <p>I'm working on both Nvidia and ATI GPU cards and I'm getting various errors depending on the GPU card performance and model.</p>
  
  <p>Also I have an issue with memory management. I'm using VBO-s for rendering and when is no sufficent memory on GPU unit GPU driver saves VBO data on RAM. This is to be expected but there it seems that there is no RAM overload mechanism and my computer hangs when GPU driver tries to allocate more memory for buffer than there is avaliable.</p>
  
  <p><strong>Update:</strong></p>
  
  <p><strong>Memory management:</strong> Something I thought was a hang was in fact <strong>drastic performace decrease</strong> when after allocationg all available RAM my Windows OS was using <strong>virtual memory on HDD</strong>. After setting avaliable vitrual memory in my OS to 0 <code>GL_OUT_OF_MEMORY</code> was retuned after <code>glGetError(void);</code> call.</p>
  
  <p><strong>Error handling:</strong> I'm sorry I may have not been specific enough. Performace of rendering code that I wrote seems to be <strong>highly hardware dependent</strong> which is to be expected. My problem is that I'm not recieving any errors from OpenGL itself but from graphic card driver <strong>durnig rendering process</strong>. I wish to intercept these <strong>driver</strong> errors to handle them accordingly. For example:
  <a href="http://nvidia.custhelp.com/app/answers/detail/a_id/3008/kw/your%20hardware%20configuration" rel="nofollow">http://nvidia.custhelp.com/app/answers/detail/a_id/3008/kw/your%20hardware%20configuration</a></p>
  
  <p>@Simon I'm aware of <code>glGetError(void)</code> function and I have it all over my code, but no error flag is set when driver sends its MB. </p>
  
  <p>@Colonel Thirty Two &amp; @Andon M. Coleman Thanks for an advice I also don't like <code>glGetError</code> spamming and I was't aware that there was such a convinet way to handle OpenGL errors ;)</p>