6 Replies Latest reply on May 21, 2008 6:38 AM by michael.chu

    brcc.exe crashes

    miodrag.r
      brcc bugs

      Hi,

      First of all, I would like to say that I am glad that AMD made this SDK public for beta testing, and that AMD is putting a lot of effort to improve it.

      Here are few bugs in brcc.exe that I run across while I was trying to port some of my faculty projects to run on my Radeon 3850 GPU.

      Following code causes brcc to crush:
      kernel void gather_res(float res[], float selectedV[], out float elem<>){
      elem= res[selectedV[1]];
      }
      While the following code compiles without any problem:
      kernel void gather_res(float res[], float selectedV[], out float elem<>){
      float selected=selectedV[1];
      elem= res[selected];
      }

      Here I would like to ask, is there any other way to pass a single float value which resigns in GPU's memory to a kernel?

      Also, omitting the type of an output stream causes brcc to crash, instead of generating error report:
      kernel void test(float str<>, out newStr<>){
      newStr=str;
      }

      There is also a bug that allows me to specify more than one argument for normalize function, while the code compiles without any error report, the program doesn't run correctly:
      out = normalize(in,0,1); //I have changed clamp to normalize and forgot to remove arguments

      I hope these examples will help you locate and correct those bugs.
      At the end, I would like to note that it would be nice if I could also utilize Mobility Radeon HD2600 in my laptop with some future release of the SDK.

      Best regards,
      Miodrag

        • brcc.exe crashes
          MicahVillmow
          miodrag.r,
          If you want to send in a single floating point value, please check out the constant example in the sample/tests folder. As for the Radeon HD2600, many great features that brook supports such as scatter, integer, and double do not exist on this card, otherwise, although it is not our recommended platform, it should work.
            • brcc.exe crashes
              miodrag.r
              Micah,
              Thanks for the hint, but that's not what I need. I need to use float value that was produced by some kernel as a parameter in other kernel. Here is a simple example what I am doing now:

              kernel void invertVal(float stream<>, float param[], out stream outStream<>){
              outStream=(stream==param[1])? -stream : stream;
              }

              Is that the way it's meant to be done?

              As for the 2600, I must stress that I have Mobility Radeon HD2600 in Toshiba Satellite A210-16F laptop. I had tried to run sample applications on it, but non will start. Each example returns -1 error code upon the start, without any error message. New Folding@Home GPU2 client also cannot be started on this chip. So is there any official information concerning CAL support for mobile chips? If they are not supported at the moment, is the support for them going to be added soon?

              Best regards,
              Miodrag

            • brcc.exe crashes
              MicahVillmow
              miodrag.r:
              Is the float value that you are producing is a scalar, then you can treat it as a constant in the second kernel call and use it as an output parameter in the first kernel call.

              For example if you want to normalize a stream, you need to first sum all the values in the stream
              reduce sum(out float a, float b<>)
              {
              a+=b;
              }

              kernel normalize(float sum, out float norm_val<>, float val<>)
              {
              norm_val = val / sum;
              }

              And then in the main function you would call it as:


              sum(a, b_stream);
              normalize(a, c_stream, b_stream);

              The first kernel would place the value that is calculated in the scalar output a, the value would then be used as a constant input to the second kernel.

              Also, on another note, gather/scatter instructions start indexing at 0.
                • brcc.exe crashes
                  miodrag.r
                  Micah,

                  I tried to compile example you gave me, and it crashed brcc. The thing is that you forgot to put void as return type of the kernels, so that's one more bug to fix.

                  But when I corrected the code and managed to compile it, it didn't run correctly. Here is my code:

                  reduce void sum(reduce float a, float b<>)
                  {
                  a+=b;
                  }

                  kernel void normalize(float sum, out float norm_val<>, float val<>)
                  {
                  norm_val = val / sum;
                  }

                  void printA(float *a, int sz){
                  int i;
                  for(i=0; i<sz; i++)
                  printf("%f\t",a_of_i );

                  printf("\n");
                  }

                  void main(){
                  float *a;
                  float ss;
                  int i;

                  float sa<SIZE> ;
                  float sb<SIZE> ;

                  a= (float *)malloc(SIZE * sizeof(float));
                  for(i=0; i<SIZE; i++)
                  a_of_i=i+1;

                  printA(a, SIZE);
                  ss=0;
                  streamRead(sa, a);
                  sum(ss, sa);
                  normalize(ss, sb, sa);

                  streamWrite(sb, a);
                  printf("sum=%f\n",ss);
                  printA(a, SIZE);

                  free(a);
                  }

                  This is what I get on the output:

                  1.000000 2.000000 3.000000 4.000000 5.000000
                  6.000000 7.000000 8.000000 9.000000 10.000000

                  sum=-1.#IND00
                  -1.#IND00 -1.#IND00 -1.#IND00 -1.#IND00 -1.#IND00
                  -1.#IND00 -1.#IND00 -1.#IND00 -1.#IND00 -1.#IND00

                  Is there something that I am doing wrong?

                  Best regards,
                  Miodrag