Could someone guide me to how to load and display a JPG image using CUDA in linux. These are high resolution images and my intention is make them load faster and display using openGL.
I know that CUDA has a loadPPM function… do they have any similar function for loading RGB Jpeg images ?
I think you should just use libjpeg for this. It is probably already installed on your machine, and you should look for a file named libjpeg.doc among the documentation files of this package - there, you could find an explanation on how to utilize the library to load JPEG files from the disk. Once you have decompressed stream of pixels in your main memory, you could proceed on the same way as with PPM example you have at your hand.
On the other side, if the fast loading is very important for you, you should try to search, this forum and elsewhere, for any work on doing de-compression of JPEG images on the GPU. This is something that could take significant time, and on the other side in principle could be done in parallel. I remember reading some posts on this topic here on forum some time ago, but don’t know if anyone came with a complete solution so far…
Seems the problem was I was using c, appending .c to my files. Changing to .cc, there is no problem as far as I can tell. The .cc file is compiled with gcc, the .cu files with nvcc and everything is linked with nvcc.
If I compile the .cc file with nvcc I get the same problem as before. If I name it .c and compile with gcc, nvcc can’t link the results. nvcc is driving me crazy some times.
Seems the problem was I was using c, appending .c to my files. Changing to .cc, there is no problem as far as I can tell. The .cc file is compiled with gcc, the .cu files with nvcc and everything is linked with nvcc.
If I compile the .cc file with nvcc I get the same problem as before. If I name it .c and compile with gcc, nvcc can’t link the results. nvcc is driving me crazy some times.