English 中文(简体)
error in CUDA compilation
原标题:
  • 时间:2009-11-18 06:27:56
  •  标签:
  • cuda

I m getting this error while trying to run sample codes in CUDA SDK. I have CUDA 2.3 and Visual studio 2008

LINK : fatal error LNK1181: cannot open input file cutil32D.lib

Any pointers how to solve this?

问题回答

Since you re compiling the SDK samples, the project files are probably correct. Far more likely is that you haven t built the cutil library. Go to the SDK install directory, then into the "C" directory. You ll see a "common" directory, in there open the cutil.sln solution (or cutil_vc90.sln for VS2008) and build it in release and debug modes for your platform.

Then try your sample again.

The cutil library is used to avoid replicating the same code through all the samples, if you re starting your own project I d avoid reusing the cutil library and write your own checker. For example, you should probably fail gracefully if you detect a CUDA error rather than just calling exit() as done in cutil.

The cuda.rules file included in the SDK is highly recommended! Using this you can just add .cu files to any project and Visual Studio will know how to compile them and link them in to the final executable. Easy!

Your MSVC project needs to include the library cutil32D.lib to link. Once you specify it as a library the linker needs to include in the final binary artifact this problem will go away. It would seem the library is missing at the location the linker is going to look for it. You ll have to change the library search paths or move that file to a directory in which the linker is already looking.

I ran into the same issue. It turned out not only did I need to build the cutil project but also the shrUtils project under the SDK s shared folder.





相关问题
Why won t OpenCV compile in NVCC?

I am trying to integrate CUDA and openCV in a project. Problem is openCV won t compile when NVCC is used, while a normal c++ project compiles just fine. This seems odd to me, as I thought NVCC ...

error in CUDA compilation

I m getting this error while trying to run sample codes in CUDA SDK. I have CUDA 2.3 and Visual studio 2008 LINK : fatal error LNK1181: cannot open input file cutil32D.lib Any pointers how to ...

CUDA Memory Allocation accessible for both host and device

I m trying to figure out a way to allocate a block of memory that is accessible by both the host (CPU) and device (GPU). Other than using cudaHostAlloc() function to allocate page-locked memory that ...

热门标签