00:46 TimurTabi: airlied: which one?
00:51 airlied: TimurTabi: I just moved to 535.113.01
00:53 TimurTabi: airlied: are you still hacking up our header files?
00:54 airlied: TimurTabi: still doing whatever Ben did
00:54 TimurTabi: airlied: oof, you should fix that
00:54 airlied: fix it how?
00:54 airlied: I just renamed all the 535.54.03 -> 535.113.01 for now
00:55 airlied: any designs for how to do it properly would be gladly accepted, I think dakr is going to start looking at it soon
00:55 TimurTabi: Make it so you can copy the files verbatim.
00:57 airlied: I don't think that will be useful long term unfortunately
00:57 dakr: TimurTabi, I think this won't work supporting multiple firmware versions.
00:57 airlied: it would be a struct naming/versioning nightmare
00:58 TimurTabi: Why not? It would greatly simplify moving to new versions
00:58 TimurTabi: No more three way diffs
00:58 airlied: https://gitlab.freedesktop.org/nouvelles/kernel/-/commits/nouveau-fw-535.113.01
00:58 airlied: not really
00:58 airlied: since we have to keep maintaining the older versions
00:59 airlied: it would have made it easier to do this move which I don't want to keep backwards compat
00:59 airlied: but after this we have to keep backwards compat
01:00 TimurTabi: I still think it would be a good idea
01:02 airlied: just not sure how it would work in practice
01:02 airlied: we currently import pieces from 58 headers
01:03 airlied: I think if we took the complete header files we'd likely add a lot more dependencies
01:03 airlied: and since we can't just copy them over moving forward, it's doesn't really avoid the 3 way diffs problem
01:03 TimurTabi: Sounds like a good job for an intern
01:04 airlied: no redesigning it completly to not include the headers might be a more sensible idea
01:04 airlied: just generate an interface description from the nvidia driver, and output nouveau headers for it
01:05 airlied: it might turn out to be a difficult challenge, but I think it's worth a try
01:06 TimurTabi: A script to extract the macros and structs might work
01:15 airlied: TimurTabi: we do something in mesa for the class headers but this seems like it would be more complex since the headers are less defined
01:19 TimurTabi: Maybe use cscope to enumerate the identifiers that Nouveau uses?
02:22 airlied: yeah something like cscope or a python c parser would be needed
03:56 fdobridge: <!​[NVK Whacker] Echo (she) 🇱🇹> What GSP version will be used upstream?
04:02 fdobridge: <a​irlied> probably try and use 535.113.01 now
04:22 fdobridge: <a​irlied> also looks like setting the registry entries might paper over the bar2 fault crash
04:25 fdobridge: <!​[NVK Whacker] Echo (she) 🇱🇹> I can see you merged a GSP branch that still uses 535.54.03 into drm-tip
04:27 fdobridge: <a​irlied> yeah that was yesterday, who knows what tomorrow will bring
04:32 fdobridge: <!​[NVK Whacker] Echo (she) 🇱🇹> Also is it possible to get KMS on Ada without GSP? 🐸
04:36 fdobridge: <a​irlied> no I don't think it is
05:18 fdobridge: <l​ingm> @marysaka yeah, rustup 1.23+ should read a `rust-toolchain.toml` and download the specified version automatically when attempting a build. on a glance your file looks valid...
05:18 fdobridge: <l​ingm> since nightly features can be added and removed at any time it would be a good idea to pin a specific nightly to use. e.g. `channel = "nightly-2023-10-30"`, but that shouldn't have blocked it from working for Andrew.
05:20 airlied: dakr: 3 patches on the list for getting to latest fw + fixes, I'd like to get those looked at and the consider sending the topic branch to Linus
05:34 fdobridge: <l​ingm> no idea what went wrong there. `cargo build`ing envyhooks immediately downloads the latest nightly and then builds fine 🤷
07:14 fdobridge: <k​arolherbst🐧🦀> in theory yes, we kinda had it supported on Ampere. The issue is just that you can only have a single context and it's all pain
07:15 fdobridge: <k​arolherbst🐧🦀> and you'd need code for the display engine
07:15 fdobridge: <k​arolherbst🐧🦀> or is Ada looked down so much?
07:26 AndrewR: may be my problem was that I first installed rust from Slackware repo, only after first failed build I added rustup (separate package) and only after that I started to manually call it for downloading toolchains ...
07:38 fdobridge: <l​ingm> AndrewR: apparently you need to manually setup your system to call the rustup shims on slackware: <https://slackbuilds.org/slackbuilds/15.0/development/rustup/README>
07:38 fdobridge: <l​ingm> if you didn't do that, no wonder it didn't work. on arch the `rustup` package conflicts with the `rust` and `cargo` packages but then it works as expected out of the box. i'd classify that as a packaging bug.
07:42 AndrewR: anyway, it was build, but when I tried to run it via script: ./run_preload ~/ffmpeg -i /mnt/hd/guest/Sea_of_life_plus_Mikura_dolphins_test.mp4 -c:v nvenc_h264 -f null /dev/null
07:42 AndrewR: I got my cuda error :}
07:43 karolherbst: yeah.. I guess that's expected because version mismatch and stuff
07:49 AndrewR: karolherbst, I can try to build your valgrind stuff if it does not requre kernel modification (running from live dvd rn)
07:50 karolherbst: uhhhhh.... it's kinda a pain, and you will have to update it for your version, but: https://github.com/karolherbst/valgrind/tree/uvm and https://github.com/karolherbst/envytools/tree/UVM
07:50 karolherbst: and it also uses headers from the blob driver
07:51 AndrewR: oh, moment, trying to convince nvidia driver to drive my monitor at 1440x900 (bad vga cable is bad - so it all blurred at 1024x768)
07:51 karolherbst: and it's very incomplete
07:51 karolherbst: it was more of a prototype to parse those UVM ioctls without having to like reverse engineer the layout and just use nvidias headers there
07:52 karolherbst: but not sure how much of that is useful for the video encoding/decoding stuff
08:04 AndrewR: karolherbst, anything special for building or autogen.sh/configure/make will make it?
08:06 karolherbst: uhhh.. you might have to change some paths
08:11 AndrewR: I just cp any .h file it was complainig, thankfully for this tool my driver provides all files ...
08:12 karolherbst: yeah.. though you might have to update mmt quite a bit...
08:12 karolherbst: ioctl changes and all that
08:12 karolherbst: _however_ maybe these days the driver has all the info anyway
08:12 karolherbst: dunno
08:13 karolherbst: but I think there is also a lot of secret stuff in the driver
08:13 AndrewR: karolherbst, well, it compiled :} therefore I can use it ..how?
08:13 karolherbst: https://nouveau.freedesktop.org/Valgrind-mmt.html
08:14 karolherbst: but anyway.. valgrind-mmt is practically annoying to use, so I kinda wish we'd focus more on Marys tool and make that run better. Valgrinds overhead is a giant pita
08:16 AndrewR: yeah, just 2 fps insteat of 65. but for encoder this doesn't matter? anyway, few seconds of trace resulted in 8 mb log. upload it to where?
08:17 karolherbst: nah
08:17 karolherbst: parse it with `demmt`
08:17 karolherbst: which will fail to parse it
08:17 karolherbst: but whatevef
08:17 karolherbst: the fun part is to make it work :P
08:17 karolherbst: _however_
08:18 AndrewR: well, I can't find demmt tool?
08:18 karolherbst: we also have this: https://github.com/NVIDIA/open-gpu-doc/tree/master/classes/video but I doubt it's too much useful on old GPUs like Kepler
08:18 karolherbst: AndrewR: second repo
08:21 AndrewR: https://pastebin.com/CC2kR0gz
08:22 AndrewR: multiple definitions ..
08:22 karolherbst: yeah well.. none of this is end user friendly and also needs fixing
08:27 AndrewR: first err silenced by adding static keyword in include ..
08:27 AndrewR: root/envytools/demmt/drm.c:574:38: error: ‘NOUVEAU_GETPARAM_FB_PHYSICAL’ undeclared (first use in this function); - second one is more serious?
08:28 karolherbst: mhh, we removed that ioctl from nouveau
08:28 karolherbst: you probably can just remove the code
08:30 AndrewR: it also complains about NOUVEAU_GETPARAM_AGP_PHYSICAL and NOUVEAU_GETPARAM_PCI_PHYSICAL
08:31 karolherbst: same
08:31 AndrewR: because I am not interested in nouveau tracing I can also comment them out?
08:31 karolherbst: just remove it
08:31 karolherbst: nouveau userspace also won't ever use them
08:31 karolherbst: so it's kinda pointless to keep it around anyway
08:33 AndrewR: https://pastebin.com/NuKY0iD6 - more errs :}
08:33 AndrewR: jsut comment THEM out too?
08:34 karolherbst: nah
08:34 karolherbst: those are actual problems
08:34 karolherbst: due to UVM having changed and stuff :)
08:35 karolherbst: just check how your version looks like and adjust the code to that
08:35 karolherbst: I never got to the point where I made it work for multiple versions of the driver
08:36 karolherbst: I was mostly just interested in figuring out how painful it would be to just use nvidia headers instead of what we've done before
08:41 AndrewR: karolherbst, https://pastebin.com/64m1qCF0 -structure for my version of driver ... does not look like it itself was versioned, may be version lives up there somewhere ..
08:41 karolherbst: yeah... no idea how UVM is versioned at all
08:41 karolherbst: there might be some define _somewhere_
08:52 AndrewR: https://pastebin.com/5Tynjgqj hacks
08:54 karolherbst: uhhh
08:54 karolherbst: why do they change field names like that :D
08:55 AndrewR: ./demmt/mmt_bin2dedma < ../valgrind/file-bin.log > file-txt.log
08:58 AndrewR: too big for pastebin ...
08:59 karolherbst: ahh, so it's recording stuff?
08:59 karolherbst: nice
09:00 AndrewR: it tries? https://pastebin.com/kwjdCWyZ
09:00 karolherbst: mhhh
09:00 karolherbst: pain
09:00 karolherbst: but yeah...
09:00 karolherbst: nvidias ioctl aren't stable at all
09:00 karolherbst: so if you use a newer version you kinda have to figure out all the new bits
09:00 AndrewR: feels the pain :}
09:01 karolherbst: that's why I kinda hoped you could use Marys stuff, because that just uses headers from the driver
09:01 AndrewR: well, from too new driver :}
09:01 karolherbst: yeah...
09:15 AndrewR: demmt still does not work: unknown type: 0x1b
09:17 karolherbst: pain..
09:17 karolherbst: but yeah...
16:06 AndrewR: karolherbst, any idea how hard fixing demmt for this specific use case can be?
16:09 karolherbst: btween 5 minutes and a month of work
16:09 karolherbst: or more
16:09 karolherbst: reverse engineerring ioctls where you have no idea how the data layout is can be a lot of work
16:09 karolherbst: but
16:09 karolherbst: most of the stuff is actually just command buffers.. soo yeah.. dunno
16:15 AndrewR: if I look with less on binary log I Warning: noted but unhandled ioctl 0x49 and same for 0x21 ...
16:18 karolherbst: yeah.. soo...
16:19 karolherbst: you can always check out the earliest open source release and see how much of that makes sense
16:19 AndrewR: https://pastebin.com/vTmRKigy - full (hopefully) list. Isn't open-source releases of nvidia kernel started rom 500.xx ?
16:19 AndrewR: *from
16:20 AndrewR: can demmt just skip stuff it does not understand?
16:38 karolherbst: mhhh
16:39 karolherbst: yes, but it shouldn't
16:39 karolherbst: it could map memory
16:39 karolherbst: and that memory could contain command buffers
16:43 AndrewR: well, gues then I am stuck :) but bin2dedma still gives something ... any hint on how to fish useful info from that?
17:24 karolherbst: hard to say.. you could try to find command buffers on the subchannels related to video encoding/decoding and see what those are doing
17:46 AndrewR: karolherbst, thanks. I'll read more on it after some more sleep ...
18:22 AndrewR: karolherbst, cool nvidia demand login for NEARLY all video sdk verions ....
18:22 karolherbst: pain
18:23 AndrewR: karolherbst, also, according to some pdf async mode on exist on Windows drivers ...
18:40 airlied: is there any kepler vulkan video driver?
18:40 karolherbst: doubtful
18:40 karolherbst: kepler was ditched in 470 or so?
18:41 airlied: i suspect re on a maxwell might be similiar
18:41 karolherbst: mhhh
18:41 karolherbst: at least it's closer
18:41 airlied: we have some tegra video class headers also
18:42 karolherbst: yeah
18:42 karolherbst: but video stuff is apparently different
18:42 karolherbst: (on tegra)
18:42 airlied: its not though
18:42 karolherbst: no?
18:42 karolherbst: interesting...
18:43 airlied: its not perfectly same but dont think it was too different
18:44 karolherbst: I think the biggest difference is, that the tegra side consumes the command buffers instead or something?
18:44 airlied: i have a request to get geforce video class headers winding its way
18:44 karolherbst: yeah.. nice
18:44 airlied: through nvidia
18:44 karolherbst: maybe we get them next yeah
18:44 karolherbst: *year
18:44 karolherbst: I should ping again on the SPH and other request I made :)
18:44 karolherbst: poor Andy
18:44 airlied: i was going to dump some vulkan video pushbufs at some point
18:46 airlied: i wonder should i bring an nvidia laptop on my trip, they are all pretty heavy
18:46 karolherbst: mhhh
18:46 karolherbst: what trip
18:46 airlied: plumbers
18:46 karolherbst: ahh
18:46 karolherbst: some of the lenovo ones aren't too bad there
18:47 karolherbst: though I think a Dell XPS one is lighter
18:47 airlied: yeah the selection i have ranges from super heavy to merely heavy :-p
18:47 karolherbst: pain
18:52 AndrewR: vkcube
18:52 AndrewR: Selected GPU 0: NVIDIA GeForce GT 710, type: 2
18:52 AndrewR: peoprietary of course
18:52 karolherbst: AndrewR: the question was about vulkan video
18:52 karolherbst: like playing videos through vulkan
18:53 AndrewR: ah, sorry. vulkainfo will tell?
18:53 karolherbst: dunno :) ask airlied
18:55 AndrewR: karolherbst, UVM_API_LATEST_REVISION 7 in my uvm.h header at /usr/src/nvidia-470.199.02/nvidia-uvm/uvm.h
18:57 airlied: yeah vulkaninfo see if you have VK_KHR_video*
19:01 AndrewR: airlied, nope ...
19:03 airlied: okay then that won't be a good way forward
19:33 karolherbst: AndrewR: I assume they don't bump that on each rename though :'(
19:34 karolherbst: anyway... that video reverse engineering is a big task, definetly something you want to do a GSoC/EVoC for and even that wouldn't be enough
19:37 AndrewR: karolherbst, yeah, just hoped to collect some info while it works
19:37 AndrewR: karolherbst, https://docs.nvidia.com/drive/drive_os_5.1.6.1L/nvvib_docs/index.html#page/DRIVE_OS_Linux_SDK_Development_Guide/NvMedia/nvmedia_nvmvid_enc.html
19:37 karolherbst: yeah...
19:38 karolherbst: soo.. what would help is to write very simple and targeted application and trace what nvidia is doing
19:38 karolherbst: but we need a better mmiotracer, because it's all cursed
19:38 karolherbst: I wouldn't trust valgrind-mmt to even catch most of the relevant things compute related
19:39 karolherbst: I've written those UVM patches for a reason, because that tool just became quite useless
19:39 airlied: where did ilia ever get with video?
19:39 karolherbst: it works on some GPUs
19:39 karolherbst: kinda
19:39 karolherbst: it's broken
19:39 karolherbst: but also kinda works
19:39 airlied: is it just gpus where we can extract the fw?
19:40 karolherbst: I think so
19:40 karolherbst: maybe less even
19:40 karolherbst: but I'm also hessistant to write new code not using nvidia headers
19:42 airlied: I'd be writing code not using them until we get them :-)
19:42 karolherbst: :D
19:43 karolherbst: fair enough
19:44 airlied: I think for gsp there are still some kernel bits to hook up to expose the video dec
19:45 karolherbst: probably yeas
19:45 karolherbst: *yes
19:45 karolherbst: all that video stuff is completely cursed
19:45 karolherbst: I hope it's better with GSP
19:46 karolherbst: we even have specialized instructions for video stuff in the shader ISA
19:47 airlied: I wonder what for
19:47 airlied: in modern ISAs?
19:47 karolherbst: let me check..
19:48 karolherbst: mhh I actually think PTX has those as well
19:48 karolherbst: airlied: https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#video-instructions
19:48 karolherbst: maxwell has some of them I think
19:49 karolherbst: but the nvdisasm docs are not mentioning them
19:49 karolherbst: but they do exist
19:49 karolherbst: envydis lists them e.g.: https://github.com/envytools/envytools/blob/master/envydis/gm107.c
19:50 karolherbst: but I can't find any of those in the ISA docs I have.. sooo dunno
19:50 karolherbst: however I think they exists...
19:50 airlied: I doubt we care about any of those for basic decode though
19:51 karolherbst: yeah.. we don't
19:51 karolherbst: but
19:51 karolherbst: some of the encoding/decoding is shader assisted
19:51 airlied: okay the thinkpad p1gen4 is probably the lightest, might be managebale
19:51 airlied: karolherbst: I'd be interested if we know how to quantify "some" there
19:51 karolherbst: yeah.. good question :)
19:52 karolherbst: check what nvidia is doing
19:52 karolherbst: but what I remember it kinda depends on the codec and profile and/or settings
19:52 airlied: my guess is for most things using shaders is undesirable due to power consumption
19:52 karolherbst: yeah
19:52 airlied: but I know for instance AV1 filmgrain is done in shaders on intel
19:53 karolherbst: it also depends on the generation
19:53 karolherbst: I think the VP docs _might_ give some details
19:53 karolherbst: or was it PV?
19:53 karolherbst: yeah.. PV
19:54 karolherbst: wikipedia says this for Feature Set E: "Cards with this feature set use a combination of the PureVideo hardware and software running on the shader array to decode HEVC (H.265) as partial/hybrid hardware video decoding."
19:56 airlied: ah so maxwell and below for h265
19:57 karolherbst: yeah.. but I think there are more instances of that
20:36 AndrewR: karolherbst, https://forum.doom9.org/showthread.php?t=164495
20:37 AndrewR: karolherbst, https://forum.cyberlink.com/forum/posts/list/42357.page
20:37 AndrewR: apperently on pre-cepler there was some encoding feature on cuda cores on fermi ...
20:46 AndrewR: karolherbst, https://cseweb.ucsd.edu/classes/wi15/cse262-a/static/cuda-5.5-doc/html/video-encoder/index.html
21:30 AndrewR: it seems this library (nvcuenc.dll) was only in specific windows drivers, but then 181 series was xp compatible, so may be it will work in Reactos ... :)
21:32 AndrewR: karolherbst, https://on-demand.gputechconf.com/gtc/2010/presentations/S12075-GPU-Accelerated-Video-Encoding.pdf - but link at the end does not work and not archived ..
21:33 karolherbst: :'(
21:43 RSpliet: you may be able to ask the author? Guessing it's this chap: https://github.com/toshas?tab=repositories