Open gsw88 opened 5 years ago
I haven't updated the samples for a while now and given that NPP had a few changes till the current version, it might be useful to update these samples. Given that you already made these, would you mind to create a pull request? Best, Michael
@gsw88 , I've been trying to get the JpegNPPCompression sample to work as well. I've rebuilt NPP.dll and ManagedCuda.dll, however when I run the program I get the following error:
ErrorNotInitialized: The CUDA driver API is not yet initialized. Call cuInit(Flags) before any other driver API calls.
If I add the following just before calling the Jpeg save/load functions:
var result = ManagedCuda.DriverAPINativeMethods.cuInit(0);
The result is 'ErrorUnknown' and I still get the same error.
Any ideas what could cause this? Did you have a similar problem?
So, it turns out I was being stupid - had the CUDA toolkit installed, but not the right drivers for my GPU!
Apologies for posting in with an unrelated issue.
in ManagedCudaSamples/JpegNPPCompression/Jpeg.npp line:726
jpeg is decoded incorrectly and results in a poor quality image.
Data copied to device memory differs from c++ npp example as seen in the cuda toolkit version 10.0 examples. The c++ example passes new array populated with values obtained from looking up the values of aQuantizationTables[x] in the look up table, Npp8u aZigZag.
replacing JpegNPP.cs lines 726 to 732 with the following results in a better jpeg decompression
This change is necessary to get an accurate image for me after I rebuilt NPP.dll and ManagedCuda.dll for x64 with cuda toolkit 10.0 installed. I never installed cuda toolkit 8.0, which appears to be required by the dlls included with the repo in Samples\lib so I don't know if this is also necessary for that version.
Also, the method NPPImage_8uC1::Resize no longer exists in 8.0.22.0 replacing it with NPPImage_8uC1::SqrPixelAdvanced allows the code to compile with the updated assembly reference