can't make cuda 3.0 work with visual c++ 2008

Hello!

i’am using visual c++ 2008 profesional on win7 x64 . i have instaled cuda 3.0 ( driver , toolkit… everyting that was on the download site).
Sice then i have tried to make it work with visual c++ profesional but i faild!! ( it’s been 4 days of anoing trying and i think it’s realy stupind that there isen’t an instaler that duoes all the work!!!) .

i’ve Googled alot!

Could someone please send me a link or write a complite idiot’s guide to instaling and making cuda 3.0 work with visual c++ 2008 profesional ( from what stuff to download , in witch order to instal , what custom buid steps to add …)??

thanks!!

When you say failed, what is the nature of the failure? What errors are you getting?

Can you at least recompile the SDK examples?

so i could compile the SDK examples at the begining after i instaled the SDK but they didn’t run because of the mising dll “cudart64_30_13.dll” wich i can’t find on my pc.

After i’ve tried to set the rule from “\NVIDIA Corporation\NVIDIA CUDA SDK\common” for the build of “*.cu” files and tryied to create a new project to test it.

When tryied to compile it i sow that the proget had only one option for " win32" so i added the “x64”.

Now everyting compiles (even .cu files) but i get link errors :

1>------ Rebuild All started: Project: test_cuda, Configuration: Release x64 ------

1>Deleting intermediate and output files for project ‘test_cuda’, configuration ‘Release|x64’

1>Compiling with CUDA Build Rule…

1>“C:\CUDA\bin64\nvcc.exe” -ccbin “c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin” -I"C:\CUDA\include" -I"./" -I"…/…/common/inc" -I"…/…/…/shared/inc" -Xcompiler "/EHsc /W3 /nologo /O2 /Zi /MT " -maxrregcount=32 -gencode=arch=compute_10,code="sm_10,compute_10" -gencode=arch=compute_20,code="sm_20,compute_20" --compile -o “x64\Release\main.cu.obj” “c:\Users\avi\Documents\Visual Studio 2008\Projects\test_cuda\test_cuda\main.cu”

1>main.cu

1>tmpxft_00000488_00000000-6_main.compute_10.cudafe1.gpu

1>tmpxft_00000488_00000000-10_main.compute_10.cudafe2.gpu

1>main.cu

1>tmpxft_00000488_00000000-3_main.compute_20.cudafe1.gpu

1>tmpxft_00000488_00000000-14_main.compute_20.cudafe2.gpu

1>main.cu

1>tmpxft_00000488_00000000-6_main.compute_10.cudafe1.cpp

1>tmpxft_00000488_00000000-20_main.compute_10.ii

1>Linking…

1>main.cu.obj : error LNK2001: unresolved external symbol __cudaUnregisterFatBinary

1>main.cu.obj : error LNK2001: unresolved external symbol __cudaRegisterFatBinary

1>main.cu.obj : error LNK2001: unresolved external symbol cudaFree

1>main.cu.obj : error LNK2001: unresolved external symbol cudaMemcpy

1>main.cu.obj : error LNK2001: unresolved external symbol cudaMalloc

1>C:\Users\avi\Documents\Visual Studio 2008\Projects\test_cuda\x64\Release\test_cuda.exe : fatal error LNK1120: 5 unresolved externals

1>Build log was saved at “file://c:\Users\avi\Documents\Visual Studio 2008\Projects\test_cuda\test_cuda\x64\Release\BuildLog.htm”

1>test_cuda - 6 error(s), 0 warning(s)

========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

and i can’t find the .lib file i need or are there any other errors that i’ve made???

here is the code i’ve tried to compile:

#include <stdio.h>

#include <assert.h>

#include <cuda.h>

#include <iostream>

#include <cuda_runtime.h>

#include <npp.h>

#include <device_launch_parameters.h>

using namespace std;

int main(void)

{

	cout<<"running";

   float *a_h, *b_h;	 // pointers to host memory

   float *a_d, *b_d;	 // pointers to device memory

   int N = 14;

   int i;

   // allocate arrays on host

   a_h = (float *)malloc(sizeof(float)*N);

   b_h = (float *)malloc(sizeof(float)*N);

   // allocate arrays on device

   cudaMalloc((void **) &a_d, sizeof(float)*N);

   cudaMalloc((void **) &b_d, sizeof(float)*N);

   // initialize host data

   for (i=0; i<N; i++) {

	  a_h[i] = 10.f+i;

	  b_h[i] = 0.f;

   }

   // send data from host to device: a_h to a_d 

   cudaMemcpy(a_d, a_h, sizeof(float)*N, cudaMemcpyHostToDevice);

   // copy data within device: a_d to b_d

   cudaMemcpy(b_d, a_d, sizeof(float)*N, cudaMemcpyDeviceToDevice);

   // retrieve data from device: b_d to b_h

   cudaMemcpy(b_h, b_d, sizeof(float)*N, cudaMemcpyDeviceToHost);

   // check result

   for (i=0; i<N; i++)

	  assert(a_h[i] == b_h[i]);

   // cleanup

   free(a_h); free(b_h); 

   cudaFree(a_d); cudaFree(b_d);

	

   return 0;

}

