06:04 fdobridge: <E​sdras Tarsis> Ben updated his patches, now my bug with disp is fixed and there are no more magic numbers in the switch case :)
06:04 fdobridge: <E​sdras Tarsis> now we need gsp-5303002.bin instead of gsp-5258902.bin I think
13:47 fdobridge: <k​arolherbst🐧🦀> that would be quite cool actually, because the new gsp apparently has more stuff implemented
14:09 fdobridge: <g​fxstrand> @karolherbst🐧 Does NV have any instructions that can take or return a vec3 other than tex ops?
14:09 fdobridge: <g​fxstrand> I know the global read/write can't.
14:10 fdobridge: <g​fxstrand> All the fp64 stuff is vec2
14:10 fdobridge: <g​fxstrand> Really, any non-power-of-two is a potential problem
14:12 fdobridge: <k​arolherbst🐧🦀> mhh, i'm sure there are vec3 loads.. let me check
14:14 fdobridge: <k​arolherbst🐧🦀> @gfxstrand inter stage data load/stores can do vec3
14:14 fdobridge: <k​arolherbst🐧🦀> `AL2P`, `ALD` and `AST`
14:19 fdobridge: <g​fxstrand> Ok. A bit silly but okay.
14:20 fdobridge: <k​arolherbst🐧🦀> yeah.. but
14:20 fdobridge: <k​arolherbst🐧🦀> you can treat it as vec4
14:21 fdobridge: <k​arolherbst🐧🦀> it's still vec4 aligned anyway, just have the 4th component free for other stuff
14:22 fdobridge: <g​fxstrand> Yeah
14:22 fdobridge: <g​fxstrand> That's the question: Do we actually care about vec3 or can I just round up to vec4 in RA?
14:22 fdobridge: <k​arolherbst🐧🦀> I'm sure there is this corner case where it might safe us gprs
14:22 fdobridge:<k​arolherbst🐧🦀> but
14:23 fdobridge: <k​arolherbst🐧🦀> gprs are allocated in blocks of 4 anyway
14:23 fdobridge: <k​arolherbst🐧🦀> so the chances it actually makes a difference is super low
14:23 fdobridge:<k​arolherbst🐧🦀> but
14:23 fdobridge: <k​arolherbst🐧🦀> we might want to detect this case for shader stats
14:23 fdobridge: <k​arolherbst🐧🦀> I just don't think it's a 0.1%+ performance thing
14:25 fdobridge: <g​fxstrand> If it's only texture sources and inter-stage loads, I don't think it'll ever matter.
14:25 fdobridge: <g​fxstrand> Can you have a vec3 texture destination?
14:29 fdobridge: <k​arolherbst🐧🦀> yes, so for scalar texture ops it actually matters
14:29 fdobridge: <k​arolherbst🐧🦀> because then you have a vec2 + scalar dest
14:29 fdobridge: <k​arolherbst🐧🦀> we just don't do scalar, so it's all vec4
14:29 fdobridge: <k​arolherbst🐧🦀> for tex it will actually matter
14:31 fdobridge: <k​arolherbst🐧🦀> or well.. matter more, because vec2 vs scalar is a bigger deal
14:31 fdobridge: <k​arolherbst🐧🦀> all those scalar texture ops are there to give RA a lot of freedom about placing values
14:50 fdobridge: <g​fxstrand> what do you mean vec2 + scalar dest?
14:50 fdobridge: <g​fxstrand> There's two destinations for tex ops?
14:51 fdobridge: <k​arolherbst🐧🦀> well.. yes so
14:51 fdobridge: <k​arolherbst🐧🦀> tex operations have this .SCR flag on turing
14:51 fdobridge: <k​arolherbst🐧🦀> (also on maxwell, but it's a different thing)
14:51 fdobridge: <k​arolherbst🐧🦀> and that makes the vec4 dest to be a pair of vec2
14:51 fdobridge: <k​arolherbst🐧🦀> but if you only need one destination, it's a scalar dest
14:52 fdobridge: <k​arolherbst🐧🦀> if you need two, you have a vec2
14:52 fdobridge: <k​arolherbst🐧🦀> if you need three, it's vec2 + scalar
14:53 fdobridge: <k​arolherbst🐧🦀> maybe that's always there with turing....
14:53 fdobridge: <k​arolherbst🐧🦀> but for the sources you have something similar going on
14:53 fdobridge: <k​arolherbst🐧🦀> ahh yeah.. on turing+ only the sources are affected by .SCR
14:55 fdobridge: <k​arolherbst🐧🦀> for maxwell/pascal you have this beauty: https://gitlab.freedesktop.org/mesa/mesa/-/commit/f821e80213e38e93f96255b3deacb737a600ed40
14:56 fdobridge: <k​arolherbst🐧🦀> how this works on turing+ is, that you have a list of sources and balance them between the two (up to vec4) sources
14:57 fdobridge: <k​arolherbst🐧🦀> .SCR only works if you have 4 or fewer sources
14:59 fdobridge: <k​arolherbst🐧🦀> 1: Src0 == Ra.x
14:59 fdobridge: <k​arolherbst🐧🦀> 2: Src0 == Ra.x, Src1 == Rb.x
14:59 fdobridge: <k​arolherbst🐧🦀> 3: Src0 == Ra.x, Src1 == Ra.y, Src2 == Rb.x
14:59 fdobridge: <k​arolherbst🐧🦀> 4: Src0 == Ra.x, Src1 == Ra.y, Src2 == Rb.x, Src3 == Rb.y
14:59 fdobridge: <k​arolherbst🐧🦀> and they are either scalar (no alignment constraints), or vec2
15:00 fdobridge: <k​arolherbst🐧🦀> hope that's understandable enough?
15:05 fdobridge: <k​arolherbst🐧🦀> and because it makes sense, the balancing works differently for the destination
15:06 fdobridge: <k​arolherbst🐧🦀> so 1st and 2nd channel always goes into the first reg
15:06 fdobridge: <k​arolherbst🐧🦀> 3rd and 4th always in the second
15:06 fdobridge: <k​arolherbst🐧🦀> pre volta actually, you only got a vec4 dest register
15:07 fdobridge: <k​arolherbst🐧🦀> well
15:07 fdobridge: <k​arolherbst🐧🦀> except for those fancy scalar ones in maxwell+pascal
15:08 fdobridge: <k​arolherbst🐧🦀> also the reason why it's so restricted there, because you actually need 16 more bits to encode the 2nd dest and src reg
15:08 fdobridge: <k​arolherbst🐧🦀> and you only got 64 in total 🙂
15:15 fdobridge: <k​arolherbst🐧🦀> @airlied seems like with GSP I can run the mme tests, which is good enough 🙂
15:15 fdobridge: <k​arolherbst🐧🦀> but I do have some hard display regressions with the newest kernel 😄
15:38 fdobridge: <g​fxstrand> I thought there were tex ops with more than 4 args
15:38 fdobridge: <k​arolherbst🐧🦀> yes, for those you can't use the `.SCR` flag
15:39 fdobridge: <g​fxstrand> Okay... How do those work then?
15:39 fdobridge: <g​fxstrand> vec4 + remainder?
15:39 fdobridge: <k​arolherbst🐧🦀> like they do in codegen atm
15:39 fdobridge: <k​arolherbst🐧🦀> in non SCR form you have two vec4 sources
15:39 fdobridge: <k​arolherbst🐧🦀> and just fill them from the start
15:42 fdobridge: <k​arolherbst🐧🦀> 1st source: LocClamp[27:16] | array[15:0], s, t, r
15:42 fdobridge: <k​arolherbst🐧🦀> 2nd source: sampler[31:20] | header[19:0], lod, off[11:0], DC
15:42 fdobridge: <k​arolherbst🐧🦀> in `.SCR` form you ignore the association between source and type and just have a unified list you balance across the 2 vec2 sources according to the above rules
15:44 fdobridge: <k​arolherbst🐧🦀> yeah.. so in the normal mode each source type has its fixed place in the vec4 pair
15:47 bylaws: airlied wdym by it's not a register?
15:48 bylaws: i mean the counter itself, I assume it isn't reset upon counter reports?
15:48 bylaws: since it has to reset to 0 at some point
16:02 fdobridge: <g​fxstrand> I think he means that there isn't a state register that is the offset. There's a register to query the offest.
16:02 fdobridge: <g​fxstrand> I think he means that there isn't a state register that is the offset. There's a register to query the offset. (edited)
16:05 fdobridge: <g​fxstrand> When is it reset? Probably when the buffer address or size is changed but we don't have docs.
16:06 bylaws: Right that seems reasonable, thanks
16:34 fdobridge: <k​arolherbst🐧🦀> okay.. progress
16:34 fdobridge: <k​arolherbst🐧🦀> on GSP that macro loops forever
16:34 fdobridge: <k​arolherbst🐧🦀> or maybe I just used it incorrectly
16:35 fdobridge: <k​arolherbst🐧🦀> ehh nvm.. wrong increment mode
16:36 fdobridge: <k​arolherbst🐧🦀> IT WORKS!!!
16:36 fdobridge: <k​arolherbst🐧🦀> @gfxstrand that macro works :3
16:36 fdobridge: <k​arolherbst🐧🦀> the test: https://gist.githubusercontent.com/karolherbst/98217df7df9ce7a9bb3d0e112222fb09/raw/0cbacb169466763f2a04c7fa805a067e89a08501/test.shader_test
16:37 fdobridge: <k​arolherbst🐧🦀> without the macro: 1 vs 15
16:37 fdobridge: <k​arolherbst🐧🦀> with the macro: 15 vs 15 :3
16:37 fdobridge: <k​arolherbst🐧🦀> okay....
16:37 fdobridge: <k​arolherbst🐧🦀> fun fact.. I didn't provide any buffer yet 😄
16:37 fdobridge: <k​arolherbst🐧🦀> I hope it's now in allow everything mode
16:38 fdobridge: <k​arolherbst🐧🦀> let me try to mess with random regs
16:39 fdobridge: <k​arolherbst🐧🦀> heh...
16:39 fdobridge: <k​arolherbst🐧🦀> it doesn't let me 😄
16:39 fdobridge: <k​arolherbst🐧🦀> now I'm curious about the error
16:39 fdobridge: <k​arolherbst🐧🦀> didn't get one..
16:44 fdobridge: <g​fxstrand> @karolherbst🐧 What macro? You got a GSP FALCON macro to work?
16:44 fdobridge: <k​arolherbst🐧🦀> yeah
16:44 fdobridge: <k​arolherbst🐧🦀> I was able to enable helper invocation memory loads through that `mme 33` macro :3
16:44 fdobridge: <k​arolherbst🐧🦀> entirely from userspace
16:44 fdobridge: <k​arolherbst🐧🦀> so that one uses `NVC597_SET_FALCON04` for it's stuff
16:45 fdobridge: <k​arolherbst🐧🦀> no idea what `NVC597_SET_FALCON09` is all about honestly
16:45 fdobridge: <k​arolherbst🐧🦀> next step would be to use the mme builder
16:45 fdobridge: <k​arolherbst🐧🦀> seems like if I try to write into reg `0x200` GSP reaps the channel
16:45 fdobridge: <k​arolherbst🐧🦀> I'll try to figure out what else I can do with it 😄
16:46 fdobridge: <k​arolherbst🐧🦀> just to make sure it doesn't open the door to weird security problems
16:46 fdobridge: <k​arolherbst🐧🦀> anyway.. I'm sure it doesn't work with the old school firmware now
16:46 fdobridge: <k​arolherbst🐧🦀> and userspace will need a "runs on GSP" flag entirely for that
17:06 fdobridge: <g​fxstrand> If we really wanted to make it transparent to userspace, we could have the kernel run a pushbuf on context create but I'm also happy to have Mesa do it as long as we know all this stuff before we actually merge to main so we don't have any actual backwards compatibility problems.
17:18 fdobridge: <k​arolherbst🐧🦀> yeah.. so the idea would be that the device info ioctl gets a new field: `runs_gsp` or something, and depending on that mesa is doing it's thing or not
17:18 fdobridge: <k​arolherbst🐧🦀> and for the non gsp case, we just whack that reg in the kernel
17:18 fdobridge: <k​arolherbst🐧🦀> it's unfortunate, but I don't want to figure out how to do this the same way with the nvidia provided old school firmware
17:18 fdobridge: <k​arolherbst🐧🦀> if it's like disabled and all
17:39 fdobridge: <g​fxstrand> Yeah
17:39 fdobridge: <g​fxstrand> What happens if you run a FALCON4 macro with the old firmware? No-op? Context loss? Something in-between?
17:41 fdobridge: <M​ohamexiety> ```
17:41 fdobridge: <M​ohamexiety> [ 3.861135] nouveau 0000:01:00.0: gsp: firmware "nvidia/ga102/gsp/gsp-5258902.bin" loaded - 37324728 byte(s)
17:41 fdobridge: <M​ohamexiety> [ 3.960264] nouveau 0000:01:00.0: gsp: firmware "nvidia/ga102/gsp/bootloader-5258902.bin" loaded - 12388 byte(s)
17:41 fdobridge: <M​ohamexiety> [ 4.171455] nouveau 0000:01:00.0: gsp: firmware "nvidia/ga102/gsp/booter_load-5258902.bin" loaded - 37752 byte(s)
17:41 fdobridge: <M​ohamexiety> ```
17:41 fdobridge: <M​ohamexiety> gsp works on ga102 \o/
17:47 fdobridge: <k​arolherbst🐧🦀> nothing
17:47 fdobridge: <k​arolherbst🐧🦀> or at least nothing I could observe
17:47 fdobridge: <k​arolherbst🐧🦀> I can try again, now that I know that my stuff works
17:47 fdobridge: <k​arolherbst🐧🦀> but I think with the non gsp stuff it just didn't make any difference
17:47 fdobridge: <k​arolherbst🐧🦀> might also require me to do more on the kernel side
17:47 fdobridge: <k​arolherbst🐧🦀> anyway, having the userspace side figured out helps here 🙂
17:59 fdobridge: <a​irlied> For the nvidia supplied old fw we have to setup the table. GSP must keep the register list in the fw.
18:00 fdobridge: <a​irlied> Also not sure if we should have a big gap in use switch or make it more finegrained
18:01 fdobridge: <a​irlied> I suppose we could report gap fw version in use at least
18:02 fdobridge: <a​irlied> Maybe stick a gsp in driver strings
18:09 fdobridge: <k​arolherbst🐧🦀> there is an "allow all" config option
18:09 fdobridge: <k​arolherbst🐧🦀> the buffer is an optional thing
18:09 fdobridge: <k​arolherbst🐧🦀> I don't even provide a buffer for gsp at all either
18:10 fdobridge: <a​irlied> I think the gsp fw provides it
18:10 fdobridge: <k​arolherbst🐧🦀> potentially
18:10 fdobridge: <a​irlied> but maybe it doesn't, seems wierd that nvidia would default to an insecure mode
18:10 fdobridge: <k​arolherbst🐧🦀> anyway.. knowing that the userspace side works helps a lot figuring out the kernel side
18:10 fdobridge: <k​arolherbst🐧🦀> it's not fun having to figure out both at once 😄
18:10 fdobridge: <k​arolherbst🐧🦀> yeah..
18:10 fdobridge: <k​arolherbst🐧🦀> sooo
18:10 fdobridge: <k​arolherbst🐧🦀> allow all is `0` even
18:11 fdobridge: <a​irlied> like openrm never sets up a list
18:11 fdobridge: <k​arolherbst🐧🦀> https://github.com/NVIDIA/open-gpu-doc/blob/master/manuals/volta/gv100/dev_ctxsw.ref.txt#L105
18:12 fdobridge: <k​arolherbst🐧🦀> nouveau currently sets it to: `https://github.com/NVIDIA/open-gpu-doc/blob/master/manuals/volta/gv100/dev_ctxsw.ref.txt#L105` 🙃
18:12 fdobridge: <k​arolherbst🐧🦀> nouveau currently sets it to: `#define NV_CTXSW_MAIN_IMAGE_PRIV_ACCESS_MAP_CONFIG_MODE_ALLOW_ALL 0x00000000` 🙃 (edited)
18:13 fdobridge: <a​irlied> if openrm doesn't do, then the gsp fw has to do it, there isn't anywhere else to hide it
18:13 fdobridge: <k​arolherbst🐧🦀> it's part of the ctx header
18:13 fdobridge: <a​irlied> which I assume is under the fw control not the open bits
18:13 fdobridge: <k​arolherbst🐧🦀> yeah, I don't know
18:13 fdobridge: <a​irlied> otherwise they'd clearly be setting it in openrm
18:13 fdobridge: <a​irlied> you can't set it in userspace
18:13 fdobridge: <k​arolherbst🐧🦀> I have no idea how the contexts are created under gsp
18:14 fdobridge: <k​arolherbst🐧🦀> I meant the header kernelspace creates
18:14 fdobridge: <a​irlied> kernelspace doesn't create it for gsp
18:14 fdobridge: <k​arolherbst🐧🦀> it's part of the golden context stuff?
18:14 fdobridge: <a​irlied> yes that seems likely
18:15 fdobridge: <k​arolherbst🐧🦀> maybe there are some toggles or something?
18:15 fdobridge: <k​arolherbst🐧🦀> anyway.. will check that out later this week
18:15 fdobridge: <a​irlied> not sure what there would be to toggle here, it makes little sense for nvidia to allow creating insecure gsp contexts
18:15 fdobridge: <k​arolherbst🐧🦀> right
18:15 fdobridge: <k​arolherbst🐧🦀> but they had the option with their current driver already
18:16 fdobridge: <k​arolherbst🐧🦀> and it's still an open question if it's indeed disabled in the old school firmware, which I'm fairly sure should be disabled
18:16 fdobridge: <k​arolherbst🐧🦀> otherwise we have to file a CVE 🙃
18:16 fdobridge: <a​irlied> I think nvgpu is using the same old school fw so we should be able to follow that
18:16 fdobridge: <k​arolherbst🐧🦀> no
18:16 fdobridge: <k​arolherbst🐧🦀> it doesn't
18:17 fdobridge: <k​arolherbst🐧🦀> nouveau handed out custom made firmware for nouveau
18:17 fdobridge: <a​irlied> oh you mean old school nouveau context fw
18:17 fdobridge: <k​arolherbst🐧🦀> Nvidia handed out custom made firmware for nouveau (edited)
18:17 fdobridge: <a​irlied> I thought you meant old school nviida
18:17 fdobridge: <k​arolherbst🐧🦀> it's not the same as what Nvidia's driver is using
18:17 fdobridge: <k​arolherbst🐧🦀> yeah
18:17 fdobridge: <a​irlied> oh skeggsb is pretty sure the fecs/gr fw was the same
18:17 fdobridge: <a​irlied> the custom stuff was more for the secure boot bits etc
18:17 fdobridge: <k​arolherbst🐧🦀> mhhh
18:17 fdobridge: <k​arolherbst🐧🦀> well
18:17 fdobridge: <k​arolherbst🐧🦀> this is security related tho
18:18 fdobridge: <k​arolherbst🐧🦀> I'll dig deeper, but at least from what I can tell.. this part doesn't do anything
18:18 fdobridge: <k​arolherbst🐧🦀> I even provided a random garbage buffer address
18:18 fdobridge: <k​arolherbst🐧🦀> nothing
18:18 fdobridge: <k​arolherbst🐧🦀> though it might fault, but nope
18:20 fdobridge: <k​arolherbst🐧🦀> thought it might fault, but nope (edited)
18:27 fdobridge: <k​arolherbst🐧🦀> @airlied anyway.. nouveau with or without gsp on Ben's branch regresses display support 😦
18:35 fdobridge: <E​sdras Tarsis> Nice!
18:35 fdobridge: <E​sdras Tarsis> now update your tree and use the 530 version 🐸
19:38 fdobridge: <J​., Echo (she) 🇱🇹> When will NVK run Crysis?
19:45 fdobridge: <M​ohamexiety> display seems to work using GSP too.
19:45 fdobridge: <M​ohamexiety> ```
19:45 fdobridge: <M​ohamexiety> Extended renderer info (GLX_MESA_query_renderer):
19:45 fdobridge: <M​ohamexiety> Vendor: Mesa (0x10de)
19:45 fdobridge: <M​ohamexiety> Device: NV172 (0x2216)
19:45 fdobridge: <M​ohamexiety> Version: 23.0.0
19:46 fdobridge: <M​ohamexiety> Accelerated: yes
19:46 fdobridge: <M​ohamexiety> Video memory: 10219MB
19:46 fdobridge: <M​ohamexiety> Unified memory: no
19:46 fdobridge: <M​ohamexiety> Preferred profile: core (0x1)
19:46 fdobridge: <M​ohamexiety> Max core profile version: 4.3
19:46 fdobridge: <M​ohamexiety> Max compat profile version: 4.3
19:46 fdobridge: <M​ohamexiety> Max GLES1 profile version: 1.1
19:46 fdobridge: <M​ohamexiety> Max GLES[23] profile version: 3.2
19:46 fdobridge: <M​ohamexiety> ```
19:46 fdobridge: <M​ohamexiety> had to use KDE wayland tho. KDE x11 worked for like 5 seconds and then the whole window manager just died
19:46 fdobridge: <M​ohamexiety> (this is on GA102)
19:46 fdobridge: <M​ohamexiety> also using the latest version of ben's repo. so kernel 6.3 and firmware 530.30.02
19:50 fdobridge: <J​., Echo (she) 🇱🇹> So Wayland better 😈
20:14 fdobridge: <E​sdras Tarsis> In this case, yes, I proved with glmark2
21:00 fdobridge: <g​fxstrand> Cool. In that case, we can just run the FALCON macro on context create whether or not GSP is enabled and just trust kernel setup for the non-GSP case.
21:01 fdobridge: <k​arolherbst🐧🦀> ... _maybe_
22:29 skeggsb: karolherbst: i'm 95% certain we use identical gr fw to nvidia (ours is probably a few revisions behind now, but that shouldn't matter)
22:29 skeggsb: i've extracted and diffed them before
22:29 skeggsb: probably just setup wrong
22:30 skeggsb: we use a legacy context header still too
22:30 skeggsb: mostly because i didn't want to deal with splitting it for our fw vs nv's
23:25 fdobridge: <J​., Echo (she) 🇱🇹> Why could nouveau runpm (nouveau.runpm=1) freeze my system? 🐸
23:47 fdobridge: <J​., Echo (she) 🇱🇹> Actually it doesn't freeze, but I get this
23:47 fdobridge: <J​., Echo (she) 🇱🇹> `kernel: nouveau 0000:01:00.0: Unable to change power state from D3cold to D0, device inaccessible`
23:48 fdobridge: <J​., Echo (she) 🇱🇹> The NVIDIA blob driver says that runtime D3 isn't supported
23:56 fdobridge: <k​arolherbst🐧🦀> well.. it's broken
23:57 karolherbst: skeggsb: yeah.. no idea.. thing is, it didn't work with the one we've gotten. But let me take another look tomorrow and see if I can make it work
23:59 fdobridge: <J​., Echo (she) 🇱🇹> `kernel: nouveau 0000:01:00.0: gr: DATA_ERROR 0000009c [] ch 2 [00ffe46000 supertuxkart[4531]] subc 0 class c597 mthd 0d78 data 00000004`
23:59 fdobridge: <J​., Echo (she) 🇱🇹>
23:59 fdobridge: <J​., Echo (she) 🇱🇹> Ooops 🤔
23:59 fdobridge: <J​., Echo (she) 🇱🇹> glxgears works though