I have the SDK 2.0 installed on a Windows 7 machine and running a program compiled in Visual Studio 2008. I've run into a problem where I run the application and get a popup dialog with a message 'This application has requested the Runtime to terminate it in an unusual way. Please contact the support team for more information.'
If I run the program using the Visual Studio debugger, the debugger does not get control even if I tell it to break on all exceptions. Is there some way to get the debugger to get control in this case?
I think I did figure out why the program is doing this for this particular problem. I set breakpoints on calls to clCreateBuffer.
I allocated 0x03000000, 0x01800000, 0x03000000, 0x01800000 bytes, in that order. At the second allocation of 0x01800000 bytes, I got the crash.
If I allocate smaller blocks of memory in the same sequence I don't get a crash.
I have a 4650 GPU with 512MB memory, so the second allocation of 0x01800000 bytes exceeds the capacity of the card.
Shouldn't the OpenCL runtime return CL_OUT_OF_HOST_MEMORY in this case rather than crashing the program?