compilation error

Dear all:
I install cuda 2.2 and test exmaple “matrixMul” on VC2005.
I use CUDA VS2005 Wizard provided by kyzhao to setup project manager.

error message is

1>Deleting intermediate and output files for project ‘matrixMul’, configuration ‘Debug|x64’
1>Compiling…
1>nvcc fatal : Value of -arch option (‘sm_13’) must be a virtual code architecture
1>Compiling…
1>nvcc fatal : Value of -arch option (‘sm_13’) must be a virtual code architecture
1>Compiling…

project setting is

property → CUDA → Command Line

C:\CUDA_64\bin\nvcc.exe -ccbin “C:\Program Files (x86)\Microsoft Visual Studio 8\VC\bin” -I"C:\CUDA_64\include" -I"C:\Documents and Settings\All Users\Application Data\NVIDIA Corporation\NVIDIA CUDA SDK\common\inc" -O0 -D_DEBUG -D_CONSOLE -arch sm_13 -code sm_13 --host-compilation C++ -g -c -m 64 -o “x64\Debug\matrixMul.obj” -odir “x64\Debug” -ext none -int real matrixMul.vcproj

                                      Lung Sheng

Dear:

I have a workaround

  1. copy C:\Documents and Settings\All Users\Application Data\NVIDIA Corporation\NVIDIA CUDA SDK\common\Cuda.Rules

    to C:\Program Files (x86)\Microsoft Visual Studio 8\VC\VCProjectDefaults

and modify Cuda.Rules to add “include directory”

		<Properties>

			<StringProperty

				Name="Include"

				DisplayName="Additional Include Directories"

				Description="Specifies one or more directories to add to the include path; use semi-colon delimited list if more than one.  (/I[path])"

				Switch="-I&quot;[value]&quot;"

				DefaultValue="$(CUDA_INC_PATH);$(NVSDKCUDA_ROOT)\common\inc"

				Inheritable="false"

				Delimited="true"

				Delimiters=";"

			/>
  1. create VC project as usual (NOT from CUDA wizard)

  2. project → add existing Item

    add matrixMul.cu

then pop up a dialog “Matching Custom Build Rules”

there are three choices in my system,

one comes from C:\Documents and Settings\All Users\Application Data\NVIDIA Corporation\NVIDIA CUDA SDK\common\Cuda.Rules, named CUDA Build Rule

other two are created by kyzhao

I choose “CUDA Build Rule”

  1. in configuration property, one property “CUDA Build Rule v2.2.0” appears

GPU Architecture → sm_13

  1. change platform to x64

  2. set proper library and its path

    Linker → Input → addtional dependence

    add “C:\Documents and Settings\All Users\Application Data\NVIDIA Corporation\NVIDIA CUDA SDK\common\lib\cutil64D.lib”

    "C:\CUDA\lib\cudart.lib"
    

If I compile matrixMul.cu, then command is

“C:\CUDA\bin\nvcc.exe” -arch sm_13 -ccbin “C:\Program Files (x86)\Microsoft Visual Studio 8\VC\bin” -Xcompiler “/EHsc /W3 /nologo /O2 /Zi /MT " -I"C:\CUDA\include” -I"C:\Documents and Settings\All Users\Application Data\NVIDIA Corporation\NVIDIA CUDA SDK\common\inc" -maxrregcount=32 --compile -o “x64\Debug\matrixMul.cu.obj” “h:\project_2008\GPU\example\matrixMul_vc2005\matrixMul.cu”

I think that this solution is proper for me since I can easily combine Qt + MKL + CUDA

Lung Sheng

dear all:

I solved the problem by using latest version CUDA_VS_Wizard_W64.2.0

the error is

-arch sm_13 -code sm_13 

it should be corrected as

-arch compute_13 -code sm_13                                           





                        Lung Sheng