I have wrote a program in CUDA which will be executing on GPU (nvidia geforce 310m). In kernel I've used atomicMin function. After compiling and running I have got an error: "Kernel execution failed : <8> invalid device function". I think that may be due to the fact that my card does not support atomic operations. Am I right or there is some other thing to consider? By the way to run the atomic operations I've read that I need to change in visual studio: Project properties -> CUDA C/C++ -> Device -> Code Generation -> compute_13,sm_13. Thanks.
Probably your GPU does not match the compute architecture ( sm_13
) you are compiling for.
The description of error code 8 in driver_types.h
is as follows:
/**
* The requested device function does not exist or is not compiled for the
* proper device architecture.
*/
cudaErrorInvalidDeviceFunction = 8,
A typical reason for this is that the compiled binary architecture does not match the device architecture. You don't mention which GPU you are using, but I'm guessing it's not a sm_13
device.
You can determine what GPU device you have and it's compute architecture and capabilities by running the cuda deviceQuery sample code .
More specifics about the compute architecture required for various atomic operations can be found in the documentation . Note that some atomic functions are available as early as the sm_11
(compute 1.1) architecture, including some versions of the atomicMin
function.
EDIT: based on the fact that you're now indicating your GPU is a GeForce 310m device, this is not a compute 1.3 capable device. Therefore specifying sm_13
won't work. Your GeForce 310m is a compute 1.2 device , so if you specify that architecture (sm_12) you should be able to run code that has been successfully compiled that way.
Regarding atomics, compute 1.2 devices do support certain atomic operations, including certain versions of atomicMin
. Since you haven't shown your code, I can't say anything beyond that.
CUDA devices with compute capability 1.3 support atomic operations. Try compiling your code with the following flag
-arch sm_13
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.