Help! cuda device API

Hi,everyone ,cuCtxCreate failed when execute program,why?

   CUDEV_SAFE_CALL(cuInit(0));

    CUDEV_SAFE_CALL(cuDeviceGet(&dev,0));

    CUDEV_SAFE_CALL(cuCtxCreate(&ctx,0,dev));

My card is 8800GTS.

By the way,As Supported sm_11 by GTS?

thanks!

8800 GTS is sm_10.

What is error code for failing function call?

x.bmp (366 KB)

Do you know the difference between error message and return code?

Remove CUDEV_SAFE_CALL() macro and do error checking manually and print function result if it’s not equal to CUDA_SUCCEESS.

it return 999:CUDA_ERROR_UNKNOW
My driver is the newest version :169.09 forceware :(

I used VC++6.0

That`s ok! I changed the driver to 163.75 :haha:
Thanks for AndreiB!

Are you using CUDA 1.0?

Yes.It seems that cann`t to use CUDA 1.1,the kernels not be compiled wrote previous by the nvcc 1.1 but 1.0,i execute the program used CUDA 1.0 and used the driver 169.09 which released togther witch CUDA 1.1 before as.so I think it not support for CUDA 1.0 by the 169.* drivers

It’s strange that you can’t compile your kernels with 1.1. You definitely should be able to do it. One thing you should know about is that they’ve changed name mangling in 1.1, so you need to specify extern “C” with each global function. Otherwise you won’t be able to get function by name (or you have to use mangled name).

And yes, there is some bug with new drivers… 169.09 won’t work with CUDA 1.0. I wrote about this few days ago. But in my case cuIniut() returned error, not cuCtxCreate().

Oh,thanks very much is it as this:

extern “C” global void kernelEntry(…){…}?

driver 163.75 is good for CUDA 1.0 but 1.1,I had the same problem when used old drivers before 163.75 and 169.09.

Yes, extern “C” global void kernelEntry(…){…}