Optix7 SDK Application crashes when clicking the ShowDesktop icon

I have read the programming guide of Optix 7. Although still confused by the new APIs, I can hardly wait to try the new SDK examples.
However, different from the legacy version, the new optixWhitted application catches exceptions when I click the show desktop icon to hide the GLFWwindow. The GLFWwindow can not be minimized as well.

Here is the message

Caught exception: CUDA call (cudaGraphicsGLRegisterBuffer( &m_cuda_gfx_resource, m_pbo, cudaGraphicsMapFlagsWriteDiscard ) ) 
failed with error: 'out of memory' (C:\ProgramData\NVIDIA Corporation\OptiX SDK 7.0.0\SDK\sutil/CUDAOutputBuffer.h:184)

Applications with imGui such as optixPathTracer, suffer from the same problem. The bug do not affect performance of rayTracing, but sometimes really annoys developers.

Hi,

I have met this problem before, too. I think the reason is that the width and height are both zero when the application window is minimized, and thus something related to OpenGL is error (in CUDAOutputBuffer) and the application crashes.

What I have done is to limit the width and height of application window above one, it is simple but works.

Right, OpenGL interop buffers must not be zero size. Looks like that is not prevented in the CUDAOutputBuffer helper class.

I filed a bug report to fix the examples. Until that is available you should be able to prevent that error by enforcing a minimum width and height of 1 in the window resize handler like yetsun recommended.