Porting GPUJPEG Project to Windows - c++

I am currently trying to port the GPUJPEG (on sourceforge) library (based on CUDA) from Unix to Windows.
Now I am stuck - I have no idea what's happening or why it is happening, however when I run the test project, the console get's stuck on the blinky...
You can find the entire Visual Studio 2010 project (you'll need CUDA 5) here:
wingpujpeg.zip
I would be very happy if someone could check this out and maybe help me to port this thing to Windows.
Thanks in advance.
Edit:
I want to use / create a HIGH PERFORMANCE lib for converting real time data (converting 60 fps bmp files to jpeg). This is pretty much why the "common" libraries are not of much use. It's about converting HD images to jpeg in about 10 ms... If someone has another idea, I'd, of course, like to hear it.

I think the problem is that you are running this from Visual Studio for debugging (F5).
If you just run it (Ctrl+F5) it should finish.
At first I thought it's some other problem (deleted my answer), but it's just too slow.
The slowness is caused by the CUDA driver calling malloc/free way too much, causing the
debug runtime allocator to slow down a lot.
This allocator by default is started when you do F5
If you want to disable it, then put in your environment settings (Properties -> Debugging -> Environment this _NO_DEBUG_HEAP=1).
Look here too Set _NO_DEBUG_HEAP

This isn't exactly an answer, but since I can't comment yet: If you're looking for an implementation of JPEG which runs on CUDA, the NPP library supports various pieces of a standard JPEG codec pipeline, and it is included with CUDA. Check out the "jpegNPP" sample in the CUDA SDK: http://docs.nvidia.com/cuda/cuda-samples/

Related

error in _bitset.h file header file: array must have at leas one element

I have programmed an application in C++Builder 6, compiled in Windows 95, the application works perfectly.
The error appears when I compile the application on Windows 10. The following error occurs in the header file _bitset.h:
In
template <size_t _Nw>
On the line
_WordT _M_w[_Nw];
array must have at leas one element
Any ideas?
Thank you all for answering...
I finally solved the problem...
Although the version of the class that I had installed on the new pc seemed the same as on the old pc the "boost_1_31_0" the _biset.h files were different, it was enough to replace the ones on the new pc with the old ones and EUREKA.
Thank you all for your time and excuse my English.
Without MCVE source code or BCB6 installed on Win10 we can only guess sohere are few hints instead of direct answer...
First OS related hints:
There where quite a few changes in OS since BCB6 times. The most likely reason for problems are wrong absolute paths on 64bit windows simply copy compiler and IDE stuff from:
[Program Files (x86)]
into:
[Program Files]
that usually works for most of the older IDEs and SW build before 64bit Windows (like GC/GCC + Eclipse).
On top of this Win10 changed process scheduling to the point many older SW does not work properly or at all and even compatibility modes are useless in Win10. My experience with direct successor of BCB6 (BDS2006 Turbo C++ Explorer) is that to run properly you have to:
run IDE as administrator
You can set this in BCB6 icon properties (compatibility).
set IDE process affinity to single CPU
You can set this in Task manager on BCB6 process. Without this the IDE will freeze for few seconds (up to 45sec) every few minutes (or seconds).
Beware if your app is multithreaded You have to set its affinity back to all CPUs somewhere in your App init code. This is done like this:
Cache size estimation on your system?
Just look for SetProcessAffinityMask usage in the last code there.
install font fix for user folder
I do not know if BCB6 needs this but BDS2006 will not work properly without it as after some Win7 update MS changed the policy of user folder and having fonts there is no longer allowed without fix.
If nothing works try to use Win7 there usually works everything on first try without any problems. Old developing tools tend to not work at all or properly on Win10 and newer versions are usually much worse than old some to the point of to be unusable especially for MCU and USB stuff. So its always a good idea to have a backup Win7 PC for development.
Now code related hints:
Different OS mean different compiler #define directives which means some parts of code might be different then on Win95 see:
C++Builder Compiler Version
so some (most likely inbuild) header files you use might be wanting to see some OS version and have numbers that are not handled in code properly causing some parts of code are not compiled. The remedy is simply to look for those #define in code and either change the version numbers or add new entries ...
Also it looks like BDS2006 compiler bug fix can remedy some weird bugs on BCB6 too so see:
bds 2006 C hidden memory manager conflicts (class new / delete[] vs. AnsiString)
Too many initializers error for a simple array in bcc32

.mll file doesn't work on another user's computer - maya 2019

I'm a newbie at maya c++ API making.
I made a byte of maya c++ api to my computer with Visual studio.
My .mll filetype worked well on my computer with devkit using mel(loadPlugin ~~).
But when the code is run on other computer, it doesn't work. I get the error:
//Error: line 2: Unable to dynamically load : C:/Users/user/Documents/maya/2018/scripts/outOfcameraAPI.mll
Someone told me to bring the dll file to other computer, but I can't understand yet.
I'm sure this is very easy to fix for someone but it is making me crazy. If somebody who reads this knows how to fix, please let me know. Thanks for reading.
These types of error have two reasons in most cases: 1. Build in debug mode, not release mode. Debug mode will rely on debug libraries which are only available if the development environment is installed on the computer, e.g. VisualStudio. 2. The plugin needs an additional library, e.g. a alembic reader will need the alembic library.

Qt - Why Visual Studio 2019 can no longer compile my project after I add a 10Mb file in qml resources?

I'm compiling a QtQuick application using Visual Studio 2019. I built a basic interface which is running well. The interface itself is very simple for now, it's just 3 labels. At this point my project compiles and links without problems.
Now I need to add a custom font file in the qrs resources, in order to load it from a FontLoader object in my qml code. Its size is 11'621KB.
Doing that, I can no longer compile my project. I get the following error:
Error C1060 compiler is out of heap space - qrc_qml.cpp - 745259
Of course, I tried the following link before writing this post:
Microsoft Documentation - Fatal Error C1060
None of the proposed solutions worked for me. Furthermore, I cannot figure out how a simple 11MB file may cause a heap overflow on a computer equipped with 16GB of RAM, on which only a Visual Studio compiler is running.
AFAIK the issue seems to come from the Qt resources compiler, perhaps it generates a too long qrc_qml.cpp file. But if barely an 11 MB file added in the resources (which was previously empty) is enough to saturate the memory, then I am very concerned about the real possibility of using Qt for my projects. Some of them will need much, much, much more than that.
I believe (and I hope) that there is a simple solution. Can someone explain me what I should do to resolve a such issue?
The answer in this post by Hans Passant did work for me:
Huge initialization list, how to fix "fatal error C1060: compiler is out of heap space"
The 64-bit compiler might be able to tackle it. Change the VC++ Directories > Executable Directories setting to pick either $(VC_ExecutablePath_x64_x86), x64_x64 or x64_ARM, depending on the desired platform target. Can't be much fun watching that grass grow, you are almost certainly going to change that utility to write a binary file. – Hans Passant Jul 13 '18 at 11:30

Apply VST audio effect/plugin to audio-file

This is my first question after leeching over here for some time.. So spare me.
I need to apply the iZotope Vinyl VST effect to some audio files via CLI or C++ (so language doesn't really matter), it has to work on a Mac or on a Unix based system. I've researched all over the webs and can't find any working solution.
I've tried using MissWatson, a command line utility, this works but my result audio files are silent...
./MissWatson -plugin=Vinyl -input-file="/Users/Sjaq/Desktop/test.wav" -output-file="/Users/Sjaq/Downloads/MissWatson-v1.0-mac/res.wav" -parameter=1:0.6,2:0.6,11:0.4
Then I tried using the Steinberg VST SDK by creating a host application, starting from the vstvalidator provided by the SDK. But when I try to load the VST I get this error:
2010-12-01 16:57:40.774 vstvalidator[4654:903] Error loading /Library/Audio/Plug-Ins/VST/Vinyl.vst/Contents/MacOS/Vinyl: dlopen(/Library/Audio/Plug-Ins/VST/Vinyl.vst/Contents/MacOS/Vinyl, 262): no suitable image found. Did find:
/Library/Audio/Plug-Ins/VST/Vinyl.vst/Contents/MacOS/Vinyl: no matching architecture in universal wrapper
And I don't know what to do. I'm pretty new to C++ and and made a few apps without any issues, but this time I've hit a dead end.
I've read about pyvst but it seems to need a DLL for the VST so that didn't work either.
I'm the author of MissWatson, and as you probably noticed on the webpage, I unfortunately was required to close-source the code, so I can't really ask you for more diagnostic information, since I wouldn't be able to patch MissWatson if it's a bug there. However, I would recommend running MissWatson with the -verbose switch and perhaps logging that output to file if that floods your terminal. You might find something in that output which helps you to diagnose the problem.
Anyways, as for the error in your VST host, I have a feeling that you are compiling your app as a 64-bit executable and trying to load a 32-bit plugin. Since hardly any VST/AU plugins (and also sequencers, for that matter) have made the leap to 64-bit, you'd be better off just compiling your app as a 32-bit x86 binary.
By default, the "debug" configuration in Xcode only builds your app for the native architecture of your machine to save time during compilation. I would advise that you disable this feature in your project's build settings and always build with the architectures you plan to ship with. This will prevent weird cross-architecture types of errors like the one you saw above.
Edit: I have since started a new command-line VST host to replace MissWatson which is called MrsWatson. You should try using this tool instead.
Perhaps you can port the source code of this open source vst host to match your platforms?
http://www.hermannseib.com/english/vsthost.htm
Scroll down to the bottom of the page.
Hope it helps.

Checking if DWM/Aero is enabled, and having that code live in the same binary for 2000/XP/Vista/7

I know the title makes little sense, mostly because it's hard to explain in just one line. So here's the situation:
I have a program who's binary is targeted at Windows 2000 and newer. Now, I went ahead and added some code to check if the user is running under Vista/7, and if so then check if Aero/DWM is enabled. Based on this I'll disable some stuff that isn't relevant to that particular platform, and enable some other features. My main problem is that in order to call DwmIsCompositionEnabled from Visual C++ 2008 I have to add the dwmapi.lib file and compile against it. Running the binary in anything other than Vista or 7 gives the "Unable to locate component. The application failed to start because dwmapi.dll was not found" error. This, of course, is expected to happen since DWM is new and not available for older platforms.
My question is then: will it be possible for me to somehow manage to pull this off? One binary for all OS versions AND include that DWM check code? This program was written under Visual Studio 2008, Visual C++ using MFC.
Turns out I can just tell the linker to delayload the dwmapi.dll.
I'd like to thank ewanm89 because something he said sort of resonated and led me down the path to finding the actual answer.
The normal solution is to use LoadLibrary() and GetProcAddress(). Both can be done after your program started. But still +1 for the DelayLoad solution, which does the same for you behind the scenes.