Cuda错误CUDA_ERROR_NO_BINARY_FOR_GPU

时间:2013-03-02 00:02:40

标签: cuda ptx

我有一些无法加载的PTX代码。我在运行OSX的650M上运行它。其他CUDA示例在系统上运行正常,但在加载模块时我总是收到错误209:CUDA_ERROR_NO_BINARY_FOR_GPU

我错过了什么?

 .version 3.1
.target sm_20, texmode_independent
.address_size 64


    // .globl   examples_2E_mandelbrot_2F_calc_2D_mandelbrot_2D_ptx
.entry examples_2E_mandelbrot_2F_calc_2D_mandelbrot_2D_ptx(
    .param .u64 .ptr .global .align 8 examples_2E_mandelbrot_2F_calc_2D_mandelbrot_2D_ptx_param_0,
    .param .f64 examples_2E_mandelbrot_2F_calc_2D_mandelbrot_2D_ptx_param_1,
    .param .f64 examples_2E_mandelbrot_2F_calc_2D_mandelbrot_2D_ptx_param_2,
    .param .f64 examples_2E_mandelbrot_2F_calc_2D_mandelbrot_2D_ptx_param_3
)
{
    .reg .pred %p<396>;
    .reg .s16 %rc<396>;
    .reg .s16 %rs<396>;
    .reg .s32 %r<396>;
    .reg .s64 %rl<396>;
    .reg .f32 %f<396>;
    .reg .f64 %fl<396>;

    ld.param.u64    %rl0, [examples_2E_mandelbrot_2F_calc_2D_mandelbrot_2D_ptx_param_0];
    mov.b64 func_retval0, %rl0;
    ret;
}

2 个答案:

答案 0 :(得分:6)

您收到错误是因为您的PTX包含语法错误,因此永远不会编译。这条线

mov.b64 func_retval0, %rl0;

引用标签func_retval0,但在任何地方都没有在PTX文件中定义。您可以尝试使用工具链自行编译PTX来检查:

$ ptxas -arch=sm_20 own.ptx 
ptxas own.ptx, line 24; error   : Arguments mismatch for instruction 'mov'
ptxas own.ptx, line 24; error   : Unknown symbol 'func_retval0'
ptxas own.ptx, line 24; error   : Label expected for forward reference of 'func_retval0'
ptxas fatal   : Ptx assembly aborted due to errors

答案 1 :(得分:1)

关于运行ptxas的好建议。我得到错误209:问题结果是__shared__记忆被超额认购。以前这将是编译时的警告。我有Cuda 5.5并且现在没有编译警告 - 即使打开了详细信息。感谢