cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Skysnake
Adept II

AccessViolationException only on APUs

Hi,

i have written a small OpenCL programm and give it to some people. From one person i get the following responce:

Unhandled exception: System.AccessViolationException: it was tried to read or write in saved memory. This is often a hint that other memory is damaged.

     at clEnqueueWriteBuffeR(_cl_command_queue*, _cl_mem*. UInt32, UInt32, UInt32, Void*, UInt32, _cl_event**, _cl_event**)

     at filldevicebuffer(Int32 select)

     at main(Int32 argc, SByte** argv)

     at _mainCRTStartup()

I dont really know what could be the problem, because it runs wihtout any problems on my System with a 5870 and a 7970.

0 Likes
9 Replies
notzed
Challenger

It just means you have a bug in your code.

GPUs don't do as much checking as CPUs and in any event their memory is separate so cannot interfere with the cpu.  Different hardware/different drivers may react differently to your software bugs.

0 Likes

I know, that there is a bug, but it shows only with an APU, so it is not really easy to find the reason. I think you know how difficult it is to find the reason for bugs that shows only sometimes.

I have doublechecked my code and see no reason why this should happen, and without a debugging possibility on a APU, it is hard to say for me, whats the reason.

So i hope, that it is something "trivial", that happens often with APUs, because APUs are "different" to CPU+normal GPU.

0 Likes

Well, it works like this:

Keep trying till you fix it.

There's no 'easy way'.   It might get easier with experience but even after 20 years of hacking this is the *only* answer to *every* debugging problem.

Just because you can't see a bug, it doesn't mean it isn't there - and the crash shows there is a bug.

An APU is just like a CPU or GPU.  If your code is correct it should work - what happens with buggy code is 'undefined': i.e. it cannot be quantified.  It's your code, nobody else has seen it, nobody else can help you debug it.

0 Likes

Yeah, but are there any special APU things?

I use OpenGL and OpenCL. could it be, that there is a dll problem?

0 Likes

0 Likes

yes?

0 Likes
Wenju
Elite

Hi Skysnake,

After you create a OpenCL object,such as cl_context ,cl_command_queue, you'd better check it,If the object is NULL,you should show some message,Then maybe you can know what's cause the error.

Thanks

0 Likes

Yeah thanks, i will have to do this, but atm i have absolutly no time for this

0 Likes

Hi Skysnake,

Do you have a try? How about your problem, solved or not?

Thank you.

0 Likes