# How to check if rendering is done/ready

**URL:** https://discourse.vtk.org/t/how-to-check-if-rendering-is-done-ready/399
**Category:** Support
**Created:** [March 4, 2019, 9:43pm UTC](https://discourse.vtk.org/t/how-to-check-if-rendering-is-done-ready/399 "2019-03-04T21:43:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mikewho](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/f1d935/32.png) [@mikewho](https://discourse.vtk.org/u/mikewho)
#### Post date: [March 4, 2019, 9:43pm UTC](https://discourse.vtk.org/t/how-to-check-if-rendering-is-done-ready/399/1 "2019-03-04T21:43:36Z")

</div>

Is there a way to check if rendering is done/ready (vtkRenderer & vtkRenderWindow)? I’m calling Render very frequently, and the GPU basically falls behind a bit which introduces a lag. What I’d like to do is have an if statement before my Render call, so that it only gets called if it’s ready to Render. Thanks!

Mike

---

<div class="post-metadata">

### Author: ![banesullivan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/banesullivan/32/7143_2.png) [@banesullivan](https://discourse.vtk.org/u/banesullivan)
#### Post date: [March 5, 2019, 4:16am UTC](https://discourse.vtk.org/t/how-to-check-if-rendering-is-done-ready/399/2 "2019-03-05T04:16:16Z")

</div>

If you’re working in Python, you could try to overwrite the `Render` call to keep track of the status:

```python
import vtk

class MyRenderWindow(vtk.vtkRenderWindow):
    def __init__ (self, **args):
        super(MyRenderWindow, self). __init__ (**args)
        self._is_ready = True

    @property
    def is_ready(self):
        return self._is_ready

    def Render(self, **args):
        self._is_ready = False
        vtk.vtkRenderWindow.Render(self, **args)
        self._is_ready = True

```

Then use it like:

```python
...
ren_win = MyRenderWindow()
...
if ren_win.is_ready:
    rend_win.Render()

```

---

<div class="post-metadata">

### Author: ![mikewho](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/f1d935/32.png) [@mikewho](https://discourse.vtk.org/u/mikewho)
#### Post date: [March 5, 2019, 12:15pm UTC](https://discourse.vtk.org/t/how-to-check-if-rendering-is-done-ready/399/3 "2019-03-05T12:15:56Z")

</div>

Unless I’m not understanding something, wouldn’t this just tell me when the Render call has happened? What I need to know is when the GPU is actually done with the Render (which can take longer than the Render call). The Render call sends instructions/requests to the GPU, and then the GPU handles them as fast as it can. But it can easily fall behind if you’re calling Render very frequently. So what I need is a way to know if the GPU is done with the previous Render call.
