02:07 imirkin: karolherbst: which is what the from_tgsi logic does ;)
02:10 karolherbst: yeah right, but we have a slightly different situation with nir here. With tgsi we insert the exports after parsing the TGSI instructions. In nir those are part of the instructions and might be there twice or more (the exports)
02:10 karolherbst: it shouldn't matter that much though
02:11 imirkin: karolherbst: but you can stage the outputs in nir just like you can in tgsi
02:11 imirkin: it's really the same thing
02:11 karolherbst: no, how would I be able to? for that I would have to detect those and remove the duplicates in nir
02:12 imirkin: huh?
02:12 imirkin: just write them to a temp set of values
02:12 imirkin: and then in the final block, export them.
02:12 karolherbst: they are part of the instructions
02:12 karolherbst: they are literally instructions
02:12 imirkin: ?
02:12 karolherbst: https://gist.githubusercontent.com/karolherbst/ef131abc8c06ae8517129a4b3f3e3fe3/raw/fd2d538ef3338faa016c4a0de260bbb05557d467/gistfile1.txt
02:12 karolherbst: intrinsic store_output
02:12 karolherbst: it is there twice
02:12 imirkin: right...
02:13 karolherbst: we don't have it with TGSI like this
02:13 imirkin: and each time, that becomes mov tmparea, the-value
02:13 imirkin: and then in the final exit block, you do export tmparea
02:13 imirkin: i really don't see what the issue is
02:15 karolherbst: mhh, then phi nodes would be added and all the other stuff, right?
02:15 imirkin: not-your-problem
02:15 karolherbst: well right, I can do it like this, and I also need a workaround for the successor block
02:15 karolherbst: because that ret block, has no next ;)
02:15 imirkin: right, so like i said, you need a final exit block
02:16 imirkin: or you can add the code every time there is an exit from the main function
02:16 imirkin: but i think that kinda sucks
02:16 karolherbst: I still need to create a fake edge between the last block of the loop and the tail block
02:16 karolherbst: otherwise the graph code complains
02:16 karolherbst: but having the last block be detached also makes it crash
02:16 imirkin: yeah, the return has to go to the tail
02:16 imirkin: yes.
02:16 imirkin: i had to fix that for the tgsi thing too
02:17 karolherbst: I already have a solution for this, I just don't movve the exports currently
02:17 imirkin: that sure was fun to track down in a giant enormous program
02:17 imirkin: iirc i added asserts which made the problem easier to notice
02:17 karolherbst: well, in the end I saw that the other blocks weren't there
02:17 karolherbst: but with my old code, ra was happy
02:17 imirkin: commit 52b68375aeaa1ff6bca48eb833176d3498aa48f7
02:17 imirkin: and commit adcc547bfbef362067bb3b4e3aee75b287bc6189
02:18 karolherbst: we could make dce smarter to eliminate those dead blocks
02:18 karolherbst: well
02:18 karolherbst: the instructions
02:18 karolherbst: ahh
02:18 karolherbst: I already wondered what that is about
02:18 karolherbst: well, the message didn't help, but I kind of knew why it happened
02:18 imirkin: heh
02:19 imirkin: but before the assert was there, it was much harder to figure out why it was randomly crashign in the middle of random stuff
02:20 karolherbst: here is a comparison between what tgsi creates and what I currently do: https://gist.github.com/karolherbst/3363847c8137d3e9180423fc142cc500
02:20 karolherbst: wondering if I should bring that preret/ret back
02:20 karolherbst: I had it once
02:20 karolherbst: but it felt kind of pointless
02:21 karolherbst: but not with the clip stuff it kind of makes sense again
02:21 karolherbst: but do you see how BB:3 is pretty much dead code in both versions?
02:22 karolherbst: mhh interesting
02:22 karolherbst: in the TGSI there is no NOP
02:22 karolherbst: in the nir I have this: "vec4 32 ssa_15 = undefined"
02:23 karolherbst: and this value is used in BB:3
02:25 imirkin: that's fairly common
02:25 imirkin: when you have loops and whatnot
02:25 karolherbst: yeah I know
02:25 karolherbst: but it isn't there in the tgsi
02:25 imirkin: something may be falsely assigned to it, dunno
02:26 karolherbst: they use the same value simply in the tGSI
02:26 karolherbst: but yeah
02:26 karolherbst: we might be able to tweak DCE to remove the dead code here as well
02:27 karolherbst: but this is more like finding dead blocks through the CFG, right?
02:27 karolherbst: which is annoying due to the fake edge we add...
02:48 imirkin: not-the-problem-you're-trying-to-solve
02:58 karolherbst: right, back to that clip thing
02:58 karolherbst: or rather sleep
14:20 Exterminador: hello guys.. today, I've run "dmesg" command on my Ubuntu 17.10, and I've found something that i can't understand (newbie here). it's in this paste http://paste.ubuntu.com/26194676/ on line 871 (I've pasted the entire dmesg output just in case)
15:26 imirkin: Exterminador: yeah, it's an issue that became easy to hit with whatever some newer distros ship
15:26 imirkin: Exterminador: i believe it should be fixed with a newer kernel
15:28 imirkin: Exterminador: either way, that's not an error, it's a warning that sad performance is ahead
15:29 imirkin: Exterminador: actually the fix i had in mind only affects newer GPUs
15:30 imirkin: either way, it's not a critical error
15:40 Exterminador: oh. probably because I run an old laptop already and the HDD must be some way dying too
15:40 imirkin: well, this is unrelated
15:41 imirkin: it's related to how we manage PRAMIN
15:41 imirkin: i really do think this changed a bit recently, but i can't find the relevant commit
15:42 imirkin: but basically with wayland, more things end up with a GL context, which in turn holds on to a PRAMIN area iirc, and we run out of space
15:42 imirkin: and have to fall back to a different type of access
15:43 imirkin: ideally there'd be an LRU or something but ... i don't think there is
15:53 Exterminador: well, since it's not a critical error, I guess I don't need to be worried. but the funny is that Xubuntu don't have that error (at least didn't saw it)
15:55 imirkin: yeah, it's an issue brought on by wayland i believe
15:58 Exterminador: as long as it works with major issues, I'm good.
15:58 Exterminador: I like always to have the latest release, but sometimes things get buggy, I know
16:00 imirkin: yeah. unfortunately recent software likes to make use of features that aren't well-supported by nouveau
16:00 imirkin: for some reason everyone has started to feel the need to use opengl for accelerating trivial programs
16:00 imirkin: which just leads to more opportunities for failure
16:01 imirkin: i'd strongly recommend AMD for your next purchase.
16:03 Exterminador: I'll take that in mind. thanks for the heads up
16:14 karolherbst: imirkin: is the pramin region fixed in size?
16:14 karolherbst: well, that reserved area
16:15 karolherbst: because maybe it would make sense to make it increase if it is too small for a context
16:55 AndrewR: hi ... should I file bug about virgl regression on nouveau-powered host system? (unfortunately, last working version was ..long time ago, just retested with Mesa 17.4.0-devel (git-96fc5fbf23) on both host and guest (qemu 2.11) - and bam - no more glxgears, or any gl programs.....
16:56 karolherbst: AndrewR: I would ask the virgl devs
16:56 karolherbst: except you have no opengl on your host
16:56 AndrewR: karolherbst, I have!
16:57 karolherbst: well if it works on the host, but not in the guest, then I don't know what is wrong. I would ask the virgl devs
16:58 AndrewR: karolherbst, I hope someone on #dri-devel test it from time to time ..but I think airlied also has #nouveau open..so i asked here first. Not really worst bug, just ..may be something few noticed
17:01 karolherbst: well
17:01 karolherbst: I doubt it is nouveaus fault if it doesn't work in the guest
17:01 karolherbst: or not reall
17:02 karolherbst: because you don't use Nouveau components inside the guest, right?
17:02 imirkin: AndrewR: yeah, file a bug if you have a trace
17:03 karolherbst: AndrewR: well to be more precise here, wahat is the issue you see, just nothing rendered or no context at all?
17:03 imirkin: esp if that trace renders with llvmpipe
17:16 AndrewR: imirkin, good idea ...if trace will be no more than few GBs (a bit short on tmpfs..and disk space)
17:16 AndrewR: https://bugs.freedesktop.org/show_bug.cgi?id=104291 - started ....
17:19 imirkin: karolherbst: i may have an afternoon to do ... stuff. should i use it to write a nir -> nvir adapter, or are you good?
17:19 karolherbst: I am good
17:19 imirkin: k
17:19 karolherbst: I just use this to learn more about the nvir stuff as well
17:19 karolherbst: and a lot of things are already working quite fine
17:20 karolherbst: just features are missing
17:20 karolherbst: thanks for asking though
17:20 karolherbst: imirkin: but if you want, you can take a look at what I did and give comments on that
17:20 karolherbst: that would help
17:21 karolherbst: but it isn't in a state I would send out to the ML
17:28 imirkin: not really ... i'd rather not look now
17:29 imirkin: since i suspect you're at like ... the 10% line
17:30 karolherbst: sounds about right
17:30 imirkin: perhaps i'll re-re-re-re-re-try to do bindless. 10th time is going to be a charm.
17:30 karolherbst: :)
17:30 karolherbst: you could take a look at some pending patches maybe
17:31 karolherbst: there is still this textureGrad thing
17:31 karolherbst: or did you pushed it?
17:31 imirkin: yeah that's no fun.
17:31 karolherbst: well, maybe still push it so that's at least fixed?
17:31 karolherbst: or would you rather want to understand it before doing it?
17:32 imirkin: ehhhh
17:32 imirkin: i think i'll just push it.
17:32 karolherbst: nice
17:32 imirkin: with a giant comment of "it should work this other way too, but for some reason that's unclear, it doesn't. oh, and blob does it this way too"
17:32 karolherbst: sounds good
17:32 karolherbst: I have no idea who uses textureGrad in a way, that it breaks becuase of this issue
17:32 karolherbst: and to be honest
17:33 karolherbst: I don't want to debug any application having this issue
17:33 karolherbst: becuase I feel it will be painful until we find it uses textureGrad or so
17:33 karolherbst: ohh and maybe the fp64 stuff as well?
17:34 karolherbst: other then that there is nothing in my cts branch which might be ready
17:35 imirkin: yeah, fp64 stuff is a good option too
17:35 karolherbst: mhh
17:35 karolherbst: I don't know if I sent this thing out: https://github.com/karolherbst/mesa/commit/2abf0999dbe1e876c4e58c1541144cda3f5be1ac
17:35 imirkin: the textureGrad thing is a *very* minor correctness issue though. careful tests can find it, but a normal app won't care.
17:35 karolherbst: ahh, okay
17:35 karolherbst: so mainly we fix it for the CTS
17:35 imirkin: you did not
17:36 imirkin: that one sounds bad....
17:36 imirkin: so we mess up when a phi refers to a phi? hm
17:36 imirkin: that's unfortunate!
17:36 karolherbst: no clue, I don't remember writing that patch
17:36 karolherbst: :)
17:36 imirkin: lol
17:36 imirkin: perhaps a robber came in the middle of the night
17:37 imirkin: commited it in your tree
17:37 imirkin: and vanished into the darkness
17:37 karolherbst: Jun 10th...
17:37 karolherbst: that might explain
17:37 imirkin: if you have the source shader that causes it
17:37 imirkin: i'd like to at least be able to investigate what really goes wrong
17:38 karolherbst: yeah, trying to get it
17:38 karolherbst: currently too lazy to go to my other laptop, so I just download the game again and see if I can hit it here
17:38 imirkin: it does seem like the CSE thing could mess up in that case
17:38 imirkin: however it's unclear to me that your solution is correct
17:38 karolherbst: maybe i even pushed the sahders...
17:41 karolherbst: "nvc0_program_translate:610 - shader translation failed: -4" at least something
17:43 karolherbst: "Error in Graph:createEdge: edge already exists"
17:52 imirkin: the shader would be nice... file a bug if posisble
17:53 karolherbst: imirkin: https://gist.githubusercontent.com/karolherbst/f244241adda4141bbebdb11cadaca3db/raw/06f2fcf2b15e2ac827e5cab4b78dbd2717a08c31/gistfile1.txt
17:54 imirkin: bug would be great so i don't forget
17:54 imirkin: or rather, so that when i inevitably forget, we haven't lost the info :)
17:55 imirkin: i wonder what those #prgram's do
17:56 karolherbst: nvidia?
17:57 karolherbst: ohh yeah
17:57 karolherbst: right
17:57 imirkin: #pragma's i mean
17:57 karolherbst: yeah
17:57 karolherbst: I could imagine they tweak the optimisation things or so
17:57 imirkin: although search results suggest that the answer is 'nothing'
17:57 karolherbst: :D
17:57 karolherbst: well
17:57 karolherbst: the same goes for gccs inline, right?
17:57 karolherbst: but still a lot of people thing it does
17:57 karolherbst: ;)
17:57 imirkin: nah, inline does stuff
17:58 imirkin: it's not guaranteed to do stuff
17:58 karolherbst: more or less
17:58 karolherbst: yeah
17:58 imirkin: but it's an indication to gcc that weighs in its calculation of whether to inline or not
17:58 karolherbst: oh, it is actually? okay
17:58 karolherbst: I thought it is pointless except you specificly tell gcc to not inline itself
17:58 imirkin: AndrewR: oh, i know that crash
17:59 karolherbst: nice, I got that clip thing working :)
17:59 imirkin: AndrewR: er hm... maybe not....
17:59 karolherbst: yeah, will create a bug report soonish
18:01 AndrewR: imirkin, may be you fixed something similar in not too distant past (on nv43)
18:02 imirkin: well, the issue i remember is where the clear happens *very* early
18:02 imirkin: and upsets some stuff inside the driver
18:02 imirkin: however this is inside the state tracker
18:03 AndrewR: imirkin, I think modesetting driver also uses GL with virgl nowadays ...? and I have both qt3 and cairo (for gtk) built with gl support
18:04 imirkin: yes, that would be the case
18:04 imirkin: but things that happen inside the guest use virgl, not nouveau
18:05 imirkin: virgl then produces a data stream that is passed to the host
18:05 imirkin: and virglrenderer converts that into GL calls to the host's GL driver
18:05 imirkin: so any crashes in the guest are in the virgl path, not nouveau path
18:05 imirkin: if qemu crashes, that's a different matter
18:05 imirkin: (or rather, virglrenderer)
18:09 imirkin: CRAP. of course when reviewing the textureGrad thing i realized it's buggy. of course.
18:10 imirkin: why do i bother reviewing my shitty code if i know i'm just going to be disappointed :( should just push it as-is and be blissfully unaware of its bugs.
18:12 imirkin: (the issue, of course, is now that everything's based in lane0, i don't broadcast the depth-compare and offsets to lane0)
18:17 imirkin: oh nice. offsets have to be const.
18:17 imirkin: so it's just the shadow ref
19:00 karolherbst: imirkin: mhh interesting
19:00 imirkin: OH!
19:01 imirkin: WAIT!
19:01 imirkin: i think i know why the old code was broken
19:01 imirkin: w00t
19:01 imirkin:goes to hack
19:01 karolherbst: :O
19:02 imirkin: gah. the problem was staring me in the face this whole time
19:03 imirkin: we broadcast new coordinates to the other lanes
19:03 imirkin: which was good
19:03 imirkin: but we neglected to broadcast the array/depth values to the other lanes
19:03 imirkin: so they still used their local values
19:03 imirkin: which was bad.
19:03 imirkin: so now the question is ...
19:03 imirkin: am i better off with this l0 approach, or better off fixing the old approach
19:05 imirkin: and the answer is yes - we wouldn't have to broadcast back into the proper lane.
19:05 karolherbst: mhh, wondering why nvidia does it their way then
19:06 imirkin: wellll ... i wonder if their way is somehow better for non-frag stages. dunno.
19:11 imirkin: booooo
19:11 imirkin: my fix didn't fix it
19:12 imirkin: oh, that's coz i'm a typoing fool
19:13 imirkin: hrmph
19:16 karolherbst: guess I can't do things like this: " ld u32 %r297d c0[%r296+0x40]" :)
19:17 imirkin: types really should match
19:18 karolherbst: ahh "vec3 64 ssa_168 = intrinsic load_uniform"
19:18 karolherbst: it has a 64 and not a 32 :)
19:19 karolherbst: does it matter for loads if it is a f32 or u32?
19:19 karolherbst: I know I should prefer u32, but just asking
19:21 imirkin: can't imagine that it would
19:22 imirkin: but i suppose some things could be hard-coded to look for U32
19:22 imirkin: doubt it though
19:22 karolherbst: okay
19:31 karolherbst: I should have think more about the type stuff... have some more issues regarding it "mul u64 %r296 %r294 %r295"
19:32 imirkin: where are you getting 64-bit muls from?
19:32 karolherbst: ohhh
19:32 karolherbst: no, that was my mistake
19:32 karolherbst: by fixing the load, I put the same dType for the mul as well
19:33 karolherbst: but I can get 64bit things now, because I kind of moved on to all glsl tests (-gs -cs)
19:33 karolherbst: I couldn't find any fundamental issue with the prior tests anymore
19:35 karolherbst: now I get an assert inside setup_non_interleaved_attribs.... I think I will ignore this one for now
21:52 imirkin: mwk: do you have a clear understanding of what quadon/quadpop do?
22:16 imirkin: volta isa: http://docs.nvidia.com/cuda/cuda-binary-utilities/index.html#volta
22:17 imirkin: fun additions like "integer dot product and accumulate"
22:17 imirkin: wonder wtf that does...
22:17 karolherbst: tensor?
22:18 karolherbst: "P40 also accelerates INT8 vector dot products (IDP2A/IDP4A instructions), with a peak throughput of 47.0 INT8 TOP/s."
22:18 karolherbst: okay, tensor was f16 float...
22:20 karolherbst: anyway
22:20 karolherbst: it is for deep learning
22:22 karolherbst: but I am wondering why they didn't add it with the pascal isa...
22:24 imirkin: oh, so it's a vector thing
22:25 karolherbst: so then it appears that either Volta or a P40 has this instruction
22:26 karolherbst: wondering if other GP102 also have this, or GP100 for that matter
22:35 karolherbst: imirkin: do I have to create merges in the input IR for 64bit values? Or is it okay if I load 64bit values directly?
22:36 imirkin: if it's a 64-bit value you can use it
22:36 imirkin: if it's 2 32-bit values you have to use a merge to make a 64-bit value out of it
22:37 karolherbst: okay
22:37 karolherbst: that explains it
22:38 karolherbst: mhh, something is wrong in my uniform loading code
22:38 imirkin: and if it's a 64-bit value that you want to use as a 32-bit, you need to use a split
22:38 imirkin: bld.mkSplit helps with that
22:39 karolherbst: yeah, I am aware of that. I was just wondering if it is okay to use 64bit values in the first place without merges, because in the example I have here the TGSI one creates a lot of merges
22:39 karolherbst: and in nir I just know that a value is 64bit
22:40 karolherbst: ohhh, wait
22:40 karolherbst: I think I found the issue
22:40 karolherbst: right
22:40 karolherbst: "ld u64 %r10d c0[0x0]" + "ld u64 %r11d c0[0x4]" ;)
22:44 imirkin: that can't work
22:44 imirkin: the const offset has to be aligned
22:44 imirkin: i.e. if you do a 64-bit load, it has to be aligned-to-8
22:44 imirkin: or else you'll get yelled at
22:44 imirkin: it's best to just do 32-bit loads and let MemoryOpt do its thing
22:44 imirkin: you also get the load propagation benefits
22:45 karolherbst: yeah I know
22:45 karolherbst: I just need to adjust the nir offset correctly
22:45 karolherbst: it was only correct for 32bit values until now
22:46 karolherbst: for each component I did something like this: "(offset * 4 + i) * 4)"