简体   繁体   English

Java applet:jocl operations stop java3d

[英]Java applet: jocl operations stop java3d

Jocl(opencl wrapper) kernel running makes java3d output disabled. 运行Jocl(opencl包装器)内核会禁用java3d输出。 When opencl finishes, java3d continus working. 当opencl完成时,java3d继续工作。

How can I let Opencl(jocl) and opengl(java3d) work together? 我怎样才能让Opencl(jocl)和opengl(java3d)一起工作? I need some kind of command that tells "its opencl time" and when it finishes it tells "its opengl time now". 我需要一些告诉“它的opencl时间”的命令,当它完成时它告诉“它现在的opengl时间”。

Somehow java3D Jpanel freezes and becomes greyed when opencl is working. 不知何故,当opencl工作时,java3D Jpanel会冻结并变灰。

I did some tracing and found out that java3D is harrassing opencl(jocl), jmonkey engine 3.0 doesnt do that. 我做了一些跟踪,发现java3D正在骚扰opencl(jocl),jmonkey引擎3.0并没有这样做。 Another try showed jmonkey doing same thing. 另一个尝试显示jmonkey做同样的事情。 Suddenly all particles positions stop updating by opencl then all positions go 0,0,0. 突然所有粒子位置都停止通过opencl更新,然后所有位置都变为0,0,0。

Using unique context, program, id, ... for each device. 为每个设备使用唯一的上下文,程序,ID,....

How error looks like: while galaxy is rendered smoothly, suddenly all particles get projected on a plane which I did not create then a few seconds after the plane gets projected onto a line and finally that line gets projected onto a spot. 误差如何:当星系渲染得很平滑时,突然所有粒子投射到我没有创建的平面上,然后在飞机投射到一条线上几秒后最终将该线投射到一个点上。 All these must be because of buffers x[] y[] z[] start getting zero for all elements. 所有这些必须是因为缓冲区x [] y [] z []开始为所有元素变为零。

Edit: lower gpu operating frequencies make the error less frequent. 编辑:较低的gpu工作频率使错误频率降低。 Could this be pushing the gpu harder than furmark because doing calculations in local to work faster? 这可能会比使用furmark更难推动GPU,因为在本地进行计算可以更快地工作吗? Or is this a timing/ accessing priority issues between jocl/jmonkey/java3d ? 或者这是jocl / jmonkey / java3d之间的时间/访问优先级问题? All other programs including furmark, are stable at 1225MHz(hd7870 hawk) but this is likely more stable at only 1000MHz(AMD default of hd7870) or looks unstable as buffers get destroyed by garbage collection faulty ?? 所有其他程序,包括furmark,稳定在1225MHz(hd7870鹰)但这可能更稳定在1000MHz(AMD默认的hd7870)或看起来不稳定,因为缓冲区被垃圾收集故障破坏?

Aparapi(opencl wrapper for java) was never a problem and worked fine at 1200MHz Even got a "driver stopped functioning and recovered" error. Aparapi(java的opencl包装器)从来都不是问题,在1200MHz下工作正常甚至还有“驱动程序停止运行并恢复”错误。 Catalyst 13.3 beta. 催化剂13.3 beta。 Jocl 1.5.1 and tired 1.5.2. Jocl 1.5.1和累1.5.2。 Catalyst 13.4 whql does the same. Catalyst 13.4 whql也是如此。

Putting System.gc(); 放System.gc(); just before the kernel-repeating loop makes the erroneous thing immediately, there must be a garbage collection thing I missed 就在内核重复循环立即出现错误之前,必须有一个我错过的垃圾收集

With some tracing: clCreateBuffer method has a problem with garbage collection 使用一些跟踪:clCreateBuffer方法存在垃圾回收问题

Edit: Solved the issue. 编辑:解决了问题。 Buffer created by clCreateBuffer in main thread seems as a garbage(to be collected) for sub-threads when CL.CL_MEM_USE_HOST_PTR property is used. 当使用CL.CL_MEM_USE_HOST_PTR属性时,主线程中clCreateBuffer创建的缓冲区似乎是子线程的垃圾(要收集)。 CL.CL_MEM_COPY_HOST_PTR solves the problem in exchange of %1-%2 performance loss CL.CL_MEM_COPY_HOST_PTR解决了问题,以换取%1-%2的性能损失

Thanks. 谢谢。

yes this can be a tough issue to track down. 是的,这可能是一个难以追查的问题。 I struggled with this for a while until I found this thread. 我挣扎了一段时间,直到找到这个帖子。

http://www.khronos.org/message_boards/showthread.php/6184-Creating-buffers http://www.khronos.org/message_boards/showthread.php/6184-Creating-buffers

and ofcourse the docs discussing the use of this flag can be foudn here 当然,讨论使用这面旗帜的文件可以在这里找到

http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clCreateBuffer.html http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clCreateBuffer.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM