#
…

2023-02-15

00:10seeeath has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
00:13seeeath has joined #asahi-gpu
00:15seeeath has quit []
00:16kesslerd has joined #asahi-gpu
00:16seeeath has joined #asahi-gpu
01:08hightower4 has quit [Remote host closed the connection]
01:08hightower4 has joined #asahi-gpu
01:29hightower4 has quit [Ping timeout: 480 seconds]
01:31seeeath has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
01:34seeeath has joined #asahi-gpu
02:03kesslerd has quit [Quit: Leaving]
02:17seeeath has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
02:47seeeath has joined #asahi-gpu
03:01seeeath has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
03:26alyssalina: Any chance I could get some pre-stream code review? *sweats*
03:41seeeath has joined #asahi-gpu
03:41seeeath has quit []
03:57seeeath has joined #asahi-gpu
04:28stipa has quit [Read error: Connection reset by peer]
04:29stipa has joined #asahi-gpu
05:20seeeath has quit [Read error: Connection reset by peer]
05:21seeeath has joined #asahi-gpu
05:23seeeath_ has joined #asahi-gpu
05:26seeeath__ has joined #asahi-gpu
05:29seeeath has quit [Ping timeout: 480 seconds]
05:30seeeath has joined #asahi-gpu
05:31seeeath_ has quit [Ping timeout: 480 seconds]
05:35seeeath__ has quit [Read error: Connection reset by peer]
05:35seeeath_ has joined #asahi-gpu
05:40seeeath has quit [Ping timeout: 480 seconds]
05:52seeeath has joined #asahi-gpu
05:53seeeath__ has joined #asahi-gpu
05:55seeeath_ has quit [Read error: Connection reset by peer]
05:55seeeath__ has quit [Read error: Connection reset by peer]
05:58seeeath_ has joined #asahi-gpu
06:00seeeath has quit [Ping timeout: 480 seconds]
07:11WindowPa- has joined #asahi-gpu
07:11WindowPain has quit [Read error: Connection reset by peer]
07:51MajorBiscuit has joined #asahi-gpu
08:44gorbypark has joined #asahi-gpu
08:45gorbypark has quit [Quit: Konversation terminated!]
08:45gorbypark has joined #asahi-gpu
08:51gorbypark has quit [Quit: Konversation terminated!]
10:07linaalyssa: This is triggering on the EGL testsuite: Assertion `maxx > minx && maxy > miny' failed
10:07linadEQP-EGL.functional.swap_buffers_with_damage.resize_after_swap.buffer_age_render
11:07cylm has quit [Read error: Connection reset by peer]
11:58danielslina: which winsys?
12:00MajorBiscuit has quit [Ping timeout: 480 seconds]
12:11linadaniels: x11/egl (I think that's what the dEQP build picked by default?)
12:19danielstry either skipping that subset of tests, or EGL_PLATFORM=surfaceless
12:20danielsthe latter is good anyway if you don't want your running session to get trashed
12:30MajorBiscuit has joined #asahi-gpu
12:46possiblemeatball has joined #asahi-gpu
12:52alyssalina: K, will look when I get a chance
12:52alyssa(unlikely to be today)
13:06seeeath_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
13:19alyssa has quit [Quit: leaving]
13:33linaalyssa: With that commented out, we pass all the EGL tests except robust_gl_3* context creation stuff which sounds not applicable... ^^
13:33linaI did fix some more threading bugs ^^
13:53kesslerd has joined #asahi-gpu
14:02cylm has joined #asahi-gpu
14:09Cyrinux9 has quit []
14:09Cyrinux9 has joined #asahi-gpu
14:20kesslerd has quit [Ping timeout: 480 seconds]
15:11seeeath has joined #asahi-gpu
15:18lina800x600 surfaceless glmark score: 4496
15:26linaPushed all the explicit sync stuff to gpu/explicit-sync (kernel) and agx/explicit-sync (mesa), seems to work well ^^
15:32linaOne little thing: sometimes you get GPU faults when killing things. Since everything is async now and BOs are tracked by userspace, if userspace dies in-progress GPU operations lose their BOs. The driver itself keeps all the critical structures alive until the jobs complete/fail, so nothing breaks, you just get GPU fault logs.
15:38alyssa has joined #asahi-gpu
15:38alyssalina: niiiiice :)
15:39alyssathanks for the heads up about exit faults
15:39alyssaas long as the fault handling is nice and robut that sounds fine :)
15:40linaI'm still not sure if the firmware stuff is really 100% robust yet, we'll find out when I turn on timestamps again since that made it really obvious in the past.
15:41linaAlso perf works again. It was an upstream regression (on all ARM!), jannau found it while I was busy with mesa ^^
15:42alyssaahahahah got it nice
15:42alyssasounds like I got a kernel upgrade to do
15:42alyssawill this make my supertuxkart go brr
15:42linaI'm regularly hitting 200+ FPS on xonotic now at least ^^
15:43alyssayeah that's a nice bump
15:43alyssaa few more fps is good ;0
15:44jannauno, just on all arm without the standard arm PMUv3
15:44linaAny ideas on how to land this? Most of the changes are in general code, but then end up talking to syncobjs of course. At this point we probably want to drop macOS first?
15:45linajannau: Oh, I thought it was more general. So basically just Apple then?
15:46jannauyes. apple, x-gene and thunderx2
15:47linaalyssa: I also did some perf opt on the kernel side, there was some easy low-hanging CPU fruit with array initialization that gave me an extra 10% or so on glmark (for 4000+ FPS workloads, won't do as much for things that are more GPU-limited)
15:48linaAt this point I think the next biggest submission overhead thing is just memory allocs, so I probably want to add some general mechanism to pool together random unrelated allocs for a single submission. But that can probably wait a bit.
15:48alyssalina: Please send the "drop macOS" MR, I'll review and merge
15:48alyssaand rebase your branch on top of that
15:48linaalyssa: Okay ^^
15:49linaI couldn't figure out how to get real-time traces, so I don't know how much of the overhead is context switching, mailbox stuff, etc.
15:51alyssalina: "asahi: Fix shader key cloning overreads"
15:51alyssaI'm regretting the unsafe union
15:51linaI think a compiler upgrade started complaining about that one
15:51linaIt wasn't actually breaking anything, just warning
15:52alyssayeah I get the warning too
15:52* alyssasweats
15:53linaI'll be back in a bit, I'm going to get some conbini dinner or something
15:54* alyssabuilds new kernel
15:55bluetail9 has joined #asahi-gpu
15:55mkurz has joined #asahi-gpu
15:55alyssalina: As for how to land this... what's easiest for me is going to be
15:55alyssa1. Remove macOS upstream
15:55alyssa2. Land my outstanding asahi MRs upstream
15:56alyssa3. Rebase my agx/next upstream. It now consists of Linux UAPI patches + some feature work that's not yet ready. I drop the feature work and push an agx/linux branch.
15:56alyssa4. You rebase explicit sync on top of agx/linux and squash everything down to a new agx/linux-explicit-sync branch, that is just the new UAPI and not the old.
15:57alyssa5. I use agx/linux-explicit-sync as the new base for my feature work and pick on top.
15:57bluetail91 has joined #asahi-gpu
15:57alyssaOnly question then is whether any of the code from agx/linux-explicit-sync is *not* specific to the UAPI (and should be upstreamed ahead of the new UAPI)
15:57alyssaOnly question then is whether any of the code from agx/linux-explicit-sync is *not* specific to the UAPI (and should be upstreamed ahead of the new UAPI)
15:57bluetail98 has joined #asahi-gpu
15:58alyssaDefinitely the memctx bug fix is, and should be split off into its own MR (this can happen ahead of the macOS stuff)
15:58alyssaditto for shader key clone overread
15:58alyssathose 2/3 patches can probably go in now
16:00alyssaagx_fence.c can probably go upstream
16:00alyssaand agx_fence.h
16:00alyssasince there's nothing downstream specific about drmSyncobjWait
16:01alyssapossibly some of the agx_batch stuff could too? IDK
16:03thevar1able has joined #asahi-gpu
16:04bluetail9 has quit [Ping timeout: 480 seconds]
16:05bluetail91 has quit [Ping timeout: 480 seconds]
16:09linaMost of what I did today is not UAPI-specific, it's all the batch tracking stuff to make explicit sync work
16:09linaI didn't even though the UAPI or its wrapper
16:09alyssaYeah, I see that
16:09lina*touch
16:09alyssaIt would be nice to get that upstream
16:09alyssaI think getting everything else merged first is probably easiest to avoid conflict hell
16:10linaYeah ^^
16:12linaAny comments on the general approach? I just hacked on it until it worked, I want to know what you think about the submitted bitfield and all that
16:12alyssahaven't read it yte
16:12alyssasupposed to be doing at least 3 other things right now
16:13linaAlso right now it doesn't try to track batch-to-batch dependencies so it always does a full barrier between batches (so no vert/frag concurrency). That can clearly be fixed but then we need to be more careful about when we need to insert the barrier and not.
16:19alyssaWe never did fix that on Panfrost...
16:22seeeath_ has joined #asahi-gpu
16:24alyssanice, melty molten galaxy at native resolution is going at 55fps now
16:25alyssa.....with exclusive ubershaders (~:
16:25linaWhat was the FPS before?
16:25alyssaIDK. not that. :p
16:26linawwwwww
16:26alyssasupertuxkart (ES3 renderer) isn't helped as much as I hoped... oh well
16:26alyssaglmark2 scores are that of an adult gpu though
16:27linaterrain is like 160 now I think?
16:27alyssa128 here
16:27alyssawhere do I get the bigger fps
16:27linaWhat resolution?
16:28linaOh, did you set your CPUs to performance and pin to the p-cores?
16:28linaThe CPU scheduler is our enemy...
16:28alyssamarcan: can you make the CPU scheduler not suck? thx
16:29linaWasn't chadmed working on that?
16:29seeeath has quit [Ping timeout: 480 seconds]
16:29linaBut also I have my suspicions about mailbox hurting with that too...
16:30marcanyeah, that was chadmed and the EAS stuff
16:31alyssaok, setting CPUs to performance brings terrain up to 150
16:31linataskset to 4-7?
16:31linaI get 169 ^^
16:32alyssa157 on x11
16:32linaAh, I'm using gbm which probably gains a bit
16:33alyssaah, yeah that'll do it
16:33linaWhat numbers are you expecting for terrain vs. other GPUs?
16:33alyssaIDK I don't have other adult GPUs
16:33linaOkay what does panfrost get?
16:34alyssadepends on the mali
16:34alyssaon mali-t860, around 30fps (compared to the DDK getting 38fps iirc)
16:34alyssaon mali-g52, around 50 iirc
16:34alyssaon mali-g57, I want to say in the 70s?
16:35alyssaactually that's not even fair
16:35alyssaRK3399, Amlogic something or other, and MT8192 respectively
16:35alyssaI think SuperTuxKart was losing the cpu scheduling lottery really hard
16:35linaOkay, so we're actually doing reasonably well for a tiler ^^
16:35alyssawith explicit sync but default settings, 28fps
16:36alyssawith explicit sync but minfreq=maxfreq and taskset 0xf0, 37fps
16:36alyssathat's a huge difference
16:36alyssa(this is on Black Forest with my opinionated graphics settings)
16:36alyssa(Black Forest being the most demanding standard track)
16:36linaBTW, I just set the governor to "performance" and don't mess with frequencies
16:37alyssaoh, that's neat
16:37alyssaI'm used to governors being broken
16:37lina"performance" is just "max" ^^
16:37alyssaafter all those years living in the States...
16:37linawwwwwwwwwwwwwwwwww
16:37linaSis...
16:38alyssawhat am i not allowed to make fun of governments in north america now
16:40linaYou are, it was just unexpected wwwww
16:43kesslerd has joined #asahi-gpu
16:50alyssaquake3 is better but still dropping frames, idk what's up there yet
16:52alyssanot a priority
16:54alyssaHOLY SHIT
16:56alyssawith the latest kernel + mesa and pinning cpu to maxfreq and pinning big cores
16:56alyssat-re is up to trex is up to 196fps
16:56alyssa(was 55fps)
16:56alyssaalso, manhattan is now broken and closing it mid frame just hung my system
16:56alyssabut hey you win some you lose some
16:59alyssa^^ splat
16:59alyssait's clearly faulting every frame (some Mesa bug, presumably), that's not the issue
16:59linaOh mailbox. Oof. Yeah.
16:59alyssathe issue is then ctrl-c'ing out of the process mid-fault hangs the system
16:59seeeath_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
17:00alyssawhich is a kernel bug obviously
17:00linaAnother thing I added/fixed in this round is that GPU firmware crashes should actually cleanly abort all jobs (and mesa has an abort() in that path)
17:00linaBut this isn't that
17:00linaThis is mailbox.
17:00alyssaI will hold off on debugging manhattan until you (or marcan) fixes this since it'll be too painful otherwise
17:00linamarcan: Can we please get rid of mailbox pretty please? ;;
17:00alyssaalso, I just saw some random graphical corruption flicker on gnome
17:00linaalyssa: You can probably just increase that constant to a silly value to work around it
17:01alyssa(but no fault)
17:01alyssaso I'm guessing we're still missing some syncs somewhere
17:01alyssathere it is again uh
17:01linaKDE was glitchy as heck until I remembered that a gallium flush should be a full sync...
17:01linaBut I'm sure I missed something
17:01alyssayeah ok, gnome with two terminal windows open, tabbing between them quickly (meta+backtick) and you see sheered artefacts of the wrong terminal
17:02alyssaq17:01 < lina> KDE was glitchy as heck until I remembered that a gallium flush should be a full sync...
17:03alyssaNo, it shouldn't.
17:03alyssaGallium flush is just a flush, no sync
17:03linaOkay then there's another problem somewhere else ^^;;
17:03alyssaIf the user wants to wait for the result, they need to wait for the fence
17:03alyssait's a flush_all, not a sync_all
17:04alyssaI can't think of a case where you actually need a sync_all
17:04alyssaprobably not even context destruction
17:04linaWell KDE becomes a mess without it... so either kwin is broken or we're missing syncs in some other place...
17:04alyssadefinitely missing syncs somewhere else
17:04alyssaseeing as gnome is broken with it
17:05linaWe do need the sync_all in context destruction if we don't want faults on clean exits
17:05linaPlus without that we leak memory
17:05alyssasure, ok
17:05danielslina: is this KWin as a Wayland compositor (backing on to GBM) or as an Xorg WM?
17:05linaWayland
17:06danielsgood answer :)
17:06danielsin that case, if you're seeing horribly incomplete bits which suggest KWin's own rendering is broken (i.e. it's not due to stale client data but e.g. clients being intermingled), and you're confident that your internal batch-to-batch tracking is fine (or even oversyncing), it's probably missing synchronisation indeed
17:07danielsGallium flush only requires a hardware flush indeed, but there's a separate flush_frontbuffer which is your hook for eglSwapBuffers
17:07alyssaBoth undersyncing and oversyncing in the same driver? Wow! :-D
17:07danielsthat would be the place at which you need to place a dma_fence for all batch completions on the dma_resv, then make sure the DCP driver respects that fence
17:08linaI don't sync in flush_frontbuffer yet, I wasn't sure about that one, so maybe that's it...
17:08daniels(the other method is that KWin creates an EGLSyncKHR representing everything in that ctx being completed, exports that to a dma_fence, then places that as the IN_FENCE_FD on the plane during the KMS commit, but I don't think KWin does that, i.e. you need to rely on implicit sync for inter-device completion)
17:08linaI also have no idea what DCP does ^^;;
17:09danielsthe easiest way to find out is to grep it for prepare_fb
17:09danielsif it uses the drm_gem_shmem (IIRC) helper, then it'll wait on all fences before continuing
17:09* alyssaisn't totally sure how the batch tracking here works yet
17:09jannaudcp does nothing explicitly, if the helpers do it correctly it should work otherwise it's broken
17:09danielsbut yeah, flush_frontbuffer is your place to update the dma_resv for implicit sync - it's the handover from your rendering to an external user, be it GBM or a Wayland server
17:10alyssaoh, ok. "active" means "unsubmitted and active", "submitted" means "submitted but not yet done". got it
17:11linaI just realized we're doing a CPU copy in there right now with no sync... I clearly glossed over it way too quickly today...
17:11alyssathat's only on macOS
17:11danielsjannau: oh nice, looks like drm_atomic_helper_prepare_planes() even calls the default prepare_fb (i.e. wait on fences) for you, so if you're just using the stock atomic helpers then you shouldn't even need to set the prepare_fb func yourself
17:11linaalyssa: Yes, active used to mean both but it was more of a mess that way
17:11linaalyssa: The code is unconditional there...
17:11alyssadaniels: I was under the impression flush_frontbuffer is only used for software winsys
17:12alyssaI don't think we implement it on Panfrost, it's only in Asahi for the macOS "just pretend we're llvmpipe" code
17:12alyssathen again panfrost doesn't do explicit sync yet
17:12alyssa(I shudder in fear of the pancsf undersyncing bug reports)
17:13seeeath has joined #asahi-gpu
17:14alyssalina: Panfrost is all implicit sync so in general assume it's all broken ;)
17:14alyssaI think iris is probably the best reference here/ IDK
17:15linaI wasn't sure of what driver to look at, couldn't find a good reference for what has proper explicit sync...
17:15alyssaYeah, I'm not sure either
17:15linaSo I just winged it myself in the end ^^;;
17:15alyssaHey it's all good
17:15alyssairis with the Xe patchset is probably going to be best but idk
17:15jannauon dcp side everything should be ok then through drm_atomic_helper_commit
17:17danielseglSwapBuffers -> dri2_wl_swap_buffers_with_damage -> dri2_flush_drawable_for_swapbuffers -> DRI2flushExt::flush_with_flags(__DRI2_FLUSH_DRAWABLE | __DRI2_THROTTLE_SWAPBUFFER) -> dri_flush -> st_context_flush(ST_FLUSH_END_OF_FRAME) -> st_context_flush(ST_FLUSH_END_OF_FRAME) -> st_flush(PIPE_FLUSH_END_OF_FRAME) -> pipe->flush(PIPE_FLUSH_END_OF_FRAME) -> your driver
17:18daniels(you can replace dri2_wl_swap_buffers_with_damage with dri2_drm_swap_buffers depending on context)
17:19linaagx_flush does do the fence right, but it also didn't work when I didn't also force a full sync so clearly something is broken...
17:20bisko has quit [Quit: Textual IRC Client: www.textualapp.com]
17:20linaThen again I stole the fence code from panfrost so who knows whether it works? ^^
17:20lina*hides*
17:24danielslina: by 'do the fence right', do you mean that it'll update the excl slot in the dma_resv?
17:26linaThe function gets passed a pipe_fence_handle** and it replaces it with a new handle (that's from panfrost) which is a clone of the syncobj from the last batch flushed... is it supposed to do something different?
17:26* alyssaneeds to be eating lunch / doing homework / going to class / doing her day job right now so is going to pop off
17:26bisko has joined #asahi-gpu
17:26alyssanot being able to review WSI code right now, I don't know how I'll cope :~
17:28linaI should get some sleep... and other than the Rust meeting tomorrow night, I think I'm going to take a break until next week ^^
17:31danielslina: I mean down in the kernel driver - the agx DRM driver needs to know that it needs to update the dma_resv struct on the dma_buf struct with the fence, so then when the DCP goes to source from that dma_buf, it knows to wait first
17:31danielsthe old-school way to do that is to just put a flag on your CS ioctl that you should update the dma_resv (specifying either shared for read-only ops or excl for write/RW) with the fence generated by that CS
17:32danielsthe new-school way to do that is that gfxstrand has some helpers for Vulkan WSI which do that automatically (by using a separate dmabuf ioctl which shoves the fence into the resv without the need for the agx CS to do it), but how they're hooked up in Vulkan I don't know, and WSI is also not Gallium :P
17:34linaI think the plan was the new-school way, the kernel driver only knows about out syncobjs (which it replaces the fence on)
17:36linaAnyway, this is clearly quite broken but I think I should get some sleep ^^;;
17:36linaAt least the batch tracking works well now, I'm sure alyssa can fix WSI for us!
17:37alyssaI definitely can't
17:37alyssaI don't know anything about WSI
17:37alyssaLina is going to fix WSI, right?
17:37linaI thought you had stuff to do sis, why are you still here? ^^;;
17:37alyssa~~because I have a compulsive Internet use problem~~
17:38alyssa~~too many emails~~
17:38linamood........
17:38* linaflops
17:44kesslerd has quit [Quit: Leaving]
18:15cy8aer........
18:15cy8aer(sorry, wrong chat)
18:21lawrence has quit [Quit: The Lounge - https://thelounge.chat]
18:23lawrence has joined #asahi-gpu
18:41MajorBiscuit has quit [Quit: WeeChat 3.6]
18:59cylm_ has joined #asahi-gpu
19:01cylm has quit [Ping timeout: 480 seconds]
19:16possiblemeatball has quit [Quit: Quit]
19:16possiblemeatball has joined #asahi-gpu
19:17c10l9 has quit []
19:17c10l has joined #asahi-gpu
20:08possiblemeatball has quit [Quit: Quit]
22:58seeeath has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
…