System specs: laptop with nvidia optimus support (geforce 740m, supports compute capability 2.0), ubuntu 13.10, cuda 5.0, optirun (Bumblebee) 3.2.1.
Im\' trying to c
This is not right:
nvcc –arch=sm_20 –dc main.cu defines.cu
nvcc –arch=sm_20 main.cu defines.cu
The first command performs compilation (but no linking) in separate compilation mode. The second command performs compilation and linking in one step, but without using separate compilation mode.
Try just this:
nvcc -arch=sm_20 -rdc=true main.cu defines.cu
The relevant nvcc
documentation is here
Alternatively, and following the example you linked, you could also do this:
nvcc –arch=sm_20 –dc main.cu defines.cu
nvcc –arch=sm_20 main.o defines.o
As @JackOLantern points out, you may wish to replace sm_20
in the above commands with sm_30
to match your device, but that is not the reason for the failure you are observing. Code compiled for -arch=sm_20
will run on a cc 3.0 device.