在 CUDA 中每个网格(x 维度)启动超过 65536 个块
launch more than 65536 blocks per grid (x dimension) in CUDA
我有一个 CUDA 代码,我要从 visual studio 中的 mex 文件启动。我只在 x 维度上启动块,但如果我尝试启动超过 65536 个块,就会出现错误,尽管我的计算能力是 6.1(根据系统信息下的 GPU 设备选项卡)。
同样在系统信息下,它显示 MAX_GRID_DIM_X 是 2147483647。在启动这么多块之前,是否需要更改某些设置或环境变量?还有哪些其他因素可能会限制我可以启动的区块数量?
Is there some setting or environmental variable I need to change before I can launch this many blocks?
没有
What other things might be limiting the number of blocks I can launch?
编译设置。您必须选择支持 2^31-1 的目标编译架构。在 CUDA 9 上,默认的编译架构是 3.0,它支持扩展的一维网格大小。在较旧的工具包上,默认值为 2.0 或更早版本,而这些不是。
我有一个 CUDA 代码,我要从 visual studio 中的 mex 文件启动。我只在 x 维度上启动块,但如果我尝试启动超过 65536 个块,就会出现错误,尽管我的计算能力是 6.1(根据系统信息下的 GPU 设备选项卡)。 同样在系统信息下,它显示 MAX_GRID_DIM_X 是 2147483647。在启动这么多块之前,是否需要更改某些设置或环境变量?还有哪些其他因素可能会限制我可以启动的区块数量?
Is there some setting or environmental variable I need to change before I can launch this many blocks?
没有
What other things might be limiting the number of blocks I can launch?
编译设置。您必须选择支持 2^31-1 的目标编译架构。在 CUDA 9 上,默认的编译架构是 3.0,它支持扩展的一维网格大小。在较旧的工具包上,默认值为 2.0 或更早版本,而这些不是。