1

Today I have figured out something that really made me wondering. I have the Samsung Exynos 4412 ARM9 CPU which has a GPU400(QuadCore). I tried to get a texture from the GPU to CPU by all known methods and its really slow. The same scenario and slow speed happens also in modern CPUs and GPUs in the PC Platform. My wondering is how that happens and the Samsung Exynos is an SoC and both of them has the same memory and I should not care about the bus. Why that happens ?

The data from the GPU to the CPU is transferred by many methods which I have tried glReadpixels, gltexSubImage2D, gltexImage2d, FBO. The frame rate drops from 40FPS to 7FPs or 7FPS while using any of those methods, on a texture 1024*1024 24bits.

andre_lamothe
  • 2,171
  • 2
  • 41
  • 74
  • possible duplicate of [copy from GPU to CPU is slower than copying CPU to GPU](http://stackoverflow.com/questions/13341295/copy-from-gpu-to-cpu-is-slower-than-copying-cpu-to-gpu) – Zan Lynx Feb 21 '13 at 18:43
  • @ZanLynx The GPU I have has no CUDA or OpenCL – andre_lamothe Feb 21 '13 at 18:45
  • Could you define *slow* in ms or in some other value? Also provide more information how you transferring the data. – Kimi Feb 21 '13 at 18:45
  • Also duplicate of http://stackoverflow.com/questions/13032554/cpu-gpu-transfer-vs-gpu-cpu-transfer?rq=1 – Zan Lynx Feb 21 '13 at 18:45
  • And note that in that other question his real problem was his code was measuring the wrong thing. Showing your code might help get an answer. – Zan Lynx Feb 21 '13 at 18:46
  • @Zan: It's not a dupe. This one concerns particular hardware, and doesn't mention transfers in the other direction at all. – Ben Voigt Feb 21 '13 at 18:47
  • @BenVoigt: No it doesn't concern particular hardware. He says "also in modern CPUs and GPUs on PC platform" – Zan Lynx Feb 21 '13 at 18:48
  • @BenVoigt I have updated the transfer method – andre_lamothe Feb 21 '13 at 18:48

1 Answers1

2

Possible answers taken from the OpenGL forums:

  • Latency: it takes time for the read command to reach the hardware.
  • OpenGL command buffering: Reading the data requires the OpenGL driver to complete all outstanding commands.
  • Hardware buffering: Hardware must empty all GPU core pipelines before doing a readback.

Possible solution: - Copy the data internally on the GPU to another location and read it back some number of frames after computing it. This should allow everything writing to that location to have completed before you attempt to read it.

Zan Lynx
  • 53,022
  • 10
  • 79
  • 131