简体   繁体   English

OpenGL:在Linux上渲染时间限制

[英]OpenGL: render time limit on linux

I'm implementing some computation algorithm via OpenGL and Qt. 我正在通过OpenGL和Qt实现一些计算算法。 All computations are executed in fragment shader. 所有计算都在片段着色器中执行。

Sometimes when i trying to execute some hard computations (that takes more than 5 seconds on GPU) OpenGL breaks computation before it ends. 有时,当我尝试执行一些困难的计算时(在GPU上花费5秒钟以上),OpenGL会在计算结束之前中断计算。 I suppose this is system like TDR from Windows. 我想这是Windows的TDR之类的系统。

I think that i should split input data by several parts but i need to know how long computation allowed. 我认为我应该将输入数据分成几部分,但是我需要知道允许多长时间的计算。

How i can obtain render time limit on linux (it will be cool if there is crossplatform solution)? 我如何获得Linux上的渲染时间限制(如果有跨平台解决方案,那将很酷)?

I'm afraid this is not possible. 恐怕这是不可能的。 After a lot of scouring through the documentation of both X and Wayland, I could not find anything mentioning GPU watchdog timer settings, so I believe this is driver-specific and likely inaccessible to the user (that or I am terrible at searching). 在遍历X和Wayland的文档后,我找不到任何提及GPU看门狗定时器设置的内容,因此,我相信这是特定于驱动程序的,并且可能对用户来说是无法访问的(这对我来说很糟糕)。

It is however possible to disable this watchdog under X on NVIDIA hardware by adding a line to your xorg.conf , which is then passed on to the graphics driver. 但是,可以通过在xorg.conf添加一行,然后将其传递到图形驱动程序,来在NVIDIA硬件上的X下禁用该看门狗。

Option "Interactive" "boolean" 选项“交互式”“布尔”

This option controls the behavior of the driver's watchdog, which attempts to detect and terminate GPU programs that get stuck, in order to ensure that the GPU remains available for other processes. 此选项控制驱动程序看门狗的行为,该行为将尝试检测并终止卡住的GPU程序,以确保GPU仍可用于其他进程。 GPU compute applications, however, often have long-running GPU programs, and killing them would be undesirable. 但是,GPU计算应用程序通常具有长期运行的GPU程序,因此将其杀死是不可取的。 If you are using GPU compute applications and they are getting prematurely terminated, try turning this option off. 如果您使用的是GPU计算应用程序,并且这些应用程序过早终止,请尝试关闭此选项。

Note that even the NVIDIA docs don't mention a numeric quantity for the timeout. 请注意,即使是NVIDIA文档,也没有提及超时的数值。

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

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