00:21mareko: Mesa has a tiny x86 assembler, so in theory it could do NIR -> x86
00:23mareko: the GL select mode uses a geometry shader now, so draw is only used by rasterpos and feedback mode, and rasterpos is a single shader thread that could run quickly on x86
00:32airlied: we have aarch64 users though, so I'm not sure we'd care for x86 only answers
00:32airlied: since we have llvm for x86 anways
00:33airlied: unless we start adding NIR cpu backends :-P
00:34zmike: I can't imagine such a thing would ever work
00:37HdkR: <- This guy using AArch64 + Radeon https://cdn.discordapp.com/attachments/702040551893106732/1192265498260406345/IMG_1482.jpg?ex=65a872c6&is=6595fdc6&hm=c35650b84cd9a8ce3f874f41c1ca9870d9a2796f104734fde5cb62e6a073b340&
00:42airlied: zmike: you don't have to imagine it, just fund it :-P
00:43zmike: I'll put in $20 that says it doesn't work
00:44karolherbst: zmike: why wouldn't it tho?
00:44karolherbst: shit... now I gonna have to do it, no?
00:46zmike: I don't know why you'd bother, there's no way you'd ever get it to even run glxgears
00:47karolherbst: your taunts do nothing
00:47karolherbst: 🙃
00:47zmike: just stating facts
00:47zmike: you're too busy with rusticl anyway
00:47karolherbst: true
00:48Sachiel: software rasterizer in OpenCL C
00:48karolherbst: no
00:48karolherbst: somehow just compile mesa for CL C
00:49airlied: I wonder which I could make happen first, this 18 hours cts run or a nir exec :-P
00:50karolherbst: my best are on nir exec
00:50karolherbst: *bets
00:51zmike: airlied no.
00:51zmike: focus.
00:51karolherbst: just do it airlied
00:51zmike: just think of all the useful things you could be doing instead
00:51zmike: like
00:52karolherbst: supporting function calls in aco
00:52karolherbst: zmike: oh btw, have any ideas to fix the use-after-free? I wouldn't even mind fixing it myself
00:55airlied: I'm trialing introducing coffee so I do have to restrain major impluses to write stuff
00:56mareko: coffee is a hell of a drug
00:57zmike: karolherbst: yes, in short the zink_batch_state structs need to become screen-owned such that, upon a context being created or destroyed, they are cached/retrieved under lock from the screen instead of being destroyed
00:57karolherbst: ahh
00:57zmike: I was planning to do it tomorrow or friday since I have fewer calls, but feel free if you want to
00:58karolherbst: let me give it a shot tomorrow and I'll tell you if I get annoyed or give up
00:58zmike: ok
00:59zmike: the gist is you need to still clear all the batch states on ctx destroy but then not free them, and then on ctx/batch_state creation you need to reinit the cached batch states so they "belong" to the new ctx
00:59karolherbst: yeah...
00:59zmike: very little new code, just some moving
01:00mareko: or rusticl could be enabled for softpipe
01:00karolherbst: pain
01:01zmike: it would have to have a compelling name to justify the work
01:01zmike: and surely no one is that clever
01:08jenatali: Softicl?
01:21mareko: vulkan on softpipe could be called cloggedpipe
01:36alyssa: zmike: congrats on your chairmanship :)
01:36karolherbst: what did mike get himself into this time?
01:36HdkR: Something like a Herman Miller or more a recliner situation? :P
01:36airlied: khr gl/gles chair
01:36karolherbst: fun
01:36alyssa: an aeron
01:37karolherbst: congrats tho
01:37airlied: konstantin, zmike : finally the lvp descriptor size reduction is assigned to marge
01:50karolherbst: zmike: guess that wasn't hard after all 🙃
01:50karolherbst: basically done
01:52karolherbst: well.. I have a bug, I never reuse the batches :D
02:00karolherbst: ohh.. I forgot to reassign the context...
02:05alyssa: airlied: re 54232bee06a ("llvmpipe: flush resources on sampler view binding"),
02:05alyssa: is that actually required?
02:05alyssa: It seems to be papering over a test bu
02:05alyssa: bug
02:12alyssa: The GLES version of the test has the barrier, the GL one doesnot
02:13karolherbst: zmike: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26889
02:14alyssa: divergence is alrady in "Import Khronos OpenGL CTS"
02:14alyssa: whee
02:14karolherbst: ehh...
02:15karolherbst: I forgot to update `last_free_batch_state` in one area ..
02:16karolherbst: fixed
02:19alyssa: divergence is old
02:22airlied: alyssa: that wouldn't surprise me, I was probably in a just pass tests mode when I wrote it
02:23alyssa: airlied: ack
02:23alyssa: I am.. pretty sure the test is busted and the bug takes back to 2014
02:33alyssa: airlied: filed https://gitlab.khronos.org/Tracker/vk-gl-cts/-/issues/4867
02:35airlied: alyssa: nice, will happily burn that fix once that lands
02:35alyssa: :)
03:34JoshuaAshton: Lynne: Thanks for hooking up ffmpeg h265 encode, it's much easier to follow than that weird NVIDIA sample that's incredibly confusing and weird
09:29dj-death: should the divergence analysis pass be dealing with registers?
09:29dj-death: looks like nothing does currently for registers created with nir_lower_locals_to_regs()
09:42dj-death: div 32 %117 = @decl_reg () (num_components=1, num_array_elems=0, bit_size=32, divergent=0)
09:42dj-death: ah maybe there is another problem actually :)
10:30jfalempe: If I add a macro like drm_for_each_legacy_plane (https://elixir.bootlin.com/linux/latest/source/include/drm/drm_plane.h#L923) checkpatch complains with
10:30jfalempe: ERROR: Macros with complex values should be enclosed in parentheses
10:31jfalempe: but adding parentheses here is not possible, is that ok as there are already a few macros like this in this file ?
10:58MrCooper: jfalempe: I'd say yes, checkpatch is more like a guideline than a law anyway
11:06Lynne: JoshuaAshton: did you test my branch?
11:13jfalempe: MrCooper, ok, thanks.
11:28MrCooper: huh, ssh's ObscureKeystrokeTiming feature makes gitk run very slowly via X11 forwarding
11:46jani: jfalempe: you do need to wrap plane in parens in for_each_if (plane->type == DRM_PLANE_TYPE_OVERLAY)
11:48tzimmermann: jfalempe, about that caching issue: did you read https://www.kernel.org/doc/html/next/x86/mtrr.html ?
11:49tzimmermann: there's a section on removing mtrrs via /proc/mtrr
11:49tzimmermann: how does the RT process behave if you remove the VRAM's mtrr?
11:49jani: jfalempe: -> has a higher precedence than e.g. & or *. passing &plane to that macro would end up being parsed as &(plane->type) instead of (&plane)->type as intended
13:05jfalempe: jani, I already put all plane under (plane), but that's not enough for checkpatch, it wants the whole macro under ()
13:07jfalempe: tzimmermann, Yes I read a bit about mtrr, but it should do the same as removing the devm_arch_phys_wc_add() call ?
13:09jfalempe: tzimmermann, ah so it can be done from userspace, without having to modify the mgag200 driver ?
13:09tzimmermann: jfalempe, exactly
13:10tzimmermann: i'm currently trying your instructions on my dl120 machine
13:10tzimmermann: clearing the mtrr reg seems to have an impact on the latency
13:10jfalempe: tzimmermann, looks strange to change the memory mapping in the "back" of the driver, but I can try that.
13:11tzimmermann: jfalempe, i have to boot the kernel with 'nopat' to enable the mtrr
13:12tzimmermann: then ' echo "disable=2" >| /proc/mtrr
13:12tzimmermann: reg02 is the framebuffer, hence disable=2
13:12tzimmermann: and then the latency goes down for the test
13:13tzimmermann: you could do this via ioctl from within the RT process
13:13tzimmermann: or in a wrapper script
13:13tzimmermann: and then re-enable the mtrr if the RT process goes away
13:15jfalempe: tzimmermann, ok, I 'll try to get access to that server again, but that sounds good.
13:22tzimmermann: i could not find a way to manipulate the PAT entries from userspace, though
13:25jfalempe: tzimmermann, are there side effect to disable PAT ?
13:27tzimmermann: you have to try. on my dl120, pat only affects the framebuffer memory
13:27tzimmermann: there's non here
13:27tzimmermann: have a look at https://www.kernel.org/doc/html/v5.7/x86/pat.html
13:27tzimmermann: under "PAT debugging"
13:39tzimmermann: jfalempe, i'm looking at this comment: https://elixir.bootlin.com/linux/latest/source/include/linux/io.h#L152
13:40tzimmermann: IIUC the PAT tables are only relevant if we want to mmap the vram pages to userspace
13:40tzimmermann: but we don't do this any longer
13:40tzimmermann: maybe there's a little driver cleanup lurking here
13:41tzimmermann: i have to investigate this
13:42jfalempe: yes, there is no need for the userspace to directly write the VRAM.
13:43tzimmermann: if we remove the call devm_arch_io_reserve_memtype_wc() from mgag200, it's like using nopat
13:43tzimmermann: and devm_arch_phys_wc_add() would be a no-op; so there's no mtrr set up for the framebuffer
13:44tzimmermann: BTW: i've foudn that we need to use devm_ioremap_wc() at https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/mgag200/mgag200_drv.c#L153
13:44tzimmermann: the current call is incorrect
13:44tzimmermann: there's no apparent difference in proactice, but still
13:45tzimmermann: s/proactice/practice
13:54jfalempe: ok so we can remove devm_arch_io_reserve_memtype_wc() and devm_arch_phys_wc_add(), and change devm_ioremap() to devm_ioremap_wc() ?
13:55tzimmermann: jfalempe, let me test first
13:55tzimmermann: we should keep devm_arch_phys_wc_add(), but it's a no-op if PAT has been enabled
13:56tzimmermann: let me do some testing and see if how the latency changes
13:56jfalempe: ok
13:57jfalempe: on my server, the /proc/mtrr approach works. (it was reg08, so disable=8)
13:58tzimmermann: great. so we have sound fallback if the driver cleanup doesn't do it
15:06Company: here's a random question that confuses me:
15:06Company: It turns out I forgot glBindAttribLocation() calls in my code, yet everything worked fine for me on all my machines and with all drivers and versions - software, zink, Intel, AMD
15:06Company: that part is fine
15:07Company: however, mclasen - who has the same laptop as me - had broken rendering due to that
15:07Company: the only difference being that he's on rawhide and I'm on F39
15:07Company: but they're both Mesa 23.3
15:07Company: what can cause that?
15:08Company: and the difference was with both Intel and swrast
15:14karolherbst: UB being UB
15:15Company: I'm interested in what's causing it
15:15karolherbst: could be related to MESA_NO_ERROR
15:19Company: that would mean that rawhide runs with MESA_NO_ERROR?
15:20karolherbst: mhhh... does rawhide have different compile flags?
15:22karolherbst: but I'd assume that you run with MESA_NO_ERROR for whatever reasons, as this will just skip over API errors... but anyway, kinda hard to judge what's going on here without debugging it
15:23Company: running with MESA_NO_ERROR=1 doesn't cause any issues for me at least
15:23Company: but maybe there's still shader caches
15:24Company: I'm mostly curious so I can detect things like that when they happen in the future
15:24karolherbst: what about when you run with `MESA_NO_ERROR=0` and your glBindAttribLocation call removed
15:25karolherbst: mhh
15:25karolherbst: Company: tried creating a gl debug context?
15:25karolherbst: I think debug builds of mesa do that by default
15:25karolherbst: might also change some of the UB or something
15:25karolherbst: MESA_DEBUG=context
15:26MrCooper: it could just be uninitialized memory, which happens to have contain different values on different systems?
15:26Company: MrCooper: I tried both asan and valgrind and they found nothing
15:26karolherbst: something like that
15:28karolherbst: anyway, I'd check with "MESA_DEBUG=context" with your glBindAttribLocation calls removed, just to see if any errors are printed
15:28Company: nope
15:28Company: there aren't any
15:29karolherbst: maybe there are on mclasens system
15:29karolherbst: I guess it's an gtk4 app or something?
15:29karolherbst: or some other toolkit?
15:29karolherbst: maybe something changed there as well
15:30Company: it's the new GTK4 renderer - but we're both running the same commit
15:30karolherbst: of gtk4?
15:30Company: yeah
15:30karolherbst: interesting...
15:30Company: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/6588
15:30karolherbst: worst case do an apitrace and see what's different
15:31karolherbst: mhh
15:31Company: I'm pretty sure the apitrace would be identical
15:31karolherbst: seems like mclasen doesn't have any additional errors
15:31karolherbst: well
15:32Company: I mean it works with the BindAttribLocation calls added
15:32Company: but I'm still stumped by why seemingly identical code lead to different results
15:32karolherbst: welcome to driver development
15:33Company: and I haven't yet been brave enough to dive into how mesa assigns locations
15:33Company: well, it happened the same for all drivers
15:33Company: including software
15:34karolherbst: sure, but the bug exists or doesn't depending on the system
15:34Company: right - independent of hardware apparently
15:34karolherbst: the hw can still be different in subtle ways
15:34karolherbst: or it's indeed some memory issue
15:34karolherbst: something something
15:34Company: sure, it could be things like inodes
15:34Company: or caches
15:35karolherbst: yeah.. anyway, nothing surprising with the same code having different results in driver development
15:35Company: yeah
15:36Company: I can live with it remaining a mystery, but I'd love to figure it out
15:36karolherbst: maybe a reboot would trigger the bug for you, or fix it for mclasen, who knows
15:36Company: I've developed on this thing for a few months and never had an issue
15:36Company: and I've used mesa versions from 23.2 to git main - on multiple machines
15:37karolherbst: tried with the same testcases?
15:37Company: yes
15:37Company: make check with 0 failures for me and 50% of tests failing for him
15:37Company: so it's really obvious
15:37karolherbst: could also be a case of "you have to run thoes test cases in order to trigger it"
15:37karolherbst: ohhh
15:37karolherbst: I see
15:38karolherbst: interesting
15:38Company: all his shaders were mixing attribs seemingly randomly
15:38karolherbst: well, maybe you got lucky or mclasen got unlucky
15:38Company: and all my shaders kept perfect order
15:40karolherbst: maybe the GPU is less/more busy on your system and it just changes things in weird ways
15:40karolherbst: anyway
15:40Company: ... for software rendering
15:40karolherbst: at this point I'd make an apitrace
15:41Company: I would start reading Mesa's code next if I cared - but I'm not that curious
15:41karolherbst: that wouldn't really help
15:41Company: trying to figure out how it selects attrib locations when none are set
15:47jenatali: Company: I've run into that before. There's a quicksort call, which isn't a stable sort, and depending on the result you can get different bindings assigned
15:47jenatali: I saw a test fail on Windows but pass on Linux due to that
15:48Company: glibc:
15:48Company: Fedora Rawhide 2.38.9000-30.fc40
15:48Company: Fedora 39 2.38-14.fc39
15:48Company: that sounds like a possible culprit
15:52jenatali: Company: I'm curious if that does end up being it. Let me know if you confirm it
15:53Company: hard to test without installing a new libc
15:54Company: not sure I dare installing the rawhide libc on my F39
15:56jenatali: Yeah fair
15:57robclark: reminds me of https://gitlab.freedesktop.org/mesa/mesa/-/issues/10217 which was also an f40 qsort undefined ordering change
15:58Company: I stopped using qsort() because it isn't stable (glib has a copy that is stable)
16:00Company: but this might be good to know for all the GL tools that will now break because of this in F40 ;)
16:02ccr: quicksort is a unstable algorithm by definition. of course many of the "qsort()" implementations like the one in glibc are not actually quicksort but something else, not that it matters per se ..
16:05tzimmermann: jfalempe, it's weird
16:05tzimmermann: i absolutely have to use the nopat parameter to get the reduced latency on my test system
16:05Company: ccr: the qsort part in glibc used to be stable - only the non-qsort insertion sort part wasn't
16:06tzimmermann: even just having pat enabled (without WC for the vram) gives worse results
16:06Company: but IMO all sort algorithms should be stable by default, because nobody expects sorts to be unstable and that causes bugs
16:07Company: it's especially bad in C because afaik there's not even a stable sort available in libc
16:08jfalempe: tzimmermann, that's weird indeed, for me disabling wc was enough and pat was always enabled before.
16:08Company: jenatali: I installed rawhide glibc now
16:09Company: jenatali: everything kept working
16:09Company: jenatali: then I deleted the shader cache
16:09jenatali: Huh
16:09Company: jenatali: and now I reproduced it
16:09jenatali: Ah makes sense
16:09Company: so yes, F40 libc is the culprit
16:09jenatali: Libc wouldn't be part of the cache key
16:10tzimmermann: jfalempe, i removed devm_arch_io_reserve_memtype_wc() and also used plain ioremap(). so there was no entry in the PAT list
16:10tzimmermann: but i do use a debugging build. it could be that seomthing else interferes here
16:10ccr: Company, agreed about the "should be stable", yes. unstable sorts .. well, I suppose they have their uses if they are more performant and there's no need for stability.
16:11tzimmermann: jfalempe, and if i now use nopat results are always good. changing /proc/mtrr doesn't seem to have much of an effect
16:11Company: in my experience, they're not more performant in almost all cases
16:12Company: if you want a fast sort, use timsort
16:12jfalempe: tzimmermann, even with WriteCombine enabled ? that's surprising.
16:13jenatali: FWIW Windows/MSVCRT qsort has always been unstable so cross-platform GL code should be fine at least
16:13tzimmermann: yes, even when i has mtrrs set to WC
16:13jfalempe: tzimmermann, let me try that too.
16:13tzimmermann: jfalempe, i'll send out a patch that cleans up mgag200 to do the right thing for the common case. from there, nopat + /proc/mtrr should still be an option
16:14jfalempe: tzimmermann, ok, sounds good. even "nopat" alone should be good, if I can reproduce.
16:14Company: jenatali: everybody should just use glBindAttribLocation() - but I guess simple tools can forget the call as long as it works fine
16:15jenatali: Yeah
16:15tzimmermann: jfalempe, i'm currently testing with this code: https://etherpad.opensuse.org/p/mgag200
16:15Company: I expect a bunch of tools to break with F40
16:15tzimmermann: plain ioremap + mtrr setup
16:16Company: yay, dnf downgrade is a thing, I easily can get my libc back
16:16tzimmermann: that does not create a PAT entry, but an mtrr (if nopat given)
16:19jfalempe: tzimmermann, ok, I'm rebuilding a kernel, I should have the results shortly.
16:31tzimmermann: jfalempe, see you tomorrow
16:33jfalempe: tzimmermann, see you, thanks for all the helps.
17:58karolherbst: zmike: no regressions on my side with my zink fix + using a real buffer for cb0, so I kinda want to merge it soonish
18:04mattst88: m/win 6
18:30eric_engestrom: zmike: no, `backport-to:` is not case-sensitive (btw neither is `fixes: $sha` or `cc: mesa-stable`); there is however a bug right now, where if you specify the line two or more times, only the first match is parsed; I haven't looked into fixing that yet but I have a script that detects any such commit and I handle them manually
18:30eric_engestrom: zmike: are you asking because something was not backported properly?
18:33zmike: eric_engestrom: no I was asking because I was going to start using it
18:34zmike: karolherbst: you can start hassling me if it's been more than 24 hours since you posted a MR
18:34zmike: it's barely been 12
18:35eric_engestrom: zmike: ack
18:37karolherbst: oh, sorry
20:15mareko: DavidHeidelberg: ping on libdrm
22:26JoshuaAshton: Lynne: Did not test ffmpeg myself, just was peeking at the code in that branch to see wtf I was missing my own Vulkan Video Encode setup
22:26JoshuaAshton: This stuff is so hard to follow :sweat_smile: