# NCU dynamic shared memory display question

**URL:** <https://forums.developer.nvidia.com/t/ncu-dynamic-shared-memory-display-question/286476>\
**Category:** Nsight Compute\
**Created:** [March 19, 2024, 2:11am UTC](https://forums.developer.nvidia.com/t/ncu-dynamic-shared-memory-display-question/286476 "2024-03-19T02:11:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![202476410arsmart](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@202476410arsmart](https://forums.developer.nvidia.com/u/202476410arsmart)\
**Post date:** [March 19, 2024, 2:11am UTC](https://forums.developer.nvidia.com/t/ncu-dynamic-shared-memory-display-question/286476/1 "2024-03-19T02:11:06Z")

</div>

![QQ浏览器截图20240319100548](https://global.discourse-cdn.com/nvidia/original/4X/2/9/d/29d65e8fc254f9ee2d9ba7786f2745a8ab384a7e.png)  
In my code, I uses:

```auto
cudaFuncSetAttribute(my_kernel,cudaFuncAttributeMaxDynamicSharedMemorySize, 100*1024);

```

Previously I believe block itself will uses 1KB shared memory, but here, why dynamic is 102?? And what is 135??!!

Thanks!!!

---

<div class="post-metadata">

**Author:** ![felix\_dt](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/felix_dt/32/14043_2.png) [@felix\_dt](https://forums.developer.nvidia.com/u/felix_dt)\
**Post date:** [April 3, 2024, 6:57am UTC](https://forums.developer.nvidia.com/t/ncu-dynamic-shared-memory-display-question/286476/2 "2024-04-03T06:57:21Z")

</div>

Nsight Compute [uses SI units for sizes](https://docs.nvidia.com/nsight-compute/NsightComputeCli/index.html?highlight=1000#metrics-and-units), i.e. multiples of 1000. This means that 100\*1024 / 1000 = 102.4.

The number set using `cudaFuncAttributeMaxDynamicSharedMemorySize` is not a fixed value that is guaranteed by the driver, it is rather _[requested](https://docs.nvidia.com/cuda/cuda-runtime-api/group __CUDART__ EXECUTION.html)_ by the client and the driver will select an appropriate actual value as close as possible that satisfies this request.

---

<div class="post-metadata">

**Author:** ![veraj](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/veraj/32/256893_2.png) [@veraj](https://forums.developer.nvidia.com/u/veraj)\
**Post date:** [April 24, 2024, 5:55am UTC](https://forums.developer.nvidia.com/t/ncu-dynamic-shared-memory-display-question/286476/3 "2024-04-24T05:55:29Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
