[Nouveau] Synchronization mostly missing?

Luca Barbieri luca at luca-barbieri.com
Mon Dec 28 05:21:20 PST 2009


It looks like there are two bugs.

One seems related to some kind of GPU cache of GART memory which does
not get flushed, causes significant corruption and is worked around by
putting buffers in VRAM, software TNL or immediate submission.
It may be related to the NV40TCL_VTX_CACHE_INVALIDATE which is in
nouveau_class.h but never used.
Synchronizing and/or waiting after draw_arrays seems to improve things
but does not fully solve them.

However, there is another one, which is still present with buffers in
VRAM but is eliminated if I add syncing with the DMA_FENCE mechanism
at the end of draw_arrays and draw_elements. This one may be more
widely reproducible.

Try running two or more copies of mesa/progs/demos/dinoshade, all visible.
Do you see a flashing yellow region on the floors?
I do. If I add NV40TCL_NOTIFY or DMA_FENCE based synchronization, the
problem disappears.
This also happens if you move around the window, presumably due to the X server.

It seems that kernel FIFO/M2MF-based fencing does indeed wait for
rendering or at least vertex fetch, but that somehow works only if
there is a single application running.
If there are multiple applications, then the DMA_FENCE-based mechanism
waits more and keeps working while kernel FIFO/M2MF-based fencing
fails.

I'm not sure why this is the case though.

Using nVidia ctxprogs had no effect.
The vram_pushbuf option caused an X lockup upon starting the demo.

Another thing that comes to mind (purely speculative) is that the
FIFO/M2MF synchronization may be due to the fact that GPU component
that reads from the FIFO is the same one that reads the vertices or
other data and is prioritizing that over reading commands, but having
multiple active channels makes that no longer be the case.


More information about the Nouveau mailing list