I also have linking problem with NPP. I use cuda 3.0 with NPP 1.1. I tried to compile the sample project freeImageInterop and it gives me error like this. I already copy all .lib and .dll files to the \NPP_1_1_Windows32\SDK\bin\win32

1>freeImageInterop.obj : error LNK2019: unresolved external symbol “public: __thiscall npp::Exception::Exception(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &,unsigned int)” (??0Exception@npp@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0I@Z) referenced in function “void __cdecl FreeImageErrorHandler(enum FREE_IMAGE_FORMAT,char const *)” (?FreeImageErrorHandler@@YAXW4FREE_IMAGE_FORMAT@@PBD@Z)
1>freeImageInterop.obj : error LNK2001: unresolved external symbol “public: virtual __thiscall npp::Exception::~Exception(void)” (??1Exception@npp@@UAE@XZ)
1>freeImageInterop.obj : error LNK2001: unresolved external symbol “public: __thiscall npp::Exception::Exception(class npp::Exception const &)” (??0Exception@npp@@QAE@ABV01@@Z)
1>freeImageInterop.obj : error LNK2019: unresolved external symbol “class std::basic_ostream<char,struct std::char_traits > & __cdecl npp::operator<<(class std::basic_ostream<char,struct std::char_traits > &,class npp::Exception const &)” (??6npp@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AAV12@ABVException@0@@Z) referenced in function __catch$_main$0
1>d:\NPP_1_1_Windows32\SDK\samples\freeImageInterop....\bin\Win32\freeImageInterop-mt-gd.exe : fatal error LNK1120: 4 unresolved externals

I also have linking problem with NPP. I use cuda 3.0 with NPP 1.1. I tried to compile the sample project freeImageInterop and it gives me error like this. I already copy all .lib and .dll files to the \NPP_1_1_Windows32\SDK\bin\win32

1>freeImageInterop.obj : error LNK2019: unresolved external symbol “public: __thiscall npp::Exception::Exception(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &,unsigned int)” (??0Exception@npp@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0I@Z) referenced in function “void __cdecl FreeImageErrorHandler(enum FREE_IMAGE_FORMAT,char const *)” (?FreeImageErrorHandler@@YAXW4FREE_IMAGE_FORMAT@@PBD@Z)
1>freeImageInterop.obj : error LNK2001: unresolved external symbol “public: virtual __thiscall npp::Exception::~Exception(void)” (??1Exception@npp@@UAE@XZ)
1>freeImageInterop.obj : error LNK2001: unresolved external symbol “public: __thiscall npp::Exception::Exception(class npp::Exception const &)” (??0Exception@npp@@QAE@ABV01@@Z)
1>freeImageInterop.obj : error LNK2019: unresolved external symbol “class std::basic_ostream<char,struct std::char_traits > & __cdecl npp::operator<<(class std::basic_ostream<char,struct std::char_traits > &,class npp::Exception const &)” (??6npp@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AAV12@ABVException@0@@Z) referenced in function __catch$_main$0
1>d:\NPP_1_1_Windows32\SDK\samples\freeImageInterop....\bin\Win32\freeImageInterop-mt-gd.exe : fatal error LNK1120: 4 unresolved externals

The sample programs can work now! Previously I tried to compile boxFilter_vc8.vcproj located in D:\NPP_1_1_Windows32\SDK\samples\boxFilter with VC2005, it can not link. Now I compile SDK_vc8.sln in D:\NPP_1_1_Windows32\SDK. I also modify the project file following advice in http://forums.nvidia.com/index.php?showtop…8486&hl=npp. Problem solved.

The sample programs can work now! Previously I tried to compile boxFilter_vc8.vcproj located in D:\NPP_1_1_Windows32\SDK\samples\boxFilter with VC2005, it can not link. Now I compile SDK_vc8.sln in D:\NPP_1_1_Windows32\SDK. I also modify the project file following advice in http://forums.nvidia.com/index.php?showtop…8486&hl=npp. Problem solved.