Mono中的Intel CPU OpenCL被SIGXCPU(Ubuntu)杀死 [英] Intel CPU OpenCL in Mono killed by SIGXCPU (Ubuntu)

查看:156
本文介绍了Mono中的Intel CPU OpenCL被SIGXCPU(Ubuntu)杀死的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不久前,我使用C#,OpenCL的Cloo和OpenGL输出的OpenTK编写了简单的Boid仿真,使用OpenCL(是学校作业).我在Windows7上使用OpenCL的AMD CPU实现对它进行了测试,并在朋友的NVidia上进行了测试. 现在,我在Linux(Ubuntu 12.04)上进行了尝试.我安装了AMD应用程式SDK和Intel SDK.它编译好了,参考CPU的实现可以在图形输出中正常工作.但是,当我尝试运行OpenCL版本时,它会运行约1秒钟(显示OpenGL中的有效输出),然后被SIGXCPU杀死.试图向谷歌一些已知的问题,但一无所获. 因此,我试图捕获并忽略该信号,但是每次尝试时,程序都会挂起.当我将mono设置为捕获一些不同的信号(例如SIGPIPE)时,它运行正常(减去opencl会杀死). 在Mono中,我按常见问题解答中所述尝试了Mono.UnixSignal. 试过

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);

甚至

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

使用

static void ignore(int signal) {
}

即使我从main移除了所有其他内容,它在触摸"该信号后仍会挂起.

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

还有一件奇怪的事情:

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

在Application.EnableVisualStyles();之后的某个位置杀死具有SIGXCPU的应用程序.当我之前将其设置好时,这次甚至都没有触摸OpenCL.

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

我在单声道中错过了什么吗?是否在内部某个地方使用了此信号,从而阻碍了OpenCl?

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

推荐答案

Mono内部出于自身目的使用SIGXCPU,因此,如果您忽略它(或者由于其他原因而引起),事情就会崩溃.

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

这篇关于Mono中的Intel CPU OpenCL被SIGXCPU(Ubuntu)杀死的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