03:13 rhyskidd: Lyude: yup, interested
03:14 rhyskidd: access to displayport standards via membership would be useful (I don't have an employer who can provide that otherwise)
03:14 rhyskidd: you may have seen that nv released register docs on their display hardware's crc functionality, so another block is there to support nouveau testing via igt
03:15 rhyskidd: but, i'm still limited in the time i can spend on nouveau, so if the number of memberships is limited in anyway -- i'd rather they go to other interested parties first before me
03:16 rhyskidd: i should be a current X.org member
04:03 imirkin: rhyskidd: Lyude has been working on adding crc support to nouveau
04:20 rhyskidd: ah ok -- i've been off irc for a little while
04:20 rhyskidd: Lyude: how is that going?
04:22 imirkin: this is the latest thing that's published, but i think there's been more work since: https://gitlab.freedesktop.org/lyudess/linux/commits/wip/nouveau-crc-v1
12:08 AndrewR: hm, so I was reading https://www.khronos.org/opengl/wiki/Compute_Shader and finally I got even wague understanding of why all those shader storage/image extensions exist :} But my nv92 still out of luck because those compute shaders requre something newer (hw wise) than it has on-chip?
12:09 AndrewR: also, what was problem with images in openCL (on nouveau)? I naively assumed they should be 'like textures' but then ..I realized later GPU have their sort-of MMU for reason? Like, you can upload it into logically-contious space, yet physically it will be in different areas of memory and other way around ?
12:12 karolherbst: AndrewR: well... the reason why we don't have compute shaders on tesla are quite silly
12:12 karolherbst: technically we could do compute shaders, but..
12:12 karolherbst: 1. we can't do ssbos and/or images inside fragment shaders
12:12 karolherbst: uhm..
12:13 karolherbst: that's actally the reason
12:13 AndrewR: karolherbst, thanks....
12:14 karolherbst: AndrewR: you could just force on the extension and see what happens though...
12:14 karolherbst: we could even fix all the bugs
12:14 karolherbst: but we can't expose it because of the spec
12:15 karolherbst: AndrewR: images allow you to write into texture data
12:15 karolherbst: which has all sorts of implications
12:16 karolherbst: also.. we have to fix clover in a few places, where it enforces AMD like behaviour
12:19 AndrewR: karolherbst, I don't have any useful (borrowed from internet) code to run there yet :} I was thinking about mpeg-like decoder/encoder, but this usually involve more than parallel stages ... and myself definitely not capable enough for even just understand math behind even simples decoder :/ so, if there will be example on the net ..I can try to see what may happen if I force those shaders on on nv92
12:19 karolherbst: AndrewR: well, OpenCL is usually better suited for that kind of work
12:22 AndrewR: karolherbst, but it still not quite here because reasons you outlined :} and myself is nowhere good enough for fixing this .....
12:28 AndrewR: I mostlys ee vendors promising big things, not code itself :} http://www.radgametools.com/bnkhist.htm - "Bink 2 now has GPU video decoding! This is generally two to three times faster than CPU-only decoding alone! BinkGPU uses the CPU to decode the bitstream, and compute shaders on the GPU for everything else! Available for Windows DirectX 11, Linux GL 4.3, Sony PS4 and Microsoft Xbox One. " So, this was used...in one form or another (I just remember yo
12:28 AndrewR: u wanted to demo something in 2020, and hoped to provide something simple ....well, apparently even simple things aren't _that_ simple)
12:29 karolherbst: but that uses graphics though
12:34 AndrewR: karolherbst, https://pdfs.semanticscholar.org/7a16/60f0f2dad76481f3223d0a8048ebb213fc3a.pdf - "Partial Image Decoding On The GPU For Mobile Web Browsers", 2014 ....
12:54 karolherbst: imirkin: uff.. one value isn't processed at all :/
13:03 karolherbst: uffff
13:03 karolherbst: it's not a technical bug
13:03 karolherbst: it's a bug inside the RA algorithm
13:05 karolherbst: seriously... I'd just port over to util/register_alocation because of the lacking documentation and the terrible code
20:22 imirkin: karolherbst: remind me the TGSI of the "minimal" failing shader?
20:23 karolherbst: imirkin: https://gist.github.com/karolherbst/9214680816fa1c981e46b20d1e6570af
20:23 karolherbst: it got even smaller
20:24 karolherbst: ra output: https://gist.githubusercontent.com/karolherbst/0b5fb5b39e9ff4011c37147ddf0f33cb/raw/24bff0117e706eb22220de4ce1ffa54a2e43dfde/gistfile1.txt
20:24 karolherbst: vale 156 is placed into this "hi" list
20:24 karolherbst: *value
20:25 karolherbst: because of deg 60/60
20:44 imirkin: thanks
20:45 imirkin: it should def retry, so if it's not retrying, something very weird is going on
20:49 karolherbst: well, it retries.. but.. it marks that value for spilling, and the next round just does the same. The thing is just, why should that value be spilled anyway?
20:49 karolherbst: there are enough regs
20:49 karolherbst: but then.. why does it work with other gens..
20:49 karolherbst: heh
20:49 karolherbst: it works with c0 as well
20:51 karolherbst: mhh
20:51 karolherbst: 0xf0: RIG_Node[%158]($[1]-1): 4 colors, weight inf, deg 84/252
20:52 karolherbst: so.. even thoug 84 seems high, it still good
20:52 karolherbst: 0xc0: RIG_Node[%158]($[1]-1): 3 colors, weight inf, deg 48/61
20:52 karolherbst: now we have 48
20:52 karolherbst: but...
20:52 karolherbst: I guess that[s because it's 96 bits
20:53 karolherbst: anyway
20:53 karolherbst: the "degree" calculation is doing something stupid
20:55 karolherbst: or maybe we just have to adjust RelDegree a bit? ....
20:55 karolherbst: the lack of documentation here is just super annoying
20:56 karolherbst: why was that RelDegree table choosen that way
21:00 imirkin: nfc
21:00 imirkin: yeah, there's an issue with how we spill wide values
21:01 imirkin: so we spill it, but it doesn't end up reducing register pressure at all
21:01 imirkin: coz of the constraint moves we re-add
21:01 imirkin: i've seen this before
21:01 karolherbst: well, that's before spilling though
21:02 karolherbst: so.. we calculate this degree and degreeLimit
21:02 karolherbst: if degree >= degreeLimit, we add it to the list of values we want to spill
21:02 karolherbst: _but_
21:02 karolherbst: this value obviously doesn't have to be spilled, it even has a spill weight of inf
21:02 karolherbst: although, that might actually be another issue
21:03 imirkin: there are a _lot_ of issues
21:03 karolherbst: yeah
21:03 imirkin: imo attempting to redo RA entirely is a giant boondoggle
21:04 karolherbst: sure, but that might give as the benefit of having code involved, others understand as well
21:04 imirkin: instead focus on moving away from libdrm_nouveau so we can have threading
21:04 imirkin: that seems like a wildly better use of time
21:05 karolherbst: ohh, I agree, I am just waiting on skeggsb on that, as he wanted to give me something for that, or let's say we are in discussion about the entire topic and he wanted to share something with me
21:05 karolherbst: so I decided to wait on that
21:07 karolherbst: imirkin: anyway... I am even convinced it's not even fixable with the current UAPI.. or only with a big pile of pain around it.
21:07 karolherbst: and libdrm_nouveau is just a small issue overall
21:07 karolherbst: this entire bug is bigger than just that
21:08 karolherbst: how I see it, we require resizable pushbuffers and have to rewrite all of nvc0 to have this "one pushbuffer per operation" thing going on
21:08 karolherbst: otherwise threads will just step over each others toes
21:09 karolherbst: and we have to get rid of this pointless context switching we have as well
21:10 karolherbst: but right now we allocate a bo, so what happens if that's too small?
21:10 karolherbst: sure, we can allocate a bigger one and copy data
21:10 karolherbst: but this still doesn't fix the issue, that contexts can just mess with the hw context state as they wish
21:10 karolherbst: and at some point they are out of sync with the state each gl context assumes it has
21:11 imirkin: i think you've gone too far.
21:11 karolherbst: I am convinced that's what has to happen in the end. It doesn't have to be done in one step though
21:11 imirkin: there's an approach that lets you not do all this
21:11 imirkin: the basic problem right now is that we don't control when a submit happens
21:11 imirkin: and thus when a kick happens
21:12 imirkin: which messes everything up
21:12 imirkin: an API that makes this explicit rather than explicit would allow us to fix everything
21:12 karolherbst: sure, that's the pushbuf part of the issue
21:12 karolherbst: and everybody agrees that implicit pushes are bad
21:12 karolherbst: but
21:12 karolherbst: how do you verify the gl state of a context matches the hw state, a long as every other context can just do submits
21:12 imirkin: same way we do it now
21:12 imirkin: only one context is active, etc
21:13 karolherbst: who says it's not broken?
21:13 karolherbst: ohh
21:13 imirkin: i do.
21:13 karolherbst: mhhh
21:13 karolherbst: how are you able to verify that with multiple threads?
21:13 karolherbst: locking?
21:13 imirkin: yes
21:13 karolherbst: ....
21:13 karolherbst: then it's pointless to do multiple threads
21:13 imirkin: the implicit push is what killed the locking scheme
21:13 imirkin: yes, entirely pointless.
21:13 imirkin: we can't change the hardware.
21:13 karolherbst: we need a solution which doesn't involve locks
21:13 karolherbst: well
21:14 karolherbst: radeonsi does the state tracking thing as well
21:14 imirkin: threads aren't entirely pointless btw
21:14 karolherbst: and I am sure they don't lock threads
21:14 imirkin: they allow you to do a bunch of stuff in parallel, like DMA ops, etc
21:14 karolherbst: what about CPU overhead?
21:14 karolherbst: that's not irrelevant either
21:14 imirkin: another good reason for threads
21:14 karolherbst: well
21:14 imirkin: but none of that is defeated by locking around submits / current ops
21:14 karolherbst: if we lock it becomes an issue
21:15 karolherbst: ehh
21:15 imirkin: all we're doing is just serializing the core interactiosn with hw
21:15 imirkin: i think that's perfectly reasonable.
21:15 karolherbst: ehhh, that goes beside the point
21:15 karolherbst: I was meaning what we do about the graph context state
21:15 imirkin: it's attached to the context
21:15 karolherbst: as every gl context could just change it
21:16 karolherbst: stepping over other gl contexts
21:16 imirkin: and passed around when switching the "main" context
21:16 imirkin: yeah, that could cause a bit of extra emits
21:16 imirkin: not a big deal imo
21:16 karolherbst: how can we do that, if we have 4 active threads doing context operations?
21:16 imirkin: "don't do that"
21:16 imirkin: that's also not how software works.
21:16 karolherbst: well.. software might do it
21:16 imirkin: sure. we can't optimize for everything all at once.
21:16 karolherbst: I don't want to go for a solution, which already has known issues
21:17 karolherbst: because then we just have to fix it later again
21:17 imirkin: it's not something that would cause breakage
21:17 karolherbst: it might cause wrong rendering or something
21:17 karolherbst: maybe crash the context
21:17 imirkin: doing draws from multiple contexts sucks. there's no real way around it.
21:17 imirkin: no
21:17 imirkin: definitely not
21:17 imirkin: you re-emit the things that you need to when switching contexts
21:17 imirkin: and you keep track of the "current" graph state
21:18 imirkin: this is all already done.
21:18 karolherbst: but then you have the concurrency issue
21:18 imirkin: what issue
21:18 karolherbst: multiple threads doing context operations and you end up switching the main context while another thread is still busy
21:18 imirkin: you block that switch. that's the whole point of locks.
21:18 imirkin: also at the gallium level, this only happens when you call draw()
21:18 karolherbst: but then we are at perf issue again ;)
21:19 karolherbst: and there is a solution without locks already
21:19 karolherbst: radeonsi is doing it
21:19 imirkin: that solution is to make everything a lot slower
21:19 imirkin: i don't think that's a great solution.
21:19 karolherbst: well, and I don't think throwing it locks is a solution either
21:19 imirkin: instead of only re-emitting the things that need changing, you re-emit everything
21:19 karolherbst: it's a workaround
21:19 karolherbst: uhm.. no
21:19 karolherbst: you can do a diff
21:19 imirkin: diff against what
21:19 karolherbst: you just need to track the state
21:19 imirkin: we already do that.
21:20 imirkin: nvc0_graph_state
21:20 imirkin: or something like that
21:20 imirkin: and it's copied when swithcing the "active" context
21:20 karolherbst: I know it tracks a bit
21:20 karolherbst: but not everything
21:20 karolherbst: or maybe it's everything
21:20 imirkin: heh
21:20 imirkin: It Works (tm)
21:20 imirkin: if you think otherwise, just read more code, until you agree.
21:21 imirkin: look at what it tracks, and look at what we do when switching active contexts
21:21 karolherbst: but the thing is, that we can do the one submit per draw thing, we just need to rework how we do the tracking, how we update it, and have a solution which doesn't require us locking everything
21:21 imirkin: lockign around draw is eminently reasonable.
21:22 karolherbst: maybe
21:22 karolherbst: as long as we push out the things in one go without other threads interrupting
21:38 karolherbst: imirkin: another thing which is a bit annoying are operations on screens, where we write into the push buffer, which might not trigger a push, but which push buffer should be used and we still have the resizing issue there
21:40 imirkin: which is why you must have exactly one "active" context
21:42 karolherbst: but what if that happens from a different thread?
21:43 karolherbst: I mean sure, we could solve this with more locking, but then not only draws lock, but other calls as well
21:53 imirkin: basically only draws and to a much smaller degree things like transfers will have an inner lock
21:53 imirkin: there should be no locks around waits
23:37 karolherbst: imirkin: btw, any idea why the reldegree table is that big? vec16 type of things?
23:38 karolherbst: no ida how colors could be anything bigger than 4, as we really only care about predicates/gprs/address file, or is there something else to consider?
23:39 imirkin: on nv50
23:39 imirkin: we treat everything as 16-bit
23:40 imirkin: i.e. each color is a 16-bit color. so up to 8, definitely
23:40 imirkin: (coz mul takes 16-bit half-regs)
23:41 karolherbst: sure, but the table is still 17x17, not 9x9
23:41 karolherbst: not that it matters much, just wondering
23:42 karolherbst: heh.. fun, my example crashes on nv50
23:43 karolherbst: in nv50_ir::LValue::isUniform getInsn returns NULL, funky
23:43 karolherbst: texlod 3D $r0 $s0 r___ f32 %r42 %r36 %r37 %r38 %r43
23:43 karolherbst: and the lod source is checked.. wait
23:44 karolherbst: heh
23:44 karolherbst: it's indeed never defined
23:44 karolherbst: hah
23:44 karolherbst: nice
23:45 karolherbst: found a bug then :) no idea if we should care though
23:45 karolherbst: imirkin: textureLod called with an undefined lod value...
23:50 imirkin: isUniform is kinda busted.
23:51 imirkin: anyways, yeah, probably needs some mild adjustment
23:51 karolherbst: well, if there is no definition, we can assume the value is uniform :) uniformly undefined :p
23:51 imirkin: for nv50, texlod/bias must take a dynamically uniform value for lod/bias
23:52 karolherbst: just.. depending on the implications that might not be the greatest idea
23:52 imirkin: so if it's not, we do a per-lane dance
23:52 imirkin: executing one lane at a time
23:52 imirkin: times 4 ops
23:52 karolherbst: right... just what do we do if somebody messes up their glsl code and the lod is undefined?
23:52 imirkin: i don't think anything messes up bigtime, it just uses the lod from a single lane to determine which lod to retrieve from
23:52 karolherbst: I am sure this leads to weird applications bugs anyway
23:53 imirkin: yeah, obviously
23:53 imirkin: but compiler probably shouldn't crash
23:53 karolherbst: yep
23:55 karolherbst: question is, what should isUniform return when there is no definition?
23:55 karolherbst: true or false?
23:56 imirkin: false.