Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix shader hang in coarse path #106

Closed
wants to merge 1 commit into from
Closed

Fix shader hang in coarse path #106

wants to merge 1 commit into from

Conversation

raphlinus
Copy link
Contributor

I'm observing a hang in the coarse path rasterizer on Nvidia 1060 (not
on other GPUs, and I think only after a more recent driver update).
Investigation shows that the hang happens when the loop to output line
segments from flattening does not terminate. I believe this is a
floating point inconsistency of some kind - the "target" should always
be at least the sum of the "val" for all quadratics, but if it
undershoots the loop may continue when it should not.

It's possible this patch is masking a deeper logic error. Ideally, I'd
instrument the shader and capture a trace of when exactly this goes
wrong. But in any case this patch shouldn't make things any worse.

I'm observing a hang in the coarse path rasterizer on Nvidia 1060 (not
on other GPUs, and I think only after a more recent driver update).
Investigation shows that the hang happens when the loop to output line
segments from flattening does not terminate. I believe this is a
floating point inconsistency of some kind - the "target" should always
be at least the sum of the "val" for all quadratics, but if it
undershoots the loop may continue when it should not.

It's *possible* this patch is masking a deeper logic error. Ideally, I'd
instrument the shader and capture a trace of when exactly this goes
wrong. But in any case this patch shouldn't make things any worse.
@eliasnaur
Copy link
Collaborator

eliasnaur commented Jul 13, 2021

I have reports of GPU hangs (1, 2), and had hoped this change might fix them. However, I'm seeing corruption that looks similar to when I debugged paths that weren't airtightly closed.

2021-07-13-095218_grim
2021-07-13-095216_grim

@raphlinus
Copy link
Contributor Author

Thanks Elias, that's good feedback. It sounds like there is indeed a logic bug, and my proposed fix looks like it's truncating paths so the coverage isn't all the way from one end to the other. Fortunately, I now have a reproducible case (at least on 1060 hardware, if not my other GPUs), so I should be able to add instrumentation to track down in more detail what's really happening. I'll not merge this PR in its current state.

@ishitatsuyuki
Copy link
Collaborator

This is probably superseded by #108. Would you want to close this?

@raphlinus
Copy link
Contributor Author

Yes, thanks for the reminder.

@raphlinus raphlinus closed this Jul 22, 2021
@raphlinus raphlinus deleted the path_hang branch August 11, 2021 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants