How is "Shared Memory Configuration Size" calculated?

In this post (Meaning of "Shared Memory Configuration Size"?), it said that Shared Memory Configuration Size is calculated by the driver. I’m using CUDA occupancy calculator to inspect my kernel occupancy and I found that the kernel occupancy is calculated based on this parameter. For my kernel, if I change the used dynamic shared memory size, sometimes the reported “Shared Memory Configuration Size” will also change. So how is this value calculated? Where can I get more information about the description of this parameter?

You can find a description for launch__shared_mem_config_size in the “Launch Metrics” sub-section under “Metrics Reference” in the Kernel Profiling Guide :: Nsight Compute Documentation.

Refer Programming Guide :: CUDA Toolkit Documentation and CUDA Runtime API :: CUDA Toolkit Documentation for more details.

Yes, I have seen the description in ncu GUI. But how is this value calculated? Is there any detailed formula?