代码之家  ›  专栏  ›  技术社区  ›  Timothy Baldridge

Cuda错误Cuda_error_NO_BINARY_FOR_GPU

  •  4
  • Timothy Baldridge  · 技术社区  · 12 年前

    我有一些无法加载的PTX代码。我在一台650M的OSX上运行这个。其他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 回复  |  直到 12 年前
        1
  •  6
  •   talonmies    12 年前

    您收到错误是因为您的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
    
        2
  •  1
  •   talonmies    11 年前

    关于运行ptxas的好建议。我收到错误209:问题是__shared__内存被超额订阅。过去,这将是编译时的一个警告。我有Cuda 5.5,现在编译时没有任何警告——即使打开了verbose。谢谢