6 Replies Latest reply on Mar 6, 2010 9:53 AM by Raistmer

    Stream Write : Failed to Initiate DMA

    Raistmer
      what typical reasons for this error?

      subj.
        • Stream Write : Failed to Initiate DMA
          gaurav.garg

          Are you using multiple threads in your application?

          • Stream Write : Failed to Initiate DMA
            Raistmer
            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.
              • Stream Write : Failed to Initiate DMA
                gaurav.garg

                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.

              • Stream Write : Failed to Initiate DMA
                Raistmer
                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.
                  • Stream Write : Failed to Initiate DMA
                    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?

                      • Stream Write : Failed to Initiate DMA
                        Raistmer
                        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.