About -deviceemu error

I wrote some cuda program.

I can compile them with the GPU mode, but I failed to compile them with option -deviceemu.

the error is :

nvcc -deviceemu -O3 -DPROTOTYPE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -lg2c -lcufft -c a3d3.cu 

/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/locale_classes.h(410): error: support for exception handling is disabled

/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/locale_classes.h(515): error: support for exception handling is disabled

2 errors detected in the compilation of "/tmp/tmpxft_00002c16_00000000-4_a3d3.cpp1.ii".

make: *** [frealign_v8.a(a3d3.o)] Error 255


I define an struct and use it as global variable. Is it realated to that?

I’ve seen quite a few posts like this…

Some people suggest changing the --host-compilation flag, others suggest to be careful of the cAsE of your directory paths.

Hopefully some of the previous posts can help you:

sorry, I can’t open the above link.

can you give me another one?

thank you very much

Oops…guess the forum software switched the quotes in the link.

Just do a Google search for


A couple of the results:



This two comments should help:


Device emulation with cuda 2.2 and c++ host code will not work. And device emulation gets probably removed sometime…