Cuda - NPP Developers..

Hi Experts,

          Hai I planned to use Nvidia Performance Primitive (NPP) lib in my application. In Npp lib all functions uses Npp8u* data type for images.But i don't know how to load a image in Npp8u* format. So, i used OpenCV to load images in IplImage* format and then type cast to Npp8u* format. But it gives wrong results for me.So, please any one tell me how to load image in Npp8u* format?  :unsure:

Npp8u is simply an other name for unsigned char. The way you describe it makes me think that your problem is not that the typecast is invalid, but that you are loading the image into host memory and pass that host pointer to NPP. NPP functions generally expect any pointers to data to be device memory pointers. You should look at the box-filter sample to see how it first loads the sample image into host memory, then copies it into device memory, performs the box filter in device memory and copies the results back to host from where it is saved to disk.

k. Thank you Mr.Frank… Actually now i don’t have GPU. So i am running on emulation mode. So that only some problems. Now i solved it.

I studied at some where that the speed of execution on GPU is depends on how much blocks and threads we are allocating for our kernels. That also depends on resource used by our kernel and number of multiprocessors in board.

So, I am wondering how fast these lib functions will execute…? How it will dynamically decide the number of threads and blocks to execute?

NPP uses various techniques to achieve good performance accros a wide variety of GPUs from different architecture generations.

Since the performance of most primitives varies depending on the paramaters when invoked as well as the specific HW configuration, it is impossible to predict the performance for your specific use case. A simple test app that simulates your use case is probably the best way to determine the performance you’re likely to get.

NPP uses various techniques to achieve good performance accros a wide variety of GPUs from different architecture generations.

Since the performance of most primitives varies depending on the paramaters when invoked as well as the specific HW configuration, it is impossible to predict the performance for your specific use case. A simple test app that simulates your use case is probably the best way to determine the performance you’re likely to get.

Hello,

Mr.Frank…

         Thank you for ur reply...I have some problems with NPP lib function...

Actually if i have used npp lib several functions in my application…But first three functions executing correctly… while executing 4th function…my PC restarting automatically…! External Media

In first three functions are, nppimalloc, nppicopy, nppimirror…

what may be the problem ? ? External Media (Memory problem?..I am using GT220 1GB card)

Note: My pc using the graphics card for display… :huh:

Hello,

Mr.Frank…

         Thank you for ur reply...I have some problems with NPP lib function...

Actually if i have used npp lib several functions in my application…But first three functions executing correctly… while executing 4th function…my PC restarting automatically…! External Media

In first three functions are, nppimalloc, nppicopy, nppimirror…

what may be the problem ? ? External Media (Memory problem?..I am using GT220 1GB card)

Note: My pc using the graphics card for display… :huh:

Very difficult to say based on that little information. On my machines here I do test a sequence similar to yours nppimalloc, cudaCopy (host to device), and nppimirror and it doesn’t cause reboots.

I think you’re on the right track suspecting memory to the problem. My first suspicion would be that you’re passing invalid memory regions to the NPP primitives. If your passing invalid pointers CUDA kernels can/will overwrite critical memory regions on the device. In particular on Windows XP this can cause reboots/blue screens.

I have a quick question regarding the loading of images. How do I know which image types (jpeg, raw, …) are compatable with the npp::loadImage command?

I am trying to load a .raw unsigned short image into npp and its not working.

Code is as follows:

npp::ImageCPU_8u_C1 oHostSrc;
npp::loadImage(imagename, oHostSrc);

where imagename is “…/…/pic1.raw”

Thanks for your help.

RAW image format is not supported in NPP. perhaps you can try reading the image from OpenCV’s IplImage and pass on the image data to the NPP function.

I looked all over openCV forums and website, though I cannnot get a definite answer to this…

Do you know if openCV is compatable with 64-bit Windows 7 running Visual Studio C++ 2008?

Thanks!