How to Run NVIDIA NVPP v1.1 on Visual Studio 2008/2005

 npp_on_visual_studio
NVIDIA’s NVPP (NVIDIA Performance Primitives) is a CUDA accelerated image processing and computer vision library which runs on NVIDIA’s CUDA enabled GPUs. NPP’s latest release includes some key image processing functions which can be used off-the-shelf in your applications or as stand-alone NPP applications.

Here is the detailed procedure for testing out NPP version 1.1  on Microsoft Visual Studio 2008/ Visual Studio 2005.

Note: This procedure also applies to NPP version 1.0 but if you have CUDA Toolkit 3.0 then we recommend running NPP v1.1 with it.

Step 1: Pre-requisites

Here’s the checklist. Download and install/unzip missing programs:

  1. Visual Studio 2008 or VS 2005
  2. CUDA Toolkit 3.0 (3.1 should also work)
  3. Latest NVIDIA drivers
  4. NVPP version 1.1 (32 or 64bit versions) (Download and unzip in your C drive)

Step 2: Setting up Paths

Once you have everything in place, open Visual Studio 2008 and go to:
Tools –> Options –> Projects and Solutions –> VC++ Directories

Now select your platform (Win32 or x64) and then add the following paths to the Executable Files, Include Files and Library Files 

Note: These paths are only for NVPP. I assume that you have CUDA running on your machine already and it’s paths are already set.

Executable Files:

  1. <NPP_DIRECTORY>/SDK/common/lib
  2. <NPP_DIRECTORY>/SDK/common/bin (or /bin/x64 for 64bit OS)
  3. <NPP_DIRECTORY>/SDK/common/FreeImage/lib

Include Files:

  1. <NPP_DIRECTORY>/SDK/common/npp/include
  2. <NPP_DIRECTORY>/SDK/common/UtilNPP
  3. <NPP_DIRECTORY>/SDK/common/FreeImage/include

Library Files:

  1. <NPP_DIRECTORY>/SDK/common/lib
  2. <NPP_DIRECTORY>/SDK/common/FreeImage/lib

Here’s a screenshot:
nvidia_npp_on_vs2008

Step 3: Specifying Additional Dependencies

Once all your paths are set, you are now set to use NPP functions in your project. Once you have created a VS2008/VS2005 project, you have to add additional dependencies to your project.

Go to Project –> Properties –> Configuration Properties –> Linker –> Input

In the Additional Dependencies field make sure you have the following LIB files added:

  1. FreeImage.lib (OR FreeImage64.lib)
  2. libnpp-mt.lib (OR libnpp-mt-x64.lib for 64bit OS)

Here’s a screenshot of my VS2008 running on Windows 7 64bit:
nvidia npp

Now you are all set to go! Take a look at the NPP documentation located at <NPP_DIRECTORY>/SDK/doc/html/index.html to see the function interfaces.

Running NPP Samples

Just to make sure everything has been set up properly, open the Sample solution file in your VS2005/VS2008, rebuild and try running it. If everything runs smoothly and you see the output console screen then you have NPP running perfectly.

NPP Sample project is located at: <NPP_DIRECTORY>/SDK/samples. Open SDK_vc8.sln if you have VS2005 otherwise open SDK_vc9.sln if you have VS2008

Common Errors/Issues

Error: The program can’t start because <DLL_NAME>.dll is missing from your computer. Try reinstalling the program to fix the problem.
Screenshot:
common_error_1

Solution: Search the required DLL (For example FreeImage.dll or FreeImage64.dll) and then copy it to your project’s folder. Better still, try adding the DLL’s path into your System’s BIN path