[Mesa-dev] [PATCH] [RFC] clover: flush event queue when sequencing new event
Francisco Jerez
currojerez at riseup.net
Mon Mar 13 21:53:07 UTC 2017
Vedran Miletić <vedran at miletic.net> writes:
> OpenMM holds events created during runtime in the queue and destroys
> them at the end, which causes a stack overflow in nontrivial examples.
Did you manange to get a backtrace?
> This patch forces flushing of the event queue and destruction of
> events which are CL_COMPLETE.
>
> I am pretty sure this isn't the nicest solution and probably not
> performance optimal either. Should flushing be done elsewhere? If yes,
> where?
>
This introduces a full command queue flush for every CL command so I
don't think we can use it in production, what the right fix is depends
on what the exact reason is for the stack overflow.
> P.S.
> This patch also fixes cl/custom/r600-create-release-buffer-bug.c test
> in Piglit, but I haven't looked into why exactly that happens.
> ---
> src/gallium/state_trackers/clover/core/queue.cpp | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/src/gallium/state_trackers/clover/core/queue.cpp b/src/gallium/state_trackers/clover/core/queue.cpp
> index c91b97a..7503eea 100644
> --- a/src/gallium/state_trackers/clover/core/queue.cpp
> +++ b/src/gallium/state_trackers/clover/core/queue.cpp
> @@ -94,6 +94,8 @@ command_queue::profiling_enabled() const {
>
> void
> command_queue::sequence(hard_event &ev) {
> + flush();
> +
> std::lock_guard<std::mutex> lock(queued_events_mutex);
> if (!queued_events.empty())
> queued_events.back()().chain(ev);
> --
> 2.9.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170313/68fdf83a/attachment.sig>
More information about the mesa-dev
mailing list