Query buffers crash after driver version 536.23

In the driver after version 536.23 a regression was introduced that causes query buffers to crash semi-randomly. The more frequently they are used the sooner it crashes, with heavy use it crashes almost immediately.
All versions of glGetQueryBufferObject and glBindBuffer(GL_QUERY_BUFFER) + glGetQueryObject are affected.
There is no error or debug message generated when this happens, however if GL_RESET_NOTIFICATION_STRATEGY_ARB is set to GL_LOSE_CONTEXT_ON_RESET then glGetGraphicsResetStatus returns GL_UNKNOWN_CONTEXT_RESET.
Changing query type (GL_SAMPLES_PASSED, GL_ANY_SAMPLES_PASSED, GL_TIME_ELAPSED…) does not stop the crash from happening.
Changing how the buffer was created (size, flags, glBufferStorage vs glBufferData…) does not stop the crash from happening.

Every time this happens there are multiple events in the Event Viewer:

  • there is always a warning event saying that “Display driver nvlddmkm stopped responding and has successfully recovered.”.
  • there are one or more error events with varying errors. These are some of the errors I’ve seen:
    Error occurred on GPUID: 100
    Graphics Exception: ESR 0x404600=0x80000001
    Graphics Exception: EXTRA_INLINE_DATA
    Graphics Exception: ESR 0x405848=0x80000000
    Graphics Exception: ESR 0x405840=0xa0040a06
    Graphics Exception: Shader Program Header 18 Error
    Graphics Exception: Shader Program Header 1 Error

It happens on every PC I’ve tried it on (tested on GPUs: 1070, 1080Ti, 2080, 4090 and CPUs: Intel 7700k, AMD 5950x, AMD 7950x).

Every driver after 536.23 is affected, up to and including 545.84. In versions before 545.84 swapping nvoglv64.dll with the one from 536.23 would fix the crash but in 545.84 there are other changes which stop this from working.

It’s actually very easy to reproduce. This crashes the driver:

GLuint QueryGl;
GLuint BufferGl;

glCreateQueries(GL_TIME_ELAPSED, 1, &QueryGl);
glCreateBuffers(1, &BufferGl);
glNamedBufferStorage(BufferGl, 256, nullptr, 0);

for (int i = 0; i < 100000; ++i)
{
	glBeginQuery(GL_TIME_ELAPSED, QueryGl);
	glEndQuery(GL_TIME_ELAPSED);
	glGetQueryBufferObjectiv(QueryGl, BufferGl, GL_QUERY_RESULT, 0);
}

Hi there @Novanta, welcome to the NVIDIA developer forums!

Thank you for reporting this issue!

Can you please add on which operating system you encountered that? I need to provide that bit of information on internal bug filings.

If we need more details after that, we will get back to you.

Thanks!

Windows 11

Thank you! Hopefully I will get feedback soon.

Looks like it was fixed in 546.29.
Thanks.