Skip to content

Commit 5011090

Browse files
committed
Respect kernel launch shared memory usage
1 parent fdd7d53 commit 5011090

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

driverapi/src/cmdqueue.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ NvCommandQueue::launchFunction(LibreCUFunction function,
568568
// check launch dimensions
569569
NvU32 max_threads = ((65536 / roundUp(maxOf(1u, function->num_registers) * 32, 256u)) / 4) * 4 * 32;
570570

571-
uint32_t shmem_usage = function->shared_mem;
571+
uint32_t shmem_usage = maxOf(function->shared_mem, sharedMemBytes);
572572

573573
NvU32 blockProd = blockDimX * blockDimY * blockDimZ;
574574
if ((shmem_usage > sharedMemBytes) && (blockProd > 1024 || max_threads < blockProd)) {

0 commit comments

Comments
 (0)