Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Adept I

OpenCl Sample in visual studio 10 throwing exception: heap corrupted

I've a computer with intel i5 and ATI 7670M gpu. I am trying to run the samples supplied with APP-SDK-2.8. In win32 configuration firstly vs10 is throwing

Windows has triggered a breakpoint in opcl_test.exe.

This may be due to a corruption of the heap, which indicates a bug in opcl_test.exe or any of the DLLs it has loaded.

This may also be due to the user pressing F12 while opcl_test.exe has focus.

The output window may have more diagnostic information.

If I continue it keeps on throwing Unhandled exception at 0x775740f2 in opcl_test.exe: 0xC0000374: A heap has been corrupted.

But in x64 configuration all the things are happening same but the programm is running after a few exception. What is the cause of the problem and how to fix it?

Note: I am using windows 7(64bit)

8 Replies
Adept II

I have a similar setup with me. Will check and see if I can repro.

Adept II


I tried a few samples (32-bit) from 2.8 on Win7 64-bit machine. They all work like a charm.

The GPU I used is AMD 6950 (Cayman) though.

Can you please give the following information?

1. Which APP SDK sample is giving this problem?

2. AMD Catalyst Driver version that you are using.

3. Does any other OpenCL program run on this machine? Have you tried making a hello world OpenCL program that runs?

Best Regards,

WorkItem 6


1)I'm using APP SDK-2.8, 2) Advanced Micro Devices 8.933.0.0 Driver,

3) The same thing is happening with every opencl program. Actually in

x64 configuration the program is running but a few heap corruption

exception is being thrown after the first message (mentioned above).

But in win32 configuration the program is throwing infinite heap

corrupted exception

Adept I

I think I've figured out the problem. An analogues problem and solution can be found here

Now my question is how can i set the default calling convention of visual studio 10 to __stdcl or what dlls are to be defined?


Are you able to fix your problem, using the link you provided above.

If not, can you try installing the latest driver from AMD website. Does version 8.933.0.0 same as catalyst 12.10? Not sure.

EDIT: Please give information about what visual studio you have installed. And some steps to reproduce your problem. Can you run clinfo on your setup?

Message was edited by: Himanshu Gautam


I believe 9.0.x.x is the latest driver - the one that corresponds to Cat 12.10

Journeyman III


I have the same heap problem and can still not solve it.

I'm using win7 64x - Sapphire AMD Radeon 7850

I have installed Catalyst 13.9 and the AMD_APP_SDK 2.8.1.

I'm testing following code from Kode-Stuff: Setting up OpenCL in Visual Studio:

#include <CL/cl.h>

int main(int argc, char **argv){

   cl_platform_id test;

   cl_uint num;

   cl_uint ok = 1;

   clGetPlatformIDs(ok, &test, &num);

   return 0;


Normal c++ code works fine.


I think i solved the problem.

My Intel GPU on the Core was the problem.

Updating the drivers or deinstall helps.

Deactivating the graficcard doesn't solve the problem. May god know why.