# Need advice - low perfomance

**URL:** <https://forums.developer.nvidia.com/t/need-advice-low-perfomance/13830>\
**Category:** CUDA Programming and Performance\
**Created:** [December 16, 2009, 12:41pm UTC](https://forums.developer.nvidia.com/t/need-advice-low-perfomance/13830 "2009-12-16T12:41:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Noname01](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Noname01](https://forums.developer.nvidia.com/u/Noname01)\
**Post date:** [December 16, 2009, 12:41pm UTC](https://forums.developer.nvidia.com/t/need-advice-low-perfomance/13830/1 "2009-12-16T12:41:52Z")

</div>

Hello, need some help in learning CUDA.

Task: adding two float arrays  
GPU: tesla c1060

kernel calculating time for 100M arrays: 15ms, equal 6,67 GigaFLOPS while peak permonace must be ~900 GigaFLOPS  
theoretical videomemory bandwith(102 GB\sec) must not limit it. Why perfomance can be so low?

Using pagelocked memory and async memory copying.

thank you

---

<div class="post-metadata">

**Author:** ![asm](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@asm](https://forums.developer.nvidia.com/u/asm)\
**Post date:** [December 16, 2009, 6:47pm UTC](https://forums.developer.nvidia.com/t/need-advice-low-perfomance/13830/2 "2009-12-16T18:47:44Z")

</div>

looks like your kernel is memory-bound

I think you can try using less # of threads per block: say, 64 instead of 512  
because your threads need not to work cooperatively inside a block

also try computing several sums per one thread (say 4 sums),  
to take advantage of overlapping memory access with ALUs

and zero-copies instead of streams (easier to handle)

---

<div class="post-metadata">

**Author:** ![Noname01](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Noname01](https://forums.developer.nvidia.com/u/Noname01)\
**Post date:** [December 17, 2009, 3:04pm UTC](https://forums.developer.nvidia.com/t/need-advice-low-perfomance/13830/3 "2009-12-17T15:04:55Z")

</div>

> [@](#):
>
> looks like your kernel is memory-bound
> 
> I think you can try using less # of threads per block: say, 64 instead of 512
> 
> because your threads need not to work cooperatively inside a block
> 
> also try computing several sums per one thread (say 4 sums),
> 
> to take advantage of overlapping memory access with ALUs

tried it, but it did not help much

> [@](#):
>
> and zero-copies instead of streams (easier to handle)

as i understan, it is direct access to usual memory via cudaHostGetDevicePointer?

it is also working slower than usual copying from pagelocked memory

---

<div class="post-metadata">

**Author:** ![Tigga](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Tigga](https://forums.developer.nvidia.com/u/Tigga)\
**Post date:** [December 17, 2009, 4:18pm UTC](https://forums.developer.nvidia.com/t/need-advice-low-perfomance/13830/4 "2009-12-17T16:18:20Z")

</div>

That code block is far too big for me to read right now.

With the numbers you quoted you’re on 80GB/s memory bandwidth. You’re memory bound. I’ve found it’s fairly hard to push too much beyond 80-85GB/s on a C1060.

Pinned memory and streams won’t help your kernel execution time at all. Streams might even slow it down. They’ll only change overally run time.

---

<div class="post-metadata">

**Author:** ![Noname01](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Noname01](https://forums.developer.nvidia.com/u/Noname01)\
**Post date:** [December 18, 2009, 8:19pm UTC](https://forums.developer.nvidia.com/t/need-advice-low-perfomance/13830/5 "2009-12-18T20:19:51Z")

</div>

> [@](#):
>
> That code block is far too big for me to read right now.
> 
> With the numbers you quoted you’re on 80GB/s memory bandwidth. You’re memory bound. I’ve found it’s fairly hard to push too much beyond 80-85GB/s on a C1060.
> 
> Pinned memory and streams won’t help your kernel execution time at all. Streams might even slow it down. They’ll only change overally run time.

Thank you for information.

as about streams - i am using them for concurrent copying and kernels executing - ‘CUDA best practice guide’ thinks that it can increase overall perfomance )
