#
…

2023-02-26

00:04possiblemeatball has joined #asahi-gpu
00:32alyssa has joined #asahi-gpu
00:32alyssalina: I've squashed+rebased your explicit sync patches
00:32alyssa(the mesa ones, obviously didn't touch the kernel)
00:40alyssaand agx/next has everything integratino
00:40alyssaHowever, there are some regressions
00:42alyssa1. Even with ASAHI_MESA_DEBUG=sync, there are serious sync glitches with Firefox, at least when WebRender is used (as is the case on agx/next, didn't test without). This is a WSI issue: it happens in GNOME but not in Sway. It might also have to do with Xwayland vs native wayland.
00:43alyssaAt least with (explicit sync + Firefox + WebRender + GNOME), the rendered content is sometimes from a previous frame instead of a current frame, or at least partially so
00:43alyssaThe most obvious symptom is typing into some input fields and not seeing the most recently typed character
00:44alyssaThis is especially noticeable when typing into chat in discord.com
00:44alyssaThere are other visual artefacts with Firefox in GNOME, but I assume they have the same root cause
00:45alyssa(and the glitching when typing is especially noticeable so probably easier to work with)
00:46alyssaI'm unsure if {Plasma, Firefox without WebRender} are affected but IMO this regression is blocking even if it's not ... and unless this is a Firefox bug it seems likely it can be hit with things other than Firefox, this is just what I noticed on day #1 of testing
00:47alyssa2. For some reason one of the apitraces I have runs fine (and much faster I think!) in debugoptimized, but faults in release. I have not yet root caused this one. This is not blocking.
00:49alyssaOnce the Firefox regression is sorted, asusming no other regressions come up this week, I'll cut a new asahi/main release on top of the explicit sync UAPI and that should be good to go then
00:58hightower2 has quit [Ping timeout: 480 seconds]
00:59alyssahm wait the apitrace might be from my sysval rewrite being broken
00:59alyssascratch #2
01:16nela has quit [Ping timeout: 480 seconds]
01:19alyssacan't reproduce now
01:19alyssamaybe I screwed something up
01:26alyssaAlso, I am not convinced that it's necessary to sync in flush_resource
01:26alyssafreedreno + explicit sync doesn't seem to do anything for flush resource
01:26alyssathis is worth another 6% on manhattan
01:26alyssaoh but holy broken
01:27alyssaso what other fence is freedreno using that we're not
01:36* alyssadoesn't trust any of the fencing code
01:36nela has joined #asahi-gpu
01:38alyssaI'm especially suspicious of agx_fence_create
01:39alyssaand all this ctx->syncobj stuff doesn't make much sense to me in an explicit sync world
01:39alyssamaybe if I fix that, firefox will fix itself
01:41alyssathis stuff is way too complicated
01:52alyssalina: Potential race, what happens if we flush (but do not sync) a batch writing resource A?
01:53alyssabefore that batch is completed, there is a second batch that reads resource A that gets flushed
01:53alyssaIs there a possibility that the second batch reads the wrong contents of A?
01:54alyssaIt's submitted in the proper order but I don't see any fence/barrier between the two batches (i.e. in agx_flush_writer for batches that are submitted and not active)
01:59alyssahonestly I don't understand how any of agx_flush/agx_fence_create work
01:59alyssaand every driver I look at does something different and the docs are pretty vague
01:59alyssafreedreno is probably closest to what we want, but
02:03akspecs_ has joined #asahi-gpu
02:04tertu2 has joined #asahi-gpu
02:04nepeat_ has joined #asahi-gpu
02:05codingkoopa3 has joined #asahi-gpu
02:06Lightsword_ has joined #asahi-gpu
02:07Z750 has quit [resistance.oftc.net larich.oftc.net]
02:07djorz has quit [resistance.oftc.net larich.oftc.net]
02:07tertu has quit [resistance.oftc.net larich.oftc.net]
02:07akspecs has quit [resistance.oftc.net larich.oftc.net]
02:07nepeat has quit [resistance.oftc.net larich.oftc.net]
02:07wicastC has quit [resistance.oftc.net larich.oftc.net]
02:07alyssa has quit [resistance.oftc.net larich.oftc.net]
02:07hxliew has quit [resistance.oftc.net larich.oftc.net]
02:07Lightsword has quit [resistance.oftc.net larich.oftc.net]
02:07codingkoopa has quit [resistance.oftc.net larich.oftc.net]
02:07hxliew has joined #asahi-gpu
02:08wicastC has joined #asahi-gpu
02:10Z750 has joined #asahi-gpu
02:11alyssa has joined #asahi-gpu
02:14linaalyssa: All batches are submitted with BARRIER_RENDER | BARRIER_COMPUTE, which tells the backend code to insert a fence on the last render and compute commands submitted (if any - the kernel will elide that if it already got a completion notification and it knows the GPU queue is idle, since at that point it doesn't even have event IDs attached so there is nothing to fence on)
02:15linaOn the other hand, we could elide that when we know we do *not* have such a dependency, which I was thinking is the case whenever we submit batches back to back (e.g. whenever we flush_all and there is more than one batch to flush, I think we can avoid that barrier for all but the first, since they're guaranteed not to have any dependencies, otherwise they would have been flushed already), but right now
02:15linawe don't
02:16linaThis is the "currently vertex and fragment are serialized" issue (if you remove those barriers, vertex for batch+1 can run concurrent with fragment for batch)
02:17linaOf course this is all cache issues aside. If we run into cache issues between back to back submissions themselves (like the CPU->GPU one I ran into) we probably need to set more bits in that VDM Barrier command...
02:17linaI still don't know exactly what caches the firmware flushes, when, and how to control any of that. We still have at least 3 mystery bits of freedom in the submission commands.
02:19linaAs for the WSI, my understanding is that that ctx->syncobj is supposed to just track the last submitted batch, so that when WSI wants a barrier on "all past work" we just clone that.
02:19linaBut there is the whole attaching fences to dma-bufs story that I haven't looked at at all... I don't know how the mesa hooks for that work, if it isn't all taken care of by gallium already based on the existing fence support...
02:20alyssaright.. ok
02:20alyssaI'm not worried about optimizing those barriers(yet)
02:20alyssaI am worried about the WSI story
02:21alyssaand the firefox wonkiness suggests that not all is right in oz
02:21linaLet me look for the DMA-BUF stuff...
02:21linaFingers crossed it's a magic cap we set and mesa does it for us ^^
02:22alyssahahahaha :(
02:22linaI get the feeling what we're doing now is *sufficient* for correct WSI but may not be what is actually expected of us...
02:24linaalyssa: Good news: it's in common WSI code! Bad news: it's in common *Vulkan* WSI code. ^^;;
02:24alyssaYeah, that's what I expected
02:24linaOkay, now where do I plug this in for us...
02:24kesslerd_ has joined #asahi-gpu
02:24djorz has joined #asahi-gpu
02:25alyssaWe might be the first 100% explicit sync gallium driver
02:25alyssathat's kinda neat :p
02:25linaSo do, like, other pure explicit sync drivers not exist? Because that is the only usage of this API anywhere in mesa...
02:25alyssaNo, I don't think they do
02:25linaOof...
02:26alyssaIt wasn't been possible to have a pure explicit sync Linux (not Android) driver before the ioctls
02:26alyssaand those landed this year
02:26alyssaso any driver older than that necessarily has an implicit sync path for WSI
02:26linaRight...
02:27alyssaso it's just us and powervr
02:27alyssaand they're not bothering with gl
02:27alyssaand also are not a driver yet
02:28alyssaI see DMA_BUF_IOCTL_EXPORT_SYNC_FILE and DMA_BUF_IOCTL_IMPORT_SYNC_FILE in there for their gallium driver
02:28linaYay! ^^
03:40cylm has joined #asahi-gpu
05:05possiblemeatball has quit [Quit: Quit]
05:17kesslerd has quit [Remote host closed the connection]
05:18kesslerd_ has quit [Remote host closed the connection]
05:19kesslerd has joined #asahi-gpu
05:34kesslerd has quit [Remote host closed the connection]
07:09linaalyssa: Fixed the Firefox issue, it turns out we need to make resources shareable in flush_resource... so now it has to blit if not already shareable.
07:09linaAlso the ail stuff for multisampling compression is wrong, I threw in a random guess but that needs tests. That fixed WebGL Aquarium.
07:10linaI also added some nice debugging stuff along the way and more asserts ^^
07:16linaWooooah I don't know if this is me removing the sync in flush_resource or something you did, but glmark2 just jumped up a ton. Like, from 4500 to 6600 (!!)
07:17linaWait and that's a debug build
07:18linaNow hitting over 9000 FPS on some tests...
07:21linaThat's on GBM, a bit less on Wayland but the output looks legit... I don't think it's fast because it's broken...
07:29linaRelease build GBM score: 7252 ^^
09:48bisko has joined #asahi-gpu
10:08wixde has joined #asahi-gpu
10:25bisko has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
10:42nyilas has joined #asahi-gpu
10:45chipxxx has joined #asahi-gpu
10:50chip_x has quit [Ping timeout: 480 seconds]
10:54chip_x has joined #asahi-gpu
10:57chip__ has joined #asahi-gpu
10:58chip_x has quit [Remote host closed the connection]
11:00chipxxx has quit [Ping timeout: 480 seconds]
11:38hightower2 has joined #asahi-gpu
11:42wixde has quit [Ping timeout: 480 seconds]
11:45ChaosPrincess has quit [Quit: WeeChat 3.8]
11:46ChaosPrincess has joined #asahi-gpu
11:46chip_x has joined #asahi-gpu
11:52chip__ has quit [Ping timeout: 480 seconds]
13:11possiblemeatball has joined #asahi-gpu
13:26kesslerd has joined #asahi-gpu
13:28kesslerd has quit []
13:35chipxxx has joined #asahi-gpu
13:39maria6 has joined #asahi-gpu
13:39maria has quit [Ping timeout: 480 seconds]
13:39maria6 is now known as maria
13:40chip_x has quit [Ping timeout: 480 seconds]
14:37chipxxx has quit [Remote host closed the connection]
14:37chipxxx has joined #asahi-gpu
14:40wixde has joined #asahi-gpu
14:44Cromulent has joined #asahi-gpu
15:15linaI still get some weird hangs though... I think something is still broken, probably in WSI ^^;;;
15:16linaBut at least xonotic now regularly reaches the default 250fps cap!
15:20le0n has quit [Remote host closed the connection]
15:21le0n has joined #asahi-gpu
15:35bisko has joined #asahi-gpu
15:42bisko has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
15:43kesslerd has joined #asahi-gpu
15:44kesslerd has quit []
15:47bisko has joined #asahi-gpu
15:53wixde has quit [Ping timeout: 480 seconds]
15:55bisko has quit [Ping timeout: 480 seconds]
15:55kesslerd has joined #asahi-gpu
15:56wixde has joined #asahi-gpu
16:08chip_x has joined #asahi-gpu
16:14chipxxx has quit [Ping timeout: 480 seconds]
16:53bluetail has quit [Quit: The Lounge - https://thelounge.chat]
16:56bisko has joined #asahi-gpu
16:59cy8aer has quit [Remote host closed the connection]
17:04bisko has quit [Ping timeout: 480 seconds]
17:11bluetail has joined #asahi-gpu
17:13cylm has quit [Ping timeout: 480 seconds]
17:17alyssalina: Sounds like good progress :)
17:17alyssaafaict there are a lot of multisampling issues
17:17alyssaand I'm still not convinced there's not a register or two we're not yet exposing in the uapi so I was going to leave it to you to work through the deqps when you had some time
17:39alyssaand glmark hangs my system now
17:39alyssaso gonna say something regressed
17:40alyssabut yknow
17:40alyssa2 steps fwd 1 step back
17:41alyssawhat the heck
17:41alyssano faults so what's up. an OOM maybe? idk
17:42alyssanothing in dmesg at the time of the hang, bizarre
17:43alyssaonly happening in gnome maybe
17:44alyssatrex 225fps now
17:45alyssamh 85fps
17:45alyssaso that's definitely better
17:47alyssaworth another few fps on stk
17:51alyssabtw the flush in agx_fence_create is redundant with the one in its only caller
17:51alyssathat only interaction still makes me confused tbh
17:54alyssafixing MAX_BATCHES brings mh up to 125fps
17:56alyssaooh and now t-rex is faulting that's neat
17:56alyssaor hanging the system
17:56alyssayeah i'm going to say this isn't quite ready yet :)
17:57alyssahopefully the same root cause as your weird hangs
18:03alyssafew more fps on stk
18:04alyssagetting a lot of random pink rectangles.
18:31Cromulent has quit [Quit: Connection closed for inactivity]
18:34possiblemeatball has quit [Quit: Quit]
19:04bisko has joined #asahi-gpu
19:08possiblemeatball has joined #asahi-gpu
19:13bisko has quit [Ping timeout: 480 seconds]
19:35Dementor has quit [Read error: Connection reset by peer]
19:35Dementor has joined #asahi-gpu
20:01bisko has joined #asahi-gpu
20:09bisko has quit [Ping timeout: 480 seconds]
20:18bisko has joined #asahi-gpu
20:26bisko has quit [Ping timeout: 480 seconds]
20:49nyilas has quit [Remote host closed the connection]
20:52bisko has joined #asahi-gpu
20:58wixde has quit [Read error: Connection reset by peer]
21:00bisko has quit [Ping timeout: 480 seconds]
21:18chipxxx has joined #asahi-gpu
21:23bluetail has quit [Quit: The Lounge - https://thelounge.chat]
21:24chip_x has quit [Ping timeout: 480 seconds]
21:32chipxxx has quit [Remote host closed the connection]
21:32chipxxx has joined #asahi-gpu
21:42pbsds has quit [Quit: The Lounge - https://thelounge.chat]
21:43pbsds has joined #asahi-gpu
21:58bluetail has joined #asahi-gpu
22:04FLHerne_ has joined #asahi-gpu
22:05grange_c68 has joined #asahi-gpu
22:05JoshuaAshton has quit [Ping timeout: 480 seconds]
22:05qdot has quit [Read error: Connection reset by peer]
22:05qdot has joined #asahi-gpu
22:05akemin_dayo has quit [Remote host closed the connection]
22:05JoshuaAshton has joined #asahi-gpu
22:05FLHerne has quit [Read error: Connection reset by peer]
22:06FLHerne_ is now known as FLHerne
22:06grange_c6 has quit [Write error: connection closed]
22:06grange_c68 is now known as grange_c6
22:06akemin_dayo has joined #asahi-gpu
22:17alyssalina: [ 157.505449] apple-mailbox 206408000.mbox: Try increasing MBOX_TX_QUEUE_LEN
22:17alyssa[ 157.512331] asahi: WorkQueue: Job::submit() out of order (submit_seq 22491 != 22493)
22:17alyssathat doesn't sound great
22:17alyssaMESA: warning: [Batch 8] Render (pending): TVB 0/ 0 bytes (0 ovf) | vtx 0.000000 frag 0.000000
22:17alyssaThrive: ../src/gallium/drivers/asahi/agx_batch.c:228: agx_batch_print_stats: Assertion `info->status == DRM_ASAHI_STATUS_COMPLETE' failed.
22:17alyssathis is from running
22:17alyssa$ MESA_GL_VERSION_OVERRIDE=3.3 ASAHI_MESA_DEBUG=deqp DISPLAY=:0 apitrace replay --loop=1000 ~/Downloads/godot-thrive.trace
22:18alyssaand branch agx/explicit-sync-wsi-re
22:19alyssawith =sync, it works but with lower perf
22:21svencongrats, sounds like you also broke mailbox :D
22:21alyssasven: Woo!
22:22sventhe only other time I managed to run into that “increase MBOX_TX_QUEUE_LEN” was with DCP
23:00yrlf has quit [Quit: The Lounge - https://thelounge.chat]
23:01yrlf has joined #asahi-gpu
23:31rowanG337 has joined #asahi-gpu
23:40possiblemeatball has quit [Quit: Quit]
23:53stipa is now known as Guest6002
23:53stipa has joined #asahi-gpu
23:55Guest6002 has quit [Ping timeout: 480 seconds]
…