Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: How to reduce the read buffer time

  1. #11
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: How to reduce the read buffer time

    Is there any method to compare the execution time between GPU and CPU?
    I don't understand very well. There are two things you may want to measure in the CPU. One of them is "how much time does it take OpenCL to enqueue all these commands"; the other one is "how much time does it take since I enqueue the first command until the GPU has completely finished doing all the work and has written the image back".

    The first one, "how much it takes to enqueue these commands" doesn't matter. The second one measures the total amount of time that it takes to send all the data to the GPU, then run the kernel and then read it back to the CPU. The way to measure this one is simple: call GetTickCount() once before you submit the data to the GPU and call it again after clFinish(cqCommandQueue) returns.

    The command clBuildProgram() is taking so much time. Why it happens?
    clBuildProgram is the function that compiles your kernel into assembly for the GPU. It is true that it's usually slow (sometimes it takes seconds). The good thing is that you only need to call this function only one time. After the first time you can use clGetProgramInfo() to read back the GPU program after it is compiled. Look in the spec for CL_PROGRAM_BINARY_SIZES and CL_PROGRAM_BINARIES. Your application can then store the program binary into a file and the next time that you run the application you can use clCreateProgramWithBinary() instead of clCreateProgramWithSource(). When you create a program from a binary then clBuildProgram() is much faster.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

  2. #12

    Re: How to reduce the read buffer time

    I am facing a problem for a 10000 x 10000 image.

    While I am passing an 10000 x 10000 image on to the GPU for execution I am getting a problem: It is showing an error at line ____ (CL_PROFILING_INFO_NOT_AVAILABLE)

    The line number is where i am calling the event profiling of the NDrange event.

    My system monitor is getting completely black and after that windows is showing a warning that
    !!! Display driver NVIDIA windows kernel mode driver version 258.19 stopped responding and has sucessfully recovered !!!!

    After this message the command prompt is showing the above error.

    Why this happens? I previously faced the same problem while trying to pass a 7 x 7, 5 x 5, 9 x9 kernel also.

    Then also I used to get the warning message from windows.

  3. #13
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: How to reduce the read buffer time

    I would bet that your kernel is taking more than 5 seconds to run. AFAIK NVidia imposes a 5-second limit on kernels that run on the same GPU that is used to display the screen. Either you can buy a separate GPU to do OpenCL or you can divide your NDRange into several pieces.

    You can use the global_work_offset argument to clEnqueueNDRangeKernel() to process different parts of the image. For example, you can divide your 10000x10000 image into four 5000x5000 NDRanges.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

  4. #14
    Junior Member
    Join Date
    Dec 2010
    Posts
    18

    Re: How to reduce the read buffer time


Page 2 of 2 FirstFirst 12

Similar Threads

  1. Read GL depth buffer from OpenCL?
    By Dark Photon in forum OpenCL
    Replies: 2
    Last Post: 04-14-2011, 04:33 PM
  2. Only read specific chunks of a buffer
    By Moe in forum OpenCL
    Replies: 6
    Last Post: 11-19-2010, 05:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •