我有一些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;
}
nvcc -arch=sm_30 -ptx mymodule.cu
编译一些代码,并分析它们之间的差异来创建类似的东西。如果在.entry
之前添加.visible
,例如:.visible .entry examples_2E_mandelbrot...
会发生什么呢?我认为你需要添加.target sm_30
。 - Robert Crovella