0 Replies Latest reply on Dec 15, 2008 7:18 AM by jean-claude

    Blue Screen after multiloop kernel run

    jean-claude
      Follow up

      Hi, after some more investigations, this is a small code that illustrates the issue: aftercompleting  a few loops (around 150-200) the GPU doesn't return control to the CPU and the system crashes after a few minutes.

      You'll notice that the kernel is really basic, as well as the exercice loop.

      I suspect some issue with memory management in CAL/driver...

      Am I the only one seeing this happening? I can't believe!

      Thanks for support.

      Jean-Claude


      // Test_GPU_1.cpp
      // Generates blue-screen/atikmdag error on Vista 32
      // by: jean-claude

      #include "stdafx.h" 
      #include "brook/Stream.h"
      #include "brook/kernels.h"

      brook::Stream<int3> *stream_A;
      brook::Stream<int3> *stream_B;
      int *i_buffer; 
      int *o_buffer; 

      void create_streams_and_buffers( void ) {
          int h = 720;
          int w = 576;   
          unsigned int dims[2] = { h, w };       
          stream_A = new brook::Stream<int3>(2,dims);
          stream_B = new brook::Stream<int3>(2,dims);
          i_buffer = (int *) malloc(h*w*3*sizeof(int));
          o_buffer = (int *) malloc(h*w*3*sizeof(int));
      }

      void free_streams_and_buffers( void ) {
          free(i_buffer);
          free(o_buffer);
          free(stream_A);
          free(stream_B);
      }

      // Test prog
      int _tmain(int argc, _TCHAR* argv[]) {

          create_streams_and_buffers();

          // here we go : test loop
          // ----------------------------
          int number_of_loops = 1000; // crashes or not depending on this value!!!
          for (int i=0; i<number_of_loops; i++) {
              stream_A->read(i_buffer);
              kern_copy(*stream_A, *stream_B);
              stream_B->write(o_buffer);
          }

          free_streams_and_buffers();

          return 0;
      }


      kernel void kern_copy( int3 A<> , out int3 B<> ) {
          B = A;
      }