2 Replies Latest reply on Apr 30, 2013 7:16 AM by Biaowang

    Bugs of linux APU driver?

    Biaowang

      Hi all:

      I run my OpenCL code to process some videos frames, so I created a buffer up to 8M on the GPU. However, when I allocate buffer with  clCreateBuffer it report me that the  error CL_INVALID_BUFFER_SIZE, so I dig into the error, find out that only two case will lead to this error according to OpenCL Spec

      "

      CL_INVALID_BUFFER_SIZE if size is 0 or is greater than CL_DEVICE_MAX_MEM_ALLOC_SIZE value specified in table of OpenCL Device Queries for clGetDeviceInfo for all devices in context.

      "

      To check how much the CL_DEVICE_MAX_MEM_ALLOC_SIZE is I call the clGetDeviceInfo and get the value

      CL_DEVICE_MAX_MEM_ALLOC_SIZE is 128*1024*1024 which is consistent to the description of CL_DEVICE_MAX_MEM_ALLOC_SIZE in OpenCL spec:

      "

      CL_DEVICE_MAX_MEM_ALLOC_SIZE

      Return type: cl_ulong

      Max size of memory object allocation in bytes. The minimum value is max (1/4th of CL_DEVICE_GLOBAL_MEM_SIZE, 128*1024*1024)


      "

      So my question is the size I allocated for GPU is definitely smaller than CL_DEVICE_MAX_MEM_ALLOC_SIZE and bigger than zero, why the API complain to a right size.

      My GPU is integrated with CPU (A6-4455M APU), kubuntu 12.10, the latest catalyst driver for linux

      the Interesting point is that I port my code to windows+MingW, then it works, so I suspect there is a bug for OpenCL linux catalyst driver

        • Re: Bugs of linux APU driver?
          himanshu.gautam

          Can you post your source code? What are the flags you are using along with clCreateBuffer() ?

            • Re: Bugs of linux APU driver?
              Biaowang

              my source code is :clCreateBuffer(GPUcontext, CL_MEM_READ_ONLY, size, NULL, &err)

              However I have verified that the code run under windows but fail under linux because the CL_DEVICE_MAX_MEM_ALLOC_SIZE under this two are different. They are 192*1020*1024 bytes and 128*1024*1024 under window and linux, respectively, while my buffer size is in between, i.e 128*1024*1024<bufsize<192*1020*1024.

              so it fails under linux but  run through on windows.

              but this folks another question, why under windows the CL_DEVICE_MAX_MEM_ALLOC_SIZE is 192*1020*1024, that is neither 1/4 of CL_DEVICE_GLOBAL_MEM_SIZE(in my case CL_DEVICE_GLOBAL_MEM_SIZE is 512*1024*1024) nor 128*1024*1024, according to specification.

              Could AMD windows developers give a reason?