Interpretation of “too many resources for launch”

后端 未结 1 1616
死守一世寂寞
死守一世寂寞 2021-01-21 18:26

Consider the following Python code:

from numpy import float64
from pycuda import compiler, gpuarray
import pycuda.autoinit

# N > 960 is crucial!
N = 961
code         


        
相关标签:
1条回答
  • 2021-01-21 19:27

    It is almost certain that you are hitting a registers-per-block limit.

    Reading the relevant documentation, your device has a limit of 32k 32 bit registers per block. When the block size is larger than 960 threads (30 warps), your kernel launch requires too many registers and the launch fails. NVIDIA supply an excel spreadsheet and advice on how to determine the per thread the register requirement of your kernel and the limiting block sizes you can use for your kernel to launch on your device.

    0 讨论(0)
提交回复
热议问题