00:05 imirkin: yeah, c7 becomes the driver constbuf
00:05 karolherbst: that means all computer shaders can access it?
00:06 karolherbst: ohh wait
00:06 karolherbst: CONT[1] -> c7
00:06 karolherbst: but it looks odd
00:06 karolherbst: well, to me at least
00:10 imirkin: no. address of const[1] is loaded from c7, which is the driver constbuf
00:10 imirkin: same way that ssbo's are
00:11 karolherbst: okay
00:12 karolherbst: what I don't get is, why there are so many c7 accesses added when going into SSA form
00:13 karolherbst: ohh
00:13 karolherbst: ssbo stuff is also loaded from c7
00:13 karolherbst: okay
00:13 imirkin: c7 is the driver constbuf
00:13 imirkin: it has all the info about ... stuff.
00:13 imirkin: (mostly buffer addresses for compute shaders)
00:14 karolherbst: okay
00:14 imirkin: normally it's c15
00:14 imirkin: but since there are only 8 bindable buffers, it's c7 for kepler+ compute
00:14 imirkin: (p.s. wtf nvidia... why make such annoying restrictions)
00:17 karolherbst: okay, anyway, need to go to bed. I am sure we will be able to track the issue down tomorrow. At least it's inside those 128 shaders somewhere (most likely=
02:48 Horizon_Brave: quiet night
02:50 nyef: Sunday night, and many people have to work in the morning, maybe?
03:36 Horizon_Brave: nyef: I know that..was just sayin'
08:54 karolherbst: hum.. vulkan only games, now it is getting interesting
09:00 dboyan_: Are there vulkan-only games in the wild?
09:00 karolherbst: not yet
09:03 dboyan_: I guess vulkan-only game will be a hell for optimus laptops, at least now
09:05 dboyan_: I once tried vulkan renderer of dota 2, and had to configure X and xrandr and let nvidia card to take over the whole rendering
09:21 karolherbst: :(
09:35 karolherbst: dboyan_: well everybody is free to pimp bumblbee to support vulkan
09:35 karolherbst: should be failrly easy with primusrun
09:38 dboyan_: Well, there was problem with blob iirc. It tries to connect to DISPLAY internally, and errors out somehow. I guess people will sort it out sooner or later
09:40 dboyan_: karolherbst: I think I've found the solution to caching compute program binaries, turns out quite simple and clean. I also found a memory leak in my code. Will update my branch several hours later if I have time to verify and test my code today.
09:51 karolherbst: dboyan_: awesome :)
09:51 karolherbst: finally reasonable loading times for new games
09:51 karolherbst: :D
09:52 karolherbst: dboyan_: there is also noticable delays with hitman, I think this is due shaders being read too late
09:52 karolherbst: aka at drawing time
09:52 karolherbst: but this should be unrelated to your work?
09:52 karolherbst: no idea
09:53 karolherbst: anyway, try ot read the shader binary as soon as possible, wasting RAM is no concern
09:55 karolherbst: maybe it would even make sense to optimize the cache to load shaders in advance for certain applications or so as well
10:21 dboyan_: karolherbst: Now the cache will try loading shaders just before the program is translated. If cache hits, the translate pass won't be needed; if it misses it will start translating as normal.
10:21 dboyan_: sometimes there will be translating and uploading just before draw calls
10:21 karolherbst: :/
10:22 karolherbst: just before drawing is too late
10:22 karolherbst: you don't want to have IO delaying stuff
10:22 karolherbst: do it at compile time as the latest
10:22 karolherbst: applications/games compile their shaders in advance, so that they don't need to do it later
10:22 karolherbst: the shader cache _has_ to respect that
10:23 karolherbst: loading just before draw -> bug inside the shader cache, that simple
10:24 karolherbst: or let me reprhase it: the shader shouldn't arrive later from tha cache than it does without the cache
10:25 karolherbst: I expect that the issue I found in hitman is more due to the mesa core part of the shader cache
10:27 dboyan_: well, I know what you mean, but I'm not yet clear what is needed to achieve that
10:29 dboyan_: I guess the compiler infrastructure in nouveau is not as well-designed as that of, for example, radeonsi, which has fancy things like multi-threaded compiling, in-memory binary cache. But i just wonder if they will make a lot of difference
10:29 dboyan_: And I gotta leave now, be back later
12:07 pmoreau: dboyan_: Cool stuff! What’s your solution for caching compute program binaries? I should have a go at your branch at some point, to try it out.
13:08 dboyan_: pmoreau: I decided to just store the symbol table for compute programs in the cache, it is actually no more difficult than the relocs and fixups, which are already stored
13:08 pmoreau: Ah, okay :-)
13:09 dboyan_: karolherbst: It seems I made a mistake with git operations yesterday, that result in pushing the outdated thing. I'll update my code again in a moment, I think the new version should be better
13:17 karolherbst: dboyan_: nice :)
13:17 karolherbst: will check today
13:42 dboyan_: karolherbst, pmoreau: I force-pushed my branch: https://github.com/dboyan/mesa/tree/nouveau-cache, this has compute program cache enabled and fixed several previous issues
13:43 pmoreau: dboyan_: Awesome, thanks! I’ll try to give it a try this week (I will have to rebase my work on top of your branch).
13:50 karolherbst: dboyan_: nice, I hope I don't see the FPS drops anymore
15:08 Lyude: Do we have any (probably community-made) documentation on macros like "GM204_3D.GRAPH.MACRO_UNK0124 = 0x3"?
15:08 Lyude: Trying to figure out what other registers we need to poke to make NV_fill_rectangle work and I'm wondering if those might have something to do with this
15:08 imirkin: no, but demmt interprets the macro
15:09 Lyude: (also, I confirmed the shader test I wrote for that extension does indeed work properly with nvidia's blob)
15:09 imirkin: the macros are initialized somewhere up top
15:09 imirkin: and then they're invoked, and passed arguments
15:09 imirkin: demmt evaluates them based on those arguments
15:09 Lyude: Oh, you can define macros on nvidia firmware?
15:09 Lyude: that's pretty nifty
15:09 imirkin: this works for everything except indirect arguments which demmt doesn't properly capture
15:10 imirkin: mmm... well, it's hardware, not firmware...
15:10 imirkin: (ok, for all i know there's some firmware in the chips too, but that's not at all visible)
15:11 imirkin: there's a well-defined macro language to write the graph macros in, which can do things like reading/writing pgraph methods, loop, etc.
15:11 imirkin: envydis/macro.c defines the ISA
15:12 imirkin: and there are nouveau macros written in nvc0/mme
15:12 Lyude: neat
15:12 Lyude: nvidia definitely does a lot of stuff on their chips I haven't seen before
15:12 imirkin: either way, demmt parses the macros as they're configured, and then when they're invoked, it applies them. note the diff between PB: and PM:
15:12 imirkin: PB: is commands in the pushbuf
15:12 imirkin: PM: is commands issued by the macro
15:13 imirkin: well, normally the command processor has firmware that you can insert stuff like that into
15:13 imirkin: on nvidia, the command processor has no configurability
15:13 imirkin: so that was built into the GRAPH object instead
15:14 imirkin: but that means you can only write macros about GRAPH things, as they don't have access to anything outside that engine
15:14 Lyude: Ah, so what do you think the chance is that one of these macros might be related to why NV_fill_rectangle causes prims to go rogue and ignore their vertex points? or are macros not normally used by the blob for those purposes
15:14 imirkin: on the bright side, it's runtime-configurable
15:14 imirkin: well, i did notice something quite odd
15:15 imirkin: which was that instead of writing some regs directly
15:15 imirkin: it would invoke a macro which took the reg and value, and then wrote the value into the reg
15:15 imirkin: now, that could be a workaround for a very weird hw bug
15:15 imirkin: or it could be used to disable those writes conditionally (it checked some scratch method's value before doing the write)
15:15 imirkin: my guess is the latter - they wanted to be able to compute cmdstreams once
15:16 imirkin: but under some odd situation those writes shouldn't be done
15:17 Lyude: And I'm guessing you mean some of the writes for telling the GPU to draw the rectangle right?
15:17 imirkin: anyways, macros are used for various things
15:17 imirkin: well, the way most (all?) gpu's work
15:17 imirkin: is you set a whole bunch of values
15:18 imirkin: which does nothing
15:18 imirkin: and then you hit the "go" button
15:18 imirkin: which actually kicks off the draw
15:18 Lyude: i figured that part out at least :P
15:18 imirkin: [by looking at the values that you set]
15:18 imirkin: note that the FILL_RECTANGLE name is my own
15:18 imirkin: for all i know it's MESS_UP_RASTERIZATION
15:19 Lyude: hehe
15:19 imirkin: or my favorite, TFB_UNFUCKUP_OFFSET_QUERIES
15:21 imirkin: Lyude: i'd recommend recording a trace where you (a) draw without fill rectangle, (b) draw with fill rectangle and (c) draw without fill rectangle again
15:21 imirkin: [a mmt trace of the blob, that is]
15:22 Lyude: good idea
15:22 imirkin: and maybe (d) draw with fill rectangle again for good measure
15:22 imirkin: basically on the first draw, a ton of stuff is set up unrelated to that draw
15:22 imirkin: which makes it hard to find anything useful
15:23 imirkin: and then flipping back and forth will hopefully point out the relevant bits.
15:23 imirkin: there could also be an ordering thing going on - i.e. you need to write x before you write y
15:23 Lyude: pst, where can I find instructions on how to start a mmio trace?
15:23 imirkin: (these methods often store values, but they can also have logic behind them)
15:24 imirkin: mmt, not mmio
15:24 Lyude: mmt right
15:24 imirkin: Lyude: https://nouveau.freedesktop.org/wiki/Valgrind-mmt/
15:24 Lyude: awesome, thanks
15:24 imirkin: for mmiotrace, the best guide is probably https://wiki.ubuntu.com/X/MMIOTracing
15:25 jamm: imirkin: okay, i'm using debian strip now. It installed with nouveau by default, but the mouse pointer got stuck in the top left corner (but it was still moving around, i could see the pointer change shapes as i go over text etc). After installing nvidia's proprietary drivers the problem went away. Could this have something to do with pascal?
15:25 imirkin: jamm: yes, it was a bug with pascal on iirc 4.8 or 4.9 kernels
15:25 imirkin: jamm: for accel to work on pascal you need a much later kernel anyways (drm-next i think)
15:27 jamm: imirkin: i have access to this PC with pascal and a mac, do i need another machine to test nouveau changes or will i have to suck up and reuse the same PC for testing new changes?
15:27 Lyude: also, is that VEX stuff upstream? or will I still need to compile it here
15:27 imirkin: as long as you're not hacking on kernel, and not afraid of occasional hangs, same machine should be fine
15:28 imirkin: Lyude: don't think so
15:28 imirkin: Lyude: follow the instructions
15:28 imirkin: and all will be well
15:28 jamm: great! :D
15:28 jamm: so if i want to bring-up pascal, like you mentioned yesterday, i'd have to compile drm-next and use that instead of 4.9?
15:28 Lyude: alright, just checking :P. this laptop isn't the fastest at compiling
15:29 imirkin: jamm: that'd be the easiest, yes
15:32 jamm: imirkin: thanks a lot! since i'm really new to kernel level stuffs (the lowest level i have worked on is on D3D API's at wine) i might bother you a little while compiling dem-next nouveau and related dependencies. I'll try to refer existing resources as much as I can before I get to you though ^_^
15:43 karolherbst: jamm: the good think about nouveau is, that after some time, coding isn't your main concern, but to figure out how stuff works, after that coding is the easy part :p
15:44 jamm: karolherbst: right, that's going to take me a while before i can even get to my first line of code here XD
15:44 karolherbst: other drivers (mainly radeonsi and intel) is just reading up in some docs and put this into code. this is annyoing, because boring :p
15:45 jamm: so to start off, i need to compile nouveau with drm-next, and for that is following https://nouveau.freedesktop.org/wiki/InstallNouveau/ appropriate?
15:46 karolherbst: you could use this
15:46 karolherbst: I never used drm-next
15:48 dboyan_: jamm, I guess you still need drm-next for proper Pascal accel
15:50 karolherbst: dboyan_: well I rebase nouveau master on stable kernel trees, so I have current master on 4.10
15:52 dboyan_: karolherbst: yeah, the out-of-tree nouveau repo should work fine, but the master branch of skeggsb's kernel repo there is a little bit old
15:53 karolherbst: kernel tree is just for releases
15:53 karolherbst: and drm-next doesn't contain everything as well
15:53 karolherbst: if you want the newest stuff, you need to use the out of tree repo
15:55 jamm: karolherbst: is this the one? https://cgit.freedesktop.org/~airlied/linux/?h=drm-next
15:56 jamm: there's also a drm-tip https://cgit.freedesktop.org/drm-tip
16:11 imirkin_: airlied's one
16:11 imirkin_: no clue what drm-tip is
17:08 karolherbst: imirkin_: time to help me with that compute OOR issue?
17:09 imirkin_: no.
17:09 karolherbst: k
17:26 karolherbst: dboyan_: got a segfault now
17:28 karolherbst: dboyan_: on the second run on your branch: https://gist.github.com/karolherbst/c3c8f2341103f4429654f92424a3674c
17:29 karolherbst: mhhh wait
17:29 karolherbst: make clean first then I check again
17:40 karolherbst: dboyan_: yeah, it crashes
18:00 karolherbst: dboyan_: you can leave compute shaders out in your first version, that is fine
18:01 karolherbst: also the long black screen is also there by having only the tgsi/glsl cache enabled
18:02 karolherbst: dboyan_: also the tgsi/glsl cache has a nice big effect: 2m45s -> 1m6s
18:02 karolherbst:
18:23 Lyude: hey imirkin_ do i have to pass any special flags to that valgrind tool other then --mmt-trace-nvidia-ioctls to get the formatted MMT debugging output you got? (e.g. something that shows the name of the registers being written/read, values, colors, etc.) just running a plain trace on piglit's shader runner doesn't give me much useful info in the logs
18:24 imirkin_: yeah... the nouveau tracing of it is pretty much broken
18:24 imirkin_: for like 3-4 different reasons
18:24 imirkin_: reason #1: nvif - you can disable that in mesa
18:25 Lyude: jfyi this is tracing the nvidia blob, not nouveau
18:25 imirkin_: oh
18:25 imirkin_: well you need --log-file=foo
18:25 Lyude: i've got that
18:25 imirkin_: i think i usually also supply --mmt-something=/dev/nvidia0 etc
18:27 Lyude: Just to make sure, is it possible I might need root for this?
18:29 imirkin_: no
18:29 imirkin_: not possible.
18:29 imirkin_: OH
18:30 imirkin_: can you just share the trace? want to look at something
18:30 imirkin_: (xz -9 it)
18:30 Lyude: imirkin_: sure, gimme just a sec
18:34 Lyude: imirkin_: https://people.freedesktop.org/~lyudess/archive/3-20-2017/gm204-nv_fill_rectangle.mmt.xz
18:35 imirkin_: Lyude: add -m 126 to the demmt line
18:35 imirkin_: it can't detect the chipset version
18:35 imirkin_: which it tells you on the last line :)
18:37 Lyude: imirkin_: weird, that argument still isn't getting it to spit out any more info
18:37 imirkin_: update envytools? i pushed a fix a little while back
18:38 imirkin_: [and rebuild]
18:41 Lyude: imirkin_: ah, there we go, thanks!
18:42 imirkin_: =]
18:43 karolherbst: what is insbf?
18:43 imirkin_: insert bitfield
18:43 imirkin_: aka BFI
18:43 karolherbst: ahh
18:44 karolherbst: does that make any sense? insbf u32 $r6 $r5 0x00000c04 $r63
18:44 imirkin_: yeah, that zeroes out bits 12..15 on $r5
18:44 imirkin_: (i think)
18:44 imirkin_: or bits 4..15
18:44 imirkin_: i never remember the args
18:44 karolherbst: ohh
18:44 imirkin_: there's too many, and they're too confusing.
18:55 Lyude: ah, I see the difference with non-fill-rectangle using the macro vs. fill-rectangle writing all the registers by hand now
19:01 imirkin_: but i've never seen writes from a macro be any different than writes into the pushbuf...
19:01 Lyude: What do you mean by that?
19:01 imirkin_: macro is just a way to execute commands
19:02 imirkin_: (and do so conditionally)
19:02 imirkin_: and/or control-flow-ly
19:02 karolherbst: I just noticed, I missed the shader-db shaders in my fma patch... well nvm
19:02 Lyude: Ah, but aren't we seeing it do basically what the macro does except just by touching the registers by hand? or did I misinterpret what you said before
19:03 Lyude: that would make sense if they had to do the writes in a special order to make things actually work
19:03 imirkin_: we are seeing it... with PM: instead of PB:
19:03 imirkin_: that said, it writes FILL_RECTANGLE directly it seems
19:03 imirkin_: the macro stuff was for POLYGON_OFFSET stuff
19:03 imirkin_: which for some weird reason doesn't work right on gm200
19:03 imirkin_: but works fine on gm107
19:05 Lyude: ah
19:23 karolherbst: that sel pass is problematic... I have some shaders which increase their gpr usage by a lot (one from 25 to 31)
19:23 imirkin_: yeah, that can happen
19:23 karolherbst: yeah
19:24 karolherbst: I could be smart int he apss and check if the selp can at least load ine immediate inside
19:24 karolherbst: this would resolve that issue
19:24 karolherbst: mostly
19:25 karolherbst: but I can't check that if I don't have the selp yet
19:25 karolherbst: or I just throw the selp away later again
20:08 karolherbst: this looks acceptable for a selp pass: https://gist.githubusercontent.com/karolherbst/40d0e1b8d662988b4010c0234de6d3fd/raw/c552ab62f24ca0b4367d8bd34568965000b6b045/gistfile1.txt
20:10 imirkin_: huh, surprising that it has that effect on gpr's
20:10 karolherbst: this is a small effect on gprs
20:11 karolherbst: in my current version I only do the conversion if both are immediates, and both can be loaded (aka only 0 or limms)
20:11 karolherbst: ...
20:11 karolherbst: I meant short imms
20:11 karolherbst: imirkin_: the effect on the gprs is easily explained
20:12 karolherbst: imagine this:
20:12 karolherbst: set
20:12 karolherbst: $p0 mov $r1 0x,...
20:12 karolherbst: not $p0 mov $r1 0x....
20:12 imirkin_: oh, i'm sure it is.
20:12 karolherbst: if both can't be loaded
20:12 imirkin_: yea i know. but ideally the set should go away...
20:12 karolherbst: you have to track more values
20:12 karolherbst: yeah
20:12 karolherbst: next step
20:12 imirkin_: does it?
20:12 imirkin_: oh, it doesn't :)
20:12 imirkin_: that's unfortunate
20:12 karolherbst: well
20:13 karolherbst: there is no pass for it, is there?
20:13 imirkin_: DCE
20:13 karolherbst: uhm
20:13 imirkin_: oh, but the stupid branches
20:13 karolherbst: yes
20:13 karolherbst: the stupid branches go away
20:13 karolherbst: now I have set+selp
20:13 imirkin_: oh right.
20:13 imirkin_: duh.
20:13 karolherbst: 3766: set ftz u8 $p0 le f32 $r4 abs c1[0x74]
20:14 karolherbst: 3767: selp u32 $r4 $r63 0xffffffff not $p0
20:14 imirkin_: ;)
20:14 karolherbst: guess what
20:14 karolherbst: _D
20:14 karolherbst: maybe I should do the selp only for 0 and -1
20:14 imirkin_: so ... i'd convert that into cvt $r4 not $p0
20:14 imirkin_: and then have an algebraic opt
20:14 imirkin_: to "fix the glitch"
20:14 imirkin_: or something
20:14 karolherbst: mhhh
20:15 karolherbst: I think I will remove my hacky detection for good situations
20:15 karolherbst: and just do the selp opt if I get a bool output aka u32 0/-1
20:16 karolherbst: can't I simply convert the set+selp into a slct?
20:17 karolherbst: ohhhh wait
20:20 karolherbst: that selp is pretty much useless in that case...
20:21 imirkin_: set can output a thing directly
20:21 karolherbst: imirkin_: the best is where $r4 gets used later: 3771: set u32 $r4 ne $r4 $r63 (8)
20:21 imirkin_: yeah. it's all fantastic.
20:21 imirkin_: improving such sequences has long been on my list
20:21 imirkin_: but never made it to the top
20:22 karolherbst: okay, so next step is: set $p + selp 0 -1 -> set $r
20:25 karolherbst: imirkin_: where would you put such an opt?
20:25 karolherbst: algebraic or constant?
20:40 karolherbst: wow
20:41 karolherbst: okay, now I need a good brain
20:42 karolherbst: imirkin_: does this look correct to you? https://gist.githubusercontent.com/karolherbst/0ae548a011ac88cb8a800c176dde0b29/raw/cde93ee05da3f8add9fefefe5e89a7a85ea6285b/gistfile1.txt
20:44 karolherbst: mhh, I don't respect the values of the result for now anyway, oh well, that's getting complicated now
20:47 karolherbst: it stayed the same with respecting the result
20:52 karolherbst: uhm, that one set misses a cc
20:56 Lyude: By the way, what -is- PGRAPH anyway
20:57 imirkin_: it's an engine.
20:57 karolherbst: the important stuff
20:57 imirkin_: the nvidia gpu is composed of several engines
20:57 imirkin_: which behave somewhat independently
20:58 imirkin_: GRAPH contains all the drawing-related items
20:59 karolherbst: shouldn't invereseCondCode(lt) be gte?
21:00 imirkin_: karolherbst: inverseCondCode is different than reverseCondCode
21:00 imirkin_: or something
21:00 imirkin_: it's all extremely confusing, and i don't remember specifics :)
21:00 Lyude: Ah, btw: I'm not seeing any notable differences between the mmt traces for fill rect nv vs. fill, so I'm looking to see if the blob might be doing something differently in the macro it uses to set GL_POLYGON_MODE_FRONT/BACK
21:00 karolherbst: :D
21:00 karolherbst: inverse looks wrong
21:00 imirkin_: karolherbst: but long story short is those functions are *correct*, if you think they're incorrect, adjust your thinking.
21:00 karolherbst: reverse it is
21:00 karolherbst: hum
21:00 karolherbst: reverse is also wrong
21:01 imirkin_: i've thought those functions were wrong many times too
21:01 imirkin_: but in the end, they've come up victorious
21:01 karolherbst: no, I meant in my situation I used them wrong
21:02 imirkin_: oh, that's possible =]
21:02 karolherbst: .............. but still
21:02 karolherbst: reverse of lt is neu?
21:03 karolherbst: ohhhhhhhh
21:03 karolherbst: I see
21:04 karolherbst: at least everything looks broken in hitman after getting it wrong
21:04 karolherbst: so I am fairly sure when I get it right
21:08 karolherbst: this can't be right... can it
21:09 imirkin_: look at where those functions are already used.
21:09 karolherbst: I just completly lost track in my own code..
21:09 kattana: arli said something about 'threads & context' not working well between virgl/nouveau. What does it mean?
21:10 imirkin_: multithreaded GL calls + nouveau = sadface
21:10 kattana: ookk..
21:10 imirkin_: although, amusingly enough, mesa_glthread=true in the environment will probably work around the worst of it
21:11 karolherbst: imirkin_: I try to copy the first set by making a second set with the def from the phi node and try to take into account the cc of the bra, the values of the immediates inside the branches and where the 0/-1 is: https://gist.github.com/karolherbst/9babc35caa9bfcd0ebfacd6d78ae3a54
21:11 karolherbst: but I have no idea if this is even "correct"
21:11 kattana: I wonder whether this has to do with mplayer+vdpau hard blocks. Even with a tiny resolution video.
21:11 imirkin_: "hard blocks"?
21:12 kattana: imirkin_: I asked because starting a vm using e17 with compositing on I haven't see any errors so far.
21:12 kattana: imirkin_: instant kill of vid card.
21:12 imirkin_: are you on a G92?
21:13 kattana: only with vdpau, this used to happen last summer and I thought by now would've bee fixed.
21:13 kattana: wait
21:13 kattana: gk104
21:13 imirkin_: not aware of any vdpau hangs on GK104
21:14 imirkin_: (that said, if you try to do vdpau in one thread and GL in another thread, then same thing - boom!)
21:14 kattana: I recall trying to get valgrind to work with it and sent you something but never got around doing it.
21:14 imirkin_: but mplayer -vo vdpau should work fine
21:14 imirkin_: there *is* an issue where sometimes blocks appear when decoding H.264 issues which has not been diagnosed, on all generations.
21:15 kattana: imirkin_: it doesn't always fail, the first vid can survived, it's towards the third or fourth.
21:15 imirkin_: and this is with plain mplayer, and vo=vdpau?
21:15 kattana: by the way -vo vdpau doesn't full use vdpau, mplayer needs something else.
21:15 imirkin_: not with mpv or mplayer2 or whatever derivative
21:16 imirkin_: yeah, you also need -vc ffh264vdpau, etc
21:17 kattana: exactly.
21:18 kattana: imirkin_: well right now I wanted to know that about 'threads & context'. I'll hard lock my machine some other time.
21:18 kattana: thanks
21:22 karolherbst: ohh
21:22 karolherbst: it is preoptomized neu... that's why I got a neu
21:23 karolherbst: this looks correct to me: https://gist.githubusercontent.com/karolherbst/9babc35caa9bfcd0ebfacd6d78ae3a54/raw/f0208fff6c08d7455ab93ce18d5faa21807a6c34/gistfile1.txt
21:24 btborg: hey
21:24 btborg: My nouveau broke and won't connect to X
21:24 karolherbst: except the sType is missing :/
21:24 karolherbst: ohh wait
21:24 karolherbst: sType == dType
21:24 btborg: Segfaults, hexdumps, and really strange errors in journalctl
21:24 imirkin_: karolherbst: sounds right
21:25 btborg: GPU is GTX980Ti (Maxwell)
21:25 karolherbst: well piglit might tell me more
21:25 imirkin_: btborg: pastebin dmesg
21:26 btborg: will do
21:26 btborg: hold on let me get on my desktop
21:27 Lyude: some of this asm for the polygon mode front/back macros for the GM200 seems bizarre. "mov $r2 (add $r2 0xffffe4ff)"
21:28 imirkin_: oh interesting.
21:28 imirkin_: which macro?
21:29 Lyude: One for setting POLYGON_MODE_BACK in the nvidia blog, 0x2f
21:29 btborg: back on desktop
21:29 Lyude: *blob
21:29 Lyude: I'm assuming this must be where some of the magic is happening for NV_fill_rectangle if I can't see any other noticeable register differences
21:30 imirkin_: Lyude: ok, well, the macro language is not exactly the most versatile
21:30 imirkin_: Lyude: that's to check if the polygon mode == 0x1b01
21:30 imirkin_: (which is FILL)
21:31 imirkin_: looks like it does some weird shit with method 0xf14 - no clue what that is :(
21:31 Lyude: yeah i kept seeing that register get set to 0 in the traces and never get set to anything else
21:31 imirkin_: SP[0x3] == GS, SP[0x4] == FS
21:32 imirkin_: maybe it has to get set to something funny if e.g. you're drawing patches but have a tess evaluation shader outputting in point mode
21:32 imirkin_: dunno.
21:33 imirkin_: btw, fyi, branches in the macro language execute the next instr too unless there's a "annul" there
21:33 imirkin_: just like MIPS :)
21:33 btborg: okay
21:33 Lyude: i will sadly admit I have never done assembly before so this is new to me
21:33 btborg: heres the relevant logs
21:33 btborg: http://pastebin.com/2XyHizib
21:34 imirkin_: Lyude: oh, well, [hrm, my example was going to involve building a cpu, but no asm probably means you haven't built a cpu either...]
21:34 imirkin_: btborg: i've been seeing that too =/ try booting with nouveau.runpm=0
21:35 imirkin_: Lyude: imagine you're a CPU processing instructions... and you have an instruction that tells you to fetch the next op from some other place
21:35 imirkin_: Lyude: if you have no pipeline, no biggie - just fetch it from the other place and move on
21:35 btborg: also relevant:
21:35 btborg: Mar 20 17:19:32 _Nadia_ kernel: nouveau 0000:01:00.0: bus: MMIO write of 800000dc FAULT at 10eb14 [ IBUS ]
21:35 btborg: single line
21:35 imirkin_: Lyude: but if you have, e.g., a 2-stage pipeline, it's convenient to not worry about flushing the pipeline and just executing the next instruction anyways
21:35 imirkin_: btborg: that's likely harmless.
21:36 btborg: this too?
21:36 btborg: I saw this all the time when it was working
21:36 btborg: Mar 20 17:19:32 _Nadia_ kernel: nouveau 0000:01:00.0: DRM: Pointer to flat panel table invalid
21:36 imirkin_: btborg: boot with nouveau.runpm=0 and hopefully your situation will improve.
21:36 imirkin_: yea, that's fine
21:36 btborg: nouveau.runpm=0 ? does this just disable nouveau for intel?
21:37 imirkin_: btborg: it disables runtime suspend of the GPU, which probably isn't a thing for you anyways. it's only a thing for laptops.
21:37 btborg: ah, I see
21:37 btborg: will this hopefully make X and Nouveau work again (in theory)?
21:37 imirkin_: (and super-high-end motherboards which can power off individual devices)
21:37 imirkin_: hopefully.
21:38 btborg: where do I set that parameter?
21:38 imirkin_: kernel cmdline
21:38 btborg: where's that, in grub?
21:38 imirkin_: depends on how your machine is set up
21:38 imirkin_: but yes, many machines use grub to set that up.
21:38 btborg: ok, I'll check the relevant ArchWiki article
21:39 btborg: fixing
21:40 btborg: Rebooting
21:40 btborg: later
21:42 Mortiarty: imirkin, regarding "there *is* an issue where sometimes blocks appear when decoding H.264" - I can confirm that on a gk106. Can this be firmware related or if not where could that problem arise?
21:42 imirkin_: Mortiarty: i've spent days trying to figure out the issue. i failed.
21:43 imirkin_: Mortiarty: works fine with nvidia blob, so they know something about H.264 that we don't
21:43 imirkin_: i have a video that reproduces the issue very early on which i have yet to analyze
21:43 imirkin_: mostly just need someone to take a mmt trace on blob for me
21:44 Lyude: imirkin_: so like, https://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/drivers/nouveau/nvc0/mme/com9097.mme#n98 that would start fetching the instructions at #locn_0a_pmf, perform maddr0x36b, and then jump to #locn_0a_pmf if $r7 == 0?
21:44 imirkin_: Lyude: correct.
21:44 imirkin_: it's a 2-stage fetch-and-decode pipeline. so by the time the branch ends up "executing", it's already fetched the next op
21:45 imirkin_: MIPS and probably a few other RISC architectures used to do this too
21:46 Mortiarty: imirkin, i will glady help you with an mmt trace - can i use any video or do you have a clip for me for testing. it occurs btw. with some, not all h.264 encoded material
21:46 imirkin_: [and this is why branching is so bad on deep pipelines - you end up having to throw away a ton of work]
21:46 imirkin_: Mortiarty: well, the nice thing about this trace is that the issue happens on like the first frame
21:47 imirkin_: basically the further you go, the more things tend to diverge
21:47 imirkin_: since there's many ways to use the engine... like reference frame managemenet, etc
21:47 Lyude: if that conditional branch ends up not doing the jump becausse $r7 is nonzero, would the maddr 0x36b get... discarded somehow?
21:47 imirkin_: and it becomes difficult to compare what nouveau does to what blob does
21:47 imirkin_: Lyude: no...
21:47 Lyude: okay then I think I get it
21:48 imirkin_: Lyude: basically there are 2 pointers... the currently-executing instruction, and the currently-fetching instruction
21:48 imirkin_: [this is also why branch prediction is a thing... want to make sure you're filling your pipeline with the right instructions]
21:49 imirkin_: normally you end up having to stuff nop's in the delay slot, although the macro isa allows the "annul" modifier which doesn't execute the delay slot
21:50 imirkin_: [presumably by internally inserting a bubble into the pipeline]
21:52 nyef: ... I just spent far too long trying to track down a regression with HDMI audio on gt215 with 3D output. And it turns out that it's a display-specific problem.
21:52 imirkin_: Mortiarty: i don't have the trace on me, but i could probably share it with you later on
21:52 imirkin_: nyef: doh!
21:52 nyef: Audio works fine on a different panel, but it doesn't work on my PS 3D display.
21:52 imirkin_: does it work without 3d?
21:53 nyef: Not on the 3D display.
21:53 imirkin_: =/
21:53 nyef: And this also invalidates the "doesn't work if the DPort connector is in use" thing.
21:53 btborg: No luck
21:53 Mortiarty: imirkin, you meant the clip, right? And I make a trace?
21:53 imirkin_: btborg: pastebin dmesg
21:53 imirkin_: Mortiarty: yes.
21:54 Lyude: imirkin_: alright, I think I understand this :)
21:54 nyef: So, it's going to be about a week before I can do a proper regression test on the 3D patches for gt215.
21:54 btborg: has anyone else reported errors like this with Maxwell cards?
21:54 imirkin_: Lyude: it's really a little tangential to the whole thing :) btw, there's a bug in envyas that makes it unable to compile that mme file. have to comment something out in the ISA to make it work =/
21:54 imirkin_: btborg: if you're seeing that error with nouveau.runpm=0, that's ... unlikely.
21:55 btborg: is this likely an error of xorg or nouveau?
21:55 imirkin_: depends what "this" is
21:55 imirkin_: the error you were seeing before is nouveau's fault most likely... or something in drm core
21:55 Lyude: imirkin_: oh. thanks for letting me know lol
21:55 nyef: Which leaves the problems that I was having with the gk104 not running external displays at all, sorting out the frame-packing stuff, and starting in on the userland stuff.
21:55 imirkin_: btborg: but you are unlikely to be seeing that error now. unless you didn't properly add that param.
21:55 Lyude: also, I am guessing that 0xf14 register hasn't come up on other generations?
21:55 btborg: do I type "set nouveau.runpm=0" into grub?
21:55 imirkin_: btborg: it has to be on the kernel cmdline.
21:56 imirkin_: i highly doubt that that's the proper grub syntax
21:56 imirkin_: i think that just sets a varible in grub
21:56 imirkin_: Lyude: i don't think so.
21:56 btborg: where is that? in a config somewhere?
21:56 imirkin_: btborg: depends on your setup.
21:56 btborg: arch linux, systemd
21:56 imirkin_: can't help ya. esp with the systemd bit.
21:57 Lyude: interesting, maybe this 0xf14 register is the answer. i'll have to play with it later
21:58 btborg: oh i get it now
21:58 btborg: i did it wrong
21:58 btborg: edited the wrong line in grub
22:00 Mortiarty: imirkin, do i need https://nouveau.freedesktop.org/wiki/Valgrind-mmt/ ?
22:01 btborg: wow omg, VICTORY
22:01 btborg: X works again!!!
22:02 imirkin_: Mortiarty: yes.
22:02 btborg: thank you so, so much!
22:02 imirkin_: airlied_: ok, so ... this is like the third report of runpm fail with kernel 4.10
22:03 btborg: so whats the problem I was experiencing?
22:03 airlied_: imirkin_: sounds like bisect time r lucky guess
22:03 airlied_: should prob look at 4.10 log
22:04 btborg: ah, so this is both a problem of nouveau and linux itself?
22:06 imirkin_: btborg: nouveau is part of the linux kernel
22:07 imirkin_: (like every other hw driver)
22:07 imirkin_: airlied_: seems like the issues are largely happening on machines that should have no runpm in the first place
22:07 imirkin_: (i.e. desktops/laptops without acpi methods)
22:07 btborg: Is pm a laptop feature?
22:08 imirkin_: btborg: depends ... in this case, powering PCI devices off, is a platform feature largely reserved to laptops.
22:08 nyef: Hypothesis: GF119 worked fine with audio because the audio infoframe is handled by magic. GT215 doesn't because the audio infoframe is supplied by the driver and is hardcoded.
22:08 btborg: aha
22:08 imirkin_: nyef: magic does tend to work best.
22:09 nyef: Thus, gt215 working for audio at all is hit or miss.
22:09 btborg: yes, that explains why my system wouldnt shutdown properly!
22:09 btborg: had to hard reset
22:09 nyef: Also, g84 working for audio would *also* be hit or miss.
22:09 btborg: probably shouldve mentioned... :/
22:09 btborg: slipped my mind
22:10 nyef: Alternately, something went wrong with my 3D display.
22:10 nyef: Or both.
22:15 nyef: ... gk104, 3D modes work. Audio not tested.
22:17 Mortiarty: imirkin, compiled and tested vagrind - ready when you are.
22:18 imirkin_: not till tonight
22:20 Mortiarty: imirkin_, ok - btw i must congratulate you guys to the gk106 implementation. it runs much faster then the current nvidia-blob 378.13. i noticed a performance loss with the blob but never actually went into it until yesterday.
22:20 Mortiarty: nvidia auto: glmark2 Score: 2939
22:20 Mortiarty: mvodoa max : glmark2 Score: 2967
22:20 Mortiarty: nouveau 07 : glmark2 Score: 712
22:20 Mortiarty: nouveau 0a : glmark2 Score: 1782
22:20 Mortiarty: nouveau 0f : glmark2 Score: 4570
22:21 imirkin_: Mortiarty: that sounds ... surprising
22:22 imirkin_: we must be cheating somehow
22:22 Mortiarty: imirkin_, i know karolherbst said something like that... the older nvidia drivers worked much faster but i cant use them anymore with recent kernels... so
22:23 Mortiarty: nvidia must have changed something and i tried a lot already
22:23 imirkin_: very odd.
22:23 imirkin_: well, glad it works :)
22:23 Mortiarty: and the score matches 2 other results from the web... for nvidia blob
22:23 Mortiarty: yeah! yay!!!
22:24 airlied_: imirkin_: 4.10 has runtime pm for pcie ports
22:24 imirkin_: airlied_: nouveau.runpm=0 fixes it
22:24 imirkin_: and it's death by lock imbalance
22:28 imirkin_: RSpliet: ping re https://github.com/envytools/envytools/issues/88
22:36 airlied_: imirkin_: I'll take a dig today if my memory works :)
22:36 imirkin_: airlied_: and if not, i hear you can get replacements cheap now :p
22:39 imirkin_: [or you can try the memory doubler, johnny mnemonic-style.]
22:54 RSpliet: imirkin_: sorry, haven't had a lot of time since. I'll send that trace home tomorrow so I can take a proper look
22:55 imirkin_: RSpliet: ok. feel free to pass it on to me as well.
23:01 nyef: Okay, gk104 audio works with 3D.
23:01 imirkin_: could be a pre-existing bug on gt215. although i do think people generally said it worked.
23:01 nyef: Hell, *I've* said it worked.
23:01 imirkin_: otoh it had that eld bug since v4.3, i guess people don't test it a ton
23:01 imirkin_: well - back in the 3.x days :)
23:02 nyef: Sure, that was back before the driver hardcoded the infoframe.
23:04 nyef: So, gt215 final test needs to wait about a week, until I have access to the other 3D panel, but everything else works as expected.
23:05 nyef: And that leaves the frame-packing damage to sort out and then userland work.
23:06 nyef: Whatever userland work I do needs to leave at least a concession towards the 3D Vision kit, but at this point I'm not expecting to have the drivers for that sorted any time soon.
23:07 imirkin_: :)
23:16 karolherbst: imirkin_: okay, I figured out the difference between inverseCC and reverseCC
23:41 karolherbst: hum
23:41 karolherbst: when I only enable my SELFolding pass, hitman pro still runs, but if I add other opts, I get "asynchronous wait on fence nouveau:HitmanPro[4060]:80006d51 timed out" :/
23:41 karolherbst: I bet algebraic opt does something odd
23:42 nyef: Yeah, HDMI audio on gt215 doesn't stop working if there's something on the DPort. It's dependent on the panel liking whatever the driver is doing.
23:42 nyef: That's a simpler problem to debug, in a way.
23:43 nyef: At the very least, it's a fundamentals thing, not a "this hardware does something weird" thing.
23:44 nyef: Also had a coldplug failure on the DPort.
23:44 karolherbst: yep, it is algebraic opt
23:48 karolherbst: imirkin_: .............. hilarious: https://gist.githubusercontent.com/karolherbst/ef47a42fd073d14c6a23e2d215cd0d70/raw/d9494570aba7259e51442bece962cf3aaff7dfe4/gistfile1.txt
23:48 karolherbst: check the and
23:50 karolherbst: I guess an early DCE will fix that