Jump to content

32bit plugin + 64bit PDN = crash


harold
 Share

Recommended Posts

That it wouldn't work was to be expected.

Still, should it crash a horrible death?

I got here trying to code up a mandelbrot effect that would use GPGPU (using Brahma), unfortunately the dependencies are 32bit only.

This text file was created because Paint.NET crashed.
Please e-mail this file to crashlog@getpaint.net so we can diagnose and fix the problem.

Application version: Paint.NET v3.36 (Final Release build 3.36.3158.38068)
Time of crash: 07-02-2009 18:57:01
Application uptime: 00:00:13.2500000
OS Version: 5.2.3790.131072 Service Pack 2 Workstation x64
.NET version: CLR 2.0.50727.3082 x64, FX 2.0 2.0SP1 2.0SP2 3.0 3.0SP1 3.0SP2 3.5 3.5SP1 3.5SP1_Client 
Processor: 4x "Intel(R) Core(TM)2 Extreme CPU Q6850  @ 3.00GHz" @ ~3333MHz (DEP, SSE, SSE2)
Physical memory: 4094 MB
UI DPI: 96.00 dpi (1.00x scale)
Tablet PC: no
Updates: true, 02-02-2009
Locale: pdnr.c: en-US, hklm: en-US, hkcu: en-US, cc: en-GB, cuic: en-US
Features log: PopulateFonts(), UpdatesState(StartupState), SetTool(PaintDotNet.Tools.PaintBrushTool), UpdatesState(ReadyToCheckState), HM(NullHistoryMemento), ShowDialog(PaintDotNet.ToolsForm), ShowDialog(PaintDotNet.ColorsForm), ShowDialog(PaintDotNet.HistoryForm), ShowDialog(PaintDotNet.LayerForm), ShowDialog(PaintDotNet.MainForm), Menu.Effects, Effect(MandelEffect.EffectPlugin), ShowDialog(MandelEffect.EffectPluginConfigDialog), HM(BitmapHistoryMemento), ShowDialog(PaintDotNet.ProgressDialog)
Loaded assemblies: 
   mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @ C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\mscorlib.dll
   PaintDotNet, Version=3.36.3158.38068, Culture=neutral, PublicKeyToken=null @ C:\Program Files\Paint.NET\PaintDotNet.exe
   System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @ C:\WINDOWS\assembly\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.Forms.dll
   System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @ C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll
   System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @ C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll
   PaintDotNet.Core, Version=3.36.3158.38063, Culture=neutral, PublicKeyToken=null @ C:\Program Files\Paint.NET\PaintDotNet.Core.dll
   PaintDotNet.Base, Version=3.36.3158.38062, Culture=neutral, PublicKeyToken=null @ C:\Program Files\Paint.NET\PaintDotNet.Base.dll
   PaintDotNet.SystemLayer, Version=3.36.3158.38062, Culture=neutral, PublicKeyToken=null @ C:\Program Files\Paint.NET\PaintDotNet.SystemLayer.dll
   PaintDotNet.Resources, Version=3.36.3158.38063, Culture=neutral, PublicKeyToken=null @ C:\Program Files\Paint.NET\PaintDotNet.Resources.dll
   PaintDotNet.Data, Version=3.36.3158.38064, Culture=neutral, PublicKeyToken=null @ C:\Program Files\Paint.NET\PaintDotNet.Data.dll
   PaintDotNet.Effects, Version=3.36.3158.38065, Culture=neutral, PublicKeyToken=null @ C:\Program Files\Paint.NET\PaintDotNet.Effects.dll
   Brahma.DirectX, Version=0.0.3325.31501, Culture=neutral, PublicKeyToken=null @ C:\Program Files\Paint.NET\Effects\Brahma.DirectX.dll
   Brahma, Version=0.0.3325.31501, Culture=neutral, PublicKeyToken=null @ C:\Program Files\Paint.NET\Effects\Brahma.dll
   MandelEffect, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null @ C:\Program Files\Paint.NET\Effects\MandelEffect.dll
   System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @ C:\WINDOWS\assembly\GAC_MSIL\System.Core\3.5.0.0__b77a5c561934e089\System.Core.dll

Exception details:
System.BadImageFormatException:  is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)
  at Brahma.DirectX.ComputationProvider.DisposeUnmanaged()
  at Brahma.ComputationProviderBase.Dispose(Boolean disposing)
  at Brahma.ComputationProviderBase.Finalize()
------------------------------------------------------------------------------

I would write plugins, if I knew what kind of plugins were needed.. :(

Link to comment
Share on other sites

Yes.. but it killed my plugin. Does anyone know a way to talk with the GPU in a way that works on both 32bit and 64bit?

I haven't found any such way yet.

XNA: no good, 32bit only

DirectX: both versions available but the API is different so that still leaves you with nothing.

Tao (OpenGL binding): no good, 32bit only unless you recompile which is just impossible.

CsGL: same.

CUDA: the C# bindings don't even work at all as far as I've been able to test.

I would write plugins, if I knew what kind of plugins were needed.. :(

Link to comment
Share on other sites

yet

I hope that means it will be :)

But does "this" refer to "using a 32bit dll as plugin in 64bit mode"? (I'd be surprised if that's possible at all)

Or to "using the GPU" ? Well I did that already, it's just that it completely fails to work on 64bit and writing a plugin that doesn't work on x64 is just unacceptable for me. The good news (in so far as it's news) is that for complex effects it was very much faster than the CPU version.

By the way, Rick, maybe you could have a look at Brahma (or even just their intro) someday? It's something like "Linq to GPU". Something comparable to that system would allow plugin writers to write GPU-executed effects without writing any code in HLSL or other shading/GPGPU languages. It translates a LambdaExpression into HLSL - in a way that allows you to use normal C# syntax, variables, and even the functions from System.Math.

I would write plugins, if I knew what kind of plugins were needed.. :(

Link to comment
Share on other sites

the latter.

Version 4.0 will definitely not have GPU support, but I am reworking things so that it will be possible to add this in a later version. (Note that this is NOT a feature promise. So please don't go claiming that "version 4.1 will have GPU support" or something crazy.)

viewtopic.php?p=199054#p199054

No. Way. I've just seen Bob. And... *poof!*—just like that—he disappears into the mist again. ~Helio

Link to comment
Share on other sites

Ok I guess I've been unclear then... :(

I never expected 32bit dll's to be loaded form 64bit processes - it wouldn't even make sense if it were possible.

The "bug" is that PDN crashes badly - obviously that would made the offending plugin bad and therefore likely banned but it can't hurt to not-crash..

Of course I'm not blaming it on the GPU stuff or anything - I just want to find a way to use the GPU in 64bit code. I mailed the Brahma programmer to ask if he could make it 64bit compatible but it's a bit early to expect results yet. The reason I brought that up was that maybe such an architecture would help plugin writers if (or when?) there will be GPU support in PDN. Which means later, not now.

I would write plugins, if I knew what kind of plugins were needed.. :(

Link to comment
Share on other sites

  • 2 weeks later...

Well I didn't really expect you to, but I was hoping you might implement something (as in, the pattern) similar, because it's really quite easy to use - just write a LINQ query and it Just Works, all gory details well-hidden, details that could very well be just about multithreading instead of executing on the GPU

An effect of that type also can't really do anything "bad", it could just operate on the pixels.

I would write plugins, if I knew what kind of plugins were needed.. :(

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...