--cubin is not allowed when compiling for multiple GPU code instances

can I add some flag or do whatever to make my code compilation as for single GPU?
I didn’t specify multi GPU compilation, but also not 1, I didn’t specify it at all,
is multi a default?
how can I use -cubin?
Linux Ubuntu 12.10, GT630, amd64

You can bundle multiple cubins into a fatbin.

Something like the following will delete the previous fatbin ($@) and then create a new one by successively adding cubins of different architectures.

$(FATBINS):	$(CUBINS_ALL)
		-rm -f $@
		-fatbinary -add $@ -im profile=sm_12,file=$(subst fatbin,sm_12.cubin,$@) 
		-fatbinary -add $@ -im profile=sm_21,file=$(subst fatbin,sm_21.cubin,$@) 
		-fatbinary -add $@ -im profile=sm_30,file=$(subst fatbin,sm_30.cubin,$@) 
		-fatbinary -add $@ -im profile=sm_35,file=$(subst fatbin,sm_35.cubin,$@)

In this snippet the fatbin file is assumed to have the form “.fatbin”. Cubins will have the form “..cubin”.

You can then use the Driver API to load the kernel from the fatbin. The Driver API automagically finds the most appropriate cubin or PTX. See cuModuleLoadXXX.

It works well!

thank you very much, unfortunately I still don’t know how to merge this with my Makefile.
can you please show this?
here is my Makefile:

Makefile.txt (4.41 KB)

That looks like a generated Makefile from the Eclipse IDE. Since you’re only dealing with one kernel then you might just want to write your own Makefile.

But it begs the question, why do you need to create cubins for several architectures instead of just letting NVCC embed the multi-arch kernels in the normal way?

There are few cases where you actually want to load a cubin at run-time.

thank you very much