cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Raistmer
Adept II

Stream Write : Failed to Initiate DMA

what typical reasons for this error?

subj.
0 Likes
6 Replies
gaurav_garg
Adept I

Are you using multiple threads in your application?

0 Likes
Raistmer
Adept II

Single thread but both libraries (OpenCL and Brook+ ) are used.
It works OK when no async writes, but with async write in Brook I get that error.
0 Likes

Streamwrite async calls create a seperate thread for data transfer and calmemcpy is called in this thread. calmemcpy is not thread safe if it is used with the same context in multiple threads.

How manny times do you call streamWrite with async option in your application? There was a bug in Brook+ 1.4.1 that caused this error with multiple async streamwrites. The fix was committed in sourceforge but, the Brook+ library was not updated.You can try to compile the latest code.

Another workaround for this is that you can call stream.finish() method to make sure prevoius streamwrite is finished before invoking another streamwrite.

0 Likes
Raistmer
Adept II

Well, by brook-only code worked well before OpenCL addition.
There are many async write calls but I never called next one before first is finished.
I looks like:
column.write(temp,"async");
while(!column.isSync())Sleep(0);

When I chenged to
column.write(temp);
while(!column.isSync())Sleep(0);

error disappeared.
0 Likes

Looks like an interoperability issue that is reprducible if we run calmemcpy in a different thread.

Can you post a simple test case?

0 Likes

Originally posted by: gaurav.garg

Looks like an interoperability issue that is reprducible if we run calmemcpy in a different thread.




Can you post a simple test case?



I'm afraid no. It's rather big app, I already tried to send it re: memory leak issue but... nothing good in the end

Async writes not actually needed here, it was just leftover from times when I tried to save CPU cycles on GPU waiting by releasing CPU via Sleep() call.
It's useful only for really long kernel call, this particular data transfer not long enough so sync write can go.

But will keep in mind that Brook update required to use async writes in future.
0 Likes