1

Some time ago I wrote simple boids simulation using OpenCL (was school assignment), using C#, Cloo for OpenCL and OpenTK for OpenGL output. I tested it on Windows7 with AMD CPU implementation of OpenCL and on friend's NVidia. Now I tried it on Linux (Ubuntu 12.04). I installed amd app sdk and intel sdk. It compiled ok, reference CPU implementation is working fine with graphic output. But when I try to run OpenCL version, it runs for about 1 second (showing what seems like valid output in OpenGL) and then gets killed by SIGXCPU. Tried to google some known issue, but found nothing. So I tried to catch and ignore that signal, but everytime I try, program hangs. When I set mono to catch some different signal (e.g. SIGPIPE), it runs ok (minus that kill when opencl). In Mono, i Tried Mono.UnixSignal as stated in FAQ Tried

Mono.Unix.Native.Stdlib.SetSignalAction ( Mono.Unix.Native.Signum.SIGXCPU, Mono.Unix.Native.SignalAction.Ignore);

then something which doesn't hang, but doesn't help either:

Mono.Unix.Native.Stdlib.SetSignalAction ( Mono.Unix.Native.Signum.SIGXCPU, Mono.Unix.Native.SignalAction.Error);

and even

ignore (0);
Mono.Unix.Native.Stdlib.signal(Mono.Unix.Native.Signum.SIGXCPU, new Mono.Unix.Native.SignalHandler (ignore));

with

static void ignore(int signal) {
}

even when I remove everything else from main, it still hangs sometime after "touching" that signal.

One more weird thing:

Mono.Unix.Native.Stdlib.SetSignalAction ( Mono.Unix.Native.Signum.SIGXCPU, Mono.Unix.Native.SignalAction.Default);

Kills application with SIGXCPU somewhere after Application.EnableVisualStyles(); when I set it right before, not even touching OpenCL this time.

Is there something I missed in Mono? Is it using this signal somewhere internally that it gets in the way of OpenCl?

jkavalik
  • 1,296
  • 11
  • 21

2 Answers2

1

SIGXCPU means that you've exceeded a per-process time limit. Once you've exceeded it, you've exceeded it. The process is stuck. You need to use ulimit, or get help from an admin, to set a higher limit.

bmargulies
  • 97,814
  • 39
  • 186
  • 310
  • I've seen this with Cuda applications. It seems that sometimes there's a maximum amount of time a Cuda kernel can run on the video card. If you exceed this time limit the application is killed. – asm Oct 30 '12 at 21:03
  • @bmargulies when I try "ulimit -a" I get "cpu time (seconds, -t) unlimited" Is there some Mono-specific setting for this? – jkavalik Oct 31 '12 at 07:47
1

Mono uses SIGXCPU internally for its own purposes, so if you ignore it (or it's raised for some other reason), things will break.

Rolf Bjarne Kvinge
  • 19,253
  • 2
  • 42
  • 86