I got this error message “Global state space expected for instruction ‘atom’”, and the CUDA error code is CUDA_ERROR_NO_BINARY_FOR_GPU

I used atomicAdd() in my global .cu file, and the atomicAdd() includes atomixCAS(), which I am not sure if I have the source code.

Could anyone please give any hint how my problem happened, and how should I deal with this problem? I did some search, but it turned out I did not find much information related. Thanks alot.


It appears you are using atomic instructions in shared memory, and the PTX file is being compiled for compute capability 1.1 or lower.

I’m not familiar with the compilation process for code run under Matlab, so I can’t tell you why the PTX fie is being compiled for the wrong architecture.


I used nvcc -arch=compute_13, that might be the reason.
now I am using nvcc -arch=compute_20, seems the error is gone.
Appreciate your help.