Problem with libraries(?) during building.

Hi.

When I try compile my simple CUDA program I get the below statement about errors:

Warning  1	warning : The 'compute_10' and 'sm_10' architectures are deprecated, and may be removed in a future release.	C:\Users\Mariusz\Documents\Visual Studio 2013\Projects\CUDA_tescik\CUDA_tescik\nvcc	CUDA_tescik

Error	2	error C1021: invalid preprocessor command 'includeá'	C:\Users\Mariusz\Documents\Visual Studio 2013\Projects\CUDA_tescik\CUDA_tescik\CCUUDDAA.cu	3	1	CUDA_tescik

Error	3	error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\bin\nvcc.exe" -gencode=arch=compute_10,code=\"sm_10,compute_10\" --use-local-env --cl-version 2012 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin"  -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\include"  -G   --keep-dir Debug -maxrregcount=0  --machine 32 --compile -cudart static  -g   -DWIN32 -D_DEBUG -D_CONSOLE -D_LIB -D_UNICODE -DUNICODE -Xcompiler "/EHsc /W3 /nologo /Od /Zi /RTC1 /MDd  " -o Debug\CCUUDDAA.cu.obj "C:\Users\Mariusz\Documents\Visual Studio 2013\Projects\CUDA_tescik\CUDA_tescik\CCUUDDAA.cu"" exited with code 2.	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\BuildCustomizations\CUDA 6.0.targets	597	9	CUDA_tescik

And this is my program:

#include "cuda.h"

#include "stdfx.h"
#include "iostream"
#include <cutil.h>

using namespace std;

void PrintDevicesInformation()
{
int deviceCount,nrdev,nMulProc;
cudaGetDeviceCount(&deviceCount);
printf("Number of CUDA devices: %d\n",deviceCount);
for(nrdev = 0; nrdev < deviceCount; nrdev++) {
  cudaDeviceProp deviceProp;
  cudaGetDeviceProperties(&deviceProp, nrdev);
  printf("Device %d: %s\n", nrdev, deviceProp.name); 
  printf("maxThreadsPerBlock: %d\n", deviceProp.maxThreadsPerBlock); 
  nMulProc=deviceProp.multiProcessorCount;
  printf("multiProcessorCount: %d\n", nMulProc); 
  printf("computeMode: %d\n", deviceProp.computeMode); 
  printf("sharedMemPerBlock: %ld\n", deviceProp.sharedMemPerBlock);  
  }
}

int main(int argc, char* argv[])
{
  PrintDevicesInformation(); 
system(„PAUSE”);
  return 0;
}

I have:

  • Windows 7 home premium
  • CUDA Toolkit 6.0
  • 2x Geforce GTX 660 connected by SLI
  • Intel i5 4690 processor
  • Visual Studio Express 2012

I’m beginner in CUDA parallel programming and I don’t know what is sm_10 and compute_10 architectures. My GPU’s have 3.0 compute capability.

I would be grateful for help.

sm_10 and compute_10 refer to compiler settings used to select code generation for a cc 1.0 architecture, which is pretty old - basically G80/G92 GPUs from circa 2007-2008.

In CUDA 6, support for cc1.0 was deprecated, which means its going away soon (support for cc 1.0 is dropped in CUDA 6.5).

You’re getting this message because your project configuration file specifies code generation for cc 1.0 via these command line switches in the compile command:

-gencode=arch=compute_10,code=“sm_10,compute_10”

For the time being, you should be able to execute cc1.0 code on your cc3.0 GPU. If you want to change it to match your architecture, go into the project configuration and modify the code generation settings. If you google around for this, you can find pictures on the web where people show where to look.

I think the first error is due to this:

#include “iostream”

I think you should specify the inclusion of that standard header via:

#include

The second error you list is just a summary error indicating that nvcc ended with one or more errors (specifically, the one above concerning include files.)

I did above commands and sill I get statements about errors:

Error	1	error : nvcc supports '--relocatable-device-code=true (-rdc=true)', '--device-c (-dc)', and '--device-link (-dlink)' only when targeting sm_20 or higher	C:\Users\Mariusz\Documents\Visual Studio 2013\Projects\CUDA_tescik\CUDA_tescik\nvcc	CUDA_tescik
Error	2	error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\bin\nvcc.exe" -gencode=arch=compute_30,code=\"sm_30,compute_30\" -gencode=arch=compute_10,code=\"sm_10,compute_10\" --use-local-env --cl-version 2012 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin" -rdc=true -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\include"  -G   --keep-dir Debug -maxrregcount=0  --machine 32 --compile -cudart static -arch sm_30  -g   -DWIN32 -D_DEBUG -D_CONSOLE -D_LIB -D_UNICODE -DUNICODE -Xcompiler "/EHsc /W3 /nologo /Od /Zi /RTC1 /MTd  " -o Debug\CCUUDDAA.cu.obj "C:\Users\Mariusz\Documents\Visual Studio 2013\Projects\CUDA_tescik\CUDA_tescik\CCUUDDAA.cu"" exited with code -1.	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\BuildCustomizations\CUDA 6.0.targets	597	9	CUDA_tescik

I can’t find any solution for this errors in google…

This is a different error.

Remove the switches to compile for cc1.0:

-gencode=arch=compute_10,code=“sm_10,compute_10”

from your project properties.

I’m sorry I have not written a long time but I was on holiday.

I can’t find any additional options in CUDA Linker - command line and Linker - command line, and all property. In Property / CUDA C/C++ / Device / Code Generation I have written: " compute_30,sm_30"%(CodeGeneration) ".

In nvcc manual I found, what options I should write, but didn’t found where.