#
✕ nick:lina
#asahi-gpu · 2023-07-25 11:39
linaYeah, there was always room for that
#asahi-gpu · 2023-07-25 11:35
linaWhat I said with the barriers works right?
#asahi-gpu · 2023-07-25 11:35
linaalyssa: Sure ^^
#asahi-gpu · 2023-07-23 15:41
linaOK ^^
#asahi-gpu · 2023-07-23 15:40
linaAlso can you look at the shadowing MR? It's kind of a nasty bug/thing but the fix is easy, I want to get it fixed ^^
#asahi-gpu · 2023-07-23 15:39
linaI should sleep but I can try looking at this later ^^
#asahi-gpu · 2023-07-23 15:38
linaYeah ^^
#asahi-gpu · 2023-07-23 15:38
linaI should trace that...
#asahi-gpu · 2023-07-23 15:38
linaAssuming we don't find a magic mesh shader thing to make it work ^^
#asahi-gpu · 2023-07-23 15:37
linawwwwwwwwwwww
#asahi-gpu · 2023-07-23 15:35
linaand don't wait for anything render
#asahi-gpu · 2023-07-23 15:35
linait means wait for 1 compute command to be done
#asahi-gpu · 2023-07-23 15:31
linaAlso I did document all this: https://github.com/AsahiLinux/docs/wiki/SW:AGX-driver-notes#queues ^^
#asahi-gpu · 2023-07-23 15:27
linaAlso even with two separate ioctls you shouldn't need syncobjs as long as you still have the {0, 0} barrier (which maps to BARRIER_RENDER | BARRIER_COMPUTE in the existing code)
#asahi-gpu · 2023-07-23 15:23
linaSo not the compute command that precedes it in the same submission
#asahi-gpu · 2023-07-23 15:23
linaIf you were passing 0,0 for both then that wouldn't work, that would tell the render command to wait for any render/compute commands *prior* to the submission you're making right now
#asahi-gpu · 2023-07-23 15:22
linaalyssa: The first (compute) command needs to specify the barriers as {0, 0} to wait for any previous submission (implicitly, we always do this in GL, no need for sync objects), and the second (render) command needs to specify the barriers as {NONE, 1} to wait for the compute command to complete
#asahi-gpu · 2023-07-23 15:18
linaalyssa: It should work. You need to specify the barriers correctly for it to work, yes.
#asahi-gpu · 2023-07-22 18:22
linaI mean it could be mesa too, I'm just not sure it's a kernel issue at this point ^^
#asahi-gpu · 2023-07-22 17:42
linaI think that might be a userspace bug then...
#asahi-gpu · 2023-07-22 17:03
linaYou could try gdb and seeing where all the threads are waiting
#asahi-gpu · 2023-07-22 17:02
linaAnd it went away after an update...
#asahi-gpu · 2023-07-22 17:02
linaI saw a different thing earlier with an older version of firefox where right clicking on a link on the GitHub page would hang it for a while, until something timed out and killed it, but it wasn't the kernel side getting wedged like before I think
#asahi-gpu · 2023-07-22 17:02
linaif firefox dies cleanly when you kill it and no kernel threads get stuck I don't think it's *that* problem
#asahi-gpu · 2023-07-22 17:01
linajannau: see if the kernel reports any blocked tasks, and same after you kill firefox... but I don't really know at this point ;;
#asahi-gpu · 2023-07-22 12:54
linaAnd of course the moment there is any overlap this whole mechanism gets disabled, it's strictly for the clean atlas use case
#asahi-gpu · 2023-07-22 12:53
linaYeah, I think I can probably just say we track up to 128 regions and then bail or something like that.
#asahi-gpu · 2023-07-22 12:50
linaI think I'm just going to try a region list thing...
#asahi-gpu · 2023-07-22 12:48
linaNo
#asahi-gpu · 2023-07-22 12:44
linaI'm seeing ~40 regions written per atlas... I wonder if we can just track a list of nonoverlapping boxes with some max like 64? It's O(n^2) but the copies/blits are way more horrible than doing 64 box intersect checks...
#asahi-gpu · 2023-07-22 12:41
linaMaps does that, but it also does much more complex atlases
#asahi-gpu · 2023-07-22 12:41
linaThe trivial case is four quadrants get written, and then you elide the copies for the first 3 but the 4th overlaps the bounding box
#asahi-gpu · 2023-07-22 12:40
linaUnfortunately 3D box tracking isn't enough for this case since it's an atlas
#asahi-gpu · 2023-07-22 12:40
linaThe current code already plays this game for 1D buffers using a dedicated range thing, but I originally wrote that with 3D box tracking before I realized we had that range thing.
#asahi-gpu · 2023-07-22 12:40
lina3D box actually
#asahi-gpu · 2023-07-22 12:39
linajust basic 2D box tracking, nothing finer grained
#asahi-gpu · 2023-07-22 12:33
linaIt's 2700 lines of code...
#asahi-gpu · 2023-07-22 12:29
linaThat way we don't have to involve all that code most of the time
#asahi-gpu · 2023-07-22 12:29
linaI guess if we use that, the heuristic would be to track the valid rectangle the first time a resource is written, then the next time check whether the new write overlaps (which we can do with a simple box check), and if it doesn't upgrade it to full fancy rect union tracking
#asahi-gpu · 2023-07-22 12:26
linaAt least it looks like it's the same license, so maybe we can actually lift the code...
#asahi-gpu · 2023-07-22 12:25
linaI'd need something in mesa... ^^;;
#asahi-gpu · 2023-07-22 12:21
linaAll those shadows/flushes can be completely elided, since it always writes to an uninitialized portion to the buffer... but we need to track that at the 2D level now to make this work.
#asahi-gpu · 2023-07-22 12:20
linaI have no idea how I'd fix this without outright storing a complete per-pixel validity mask???? Is there some data structure that can efficiently handle this?
#asahi-gpu · 2023-07-22 12:20
linaOK, so Google Maps is doing this completely horrible thing where it creates several 1024x1024 texture atlases, then repeatedly uploads a nonoverlapping block with glTexSubImage2D and immediately draws it.
#asahi-gpu · 2023-07-22 11:00
linaTry ASAHI_MESA_DEBUG=nowc to fix the uncached reads issue, but even with that it still stutters (but then maybe profiling will point at something else?)
#asahi-gpu · 2023-07-22 10:59
linaella-0: Maps is still stuttering though, but I'm not so sure where the problem is any more. At least it doesn't bloat RAM though.
#asahi-gpu · 2023-07-22 09:02
linaOoooogh and there's another big silly, the BO cache can return (sometimes wildly) oversized objects and then we go ahead and shadow them whole!
#asahi-gpu · 2023-07-22 08:54
linaIt's doing many alternate draws reading a framebuffer and mapping it for write, and we're pathologically shadowing it every time which is both horribly slow and blows up memory usage.
#asahi-gpu · 2023-07-22 08:48
linaIt's resource shadowing.
#asahi-gpu · 2023-07-22 08:32
linaThey do get cleaned up when they complete but... I'm seeing batches holding on to 100+ screen size (or even larger) render targets

plus ›