我如何禁用有关无法确定的堆栈大小的ptxas警告?

问题描述 投票:0回答:1

[编译CUDA设备代码时,您可能会收到错误(为了便于阅读,带有换行符:]

ptxas warning : Stack size for entry function '_ZN7kernels11print_stuffIiEEvv' 
cannot be statically determined

这可以有several reasons, like dynamic memory allocation or use of recursion,但现在这些都没有关系。我想至少在某些功能内禁用警告。问题是,我不知道该使用哪个令牌。搜索this list(在the suggestion here SO之前有关禁用特定警告)没有用-因为这些警告是NVCC的C / C ++前端而不是汇编程序中的警告。

所以可以我如何禁用此警告?

cuda compiler-warnings nvcc ptxas assembler-warnings
1个回答
1
投票

要注意的重点是,这是assembler警告,因此通常的前端警告抑制选项均不相关。

ptxas仅支持非常有限的警告控制选项。在CUDA 9之前,仅支持以下内容:

--suppress-double-demote-warning                    (-suppress-double-demote-warning)
        Suppress the warning that is otherwise emitted when a double precision instruction
        is encountered in PTX that is targeted for an SM version that does not have
        double precision support

--disable-warnings                                  (-w)                        
        Inhibit all warning messages.

--warn-on-double-precision-use                      (-warn-double-usage)        
        Warning if double(s) are used in an instruction.

--warn-on-local-memory-usage                        (-warn-lmem-usage)          
        Warning if local memory is used.

--warn-on-spills                                    (-warn-spills)              
        Warning if registers are spilled to local memory.

--warning-as-error                                  (-Werror)                   
        Make all warnings into errors.

在您的情况下,唯一的选择是禁止所有警告。将-Xptxas='-w'添加到任何nvcc调用中应该可以实现。

CUDA 9及更高版本添加了另一个选项ptxas,该选项禁止显示您询问的警告:

--suppress-stack-size-warning                       (-suppress-stack-size-warning)
        Suppress the warning that otherwise is printed when stack size cannot be
        determined.

在这种情况下,将-Xptxas='-suppress-stack-size-warning'添加到任何nvcc调用中应消除该警告。

© www.soinside.com 2019 - 2024. All rights reserved.