title: Crash at draw call in nvoglv32.dll on new video card
body: <p>Some days ago I set up my computer and installed a new copy of Windows 8 because of some hardware changes. Among others I changed the video card from Radeon HD 7870 to Nvidia GTX 660.</p>
  
  <p>After setting up Visual Studio 11 again, I downloaded my last OpenGL project from Github and rebuilt the whole project. I ran the application out of Visual Studio and it crashed because of <code>nvoglv32.dll</code>.</p>
  
  <blockquote>
    <p>Unhandled exception at 0x5D9F74E3 (nvoglv32.dll) in Application.exe: 0xC0000005: Access violation reading location 0x00000000.</p>
  </blockquote>
  
  <p>In the old environment the application worked as expected. I didn't changed anything of the project or source code. The only difference was the language of the Visual Studio installtion which is English now and was German before. Therefore I created a new project and adopted all settings, but the error remains.</p>
  
  <p>In order to locate the crash, I noticed that all initialization (window, shaders, ...) succeeded and the error is at the draw call <code>glDrawElements()</code> which referrs to the gemoetry pass of my deferred renderer.</p>
  
  <p>After some reseach I found out that <code>nvoglv32.dll</code> is from Nvidia and is about a services called <code>Compatible OpenGL ICD</code>. Does that somehow mean that my application runs in a compatible mode? That sounds like a mode to support older applications and I want mine to run in a regular mode! By the way I installed the lastest stable drivers for my video card.</p>
  
  <p>To be honest, I have no clue how to approach fixing this crash. What could cause it and how to fix it?</p>
  
  <p>Update: I found a <a href="https://forums.geforce.com/default/topic/481890/?comment=3456330" rel="nofollow">post on Geforce Forums</a> about my issue. Although there was no reply, the autor could fix the problem by changing the order of two OpenGL calls.</p>
  
  <blockquote>
    <p>Hi all,</p>
    
    <p>After poking around with my application source code for a few hours, I found that calling the functions...</p>
  
  <pre><code>glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, #)
  glBindVertexArray(#)
  </code></pre>
    
    <p>...in that order causes the crash in nvoglv64.dll.
    Reversing the order of these calls to...</p>
  
  <pre><code>glBindVertexArray(#)
  glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, #)
  </code></pre>
    
    <p>...prevents the crash and appears to be well-behaved.</p>
    
    <p>Cheers,
    Robert Graf</p>
  </blockquote>
  
  <p>Since I do not use vertex arrays I cannot simple do this fix but there might be a similar issue. I will report my progress.</p>
  
  <p>Update: I have absolutely no clue how to solve my problem. I tried different video driver versions but it makes no difference. I completely rewrote the renderer using minimal shaders and simple forward rendering. But the crash sill occurs at the first draw call.</p>