CUDA: Exception due to GPU Architecture Mismatch

Symptom

Your CUDA program executes, but the computed result is wrong. You run the program in Debug mode and it spews out a bunch of first-chance exceptions on cudaError_enum and cudaError of this form in the Output window:

First-chance exception at 0x74dcb727 in HelloCUDA.exe: Microsoft C++ exception: cudaError_enum at memory location 0x002af650..
First-chance exception at 0x74dcb727 in HelloCUDA.exe: Microsoft C++ exception: cudaError at memory location 0x002af4ec..
First-chance exception at 0x74dcb727 in HelloCUDA.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000..

Diagnosis

One of the reasons for this behaviour is if the device you are using cannot support the compute capability the program was compiled for. Ideally, such a program should be able to detect the device capability, compare and exit with a meaningful error. I have no idea why NVIDIA does not do this.

Anyway, if your device is of compute capability 1.1 and the program was compiled for compute capability 2.0, that is sm_20 GPU architecture, then it can result in such silent failures. Recompile the program for the compute capability of your device and the error should be gone.

Tried with: CUDA 4.0

Advertisements

8 thoughts on “CUDA: Exception due to GPU Architecture Mismatch

  1. I get it on the first device memory allocation in my program. It also did not work for me to only compute with the available compute capability. It seems more like some initialisation is required.

    Like

  2. But what can be wrong if even a simple cublasinit triggers the error and demo programs from nvidia itself which trigger the error?

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.