02:13ity: Just wondering, is the idea of using the proprietary drivers to load firmware & configure power management on pre-turing, then unloading the kmod and loading nouveau (with support from the latter) utter nonsense or something technically possible as a workaround for getting perf working on pre-turing ?
12:46karolherbst: ity: that _might_ work
13:26notthatclippy[d]: At the very least you'd need to binary hack nvidia.ko and NOP out the whole GPU teardown sequence on module unload.
13:26notthatclippy[d]: That is assuming you also make sure that the kernel doesn't power off the PCI device entirely when the owning module gets removed.
14:16karolherbst: I _think_ nvidia keeps the clocks
14:17karolherbst: and the kernel doesn't power off the device, unless it's runtime suspending it
14:17karolherbst: I think there have been users doing that to get higher clocks pre GSP
14:51notthatclippy[d]: module unload won't complete unless all devices are powered off (or lost). I can't imagine anyone successfully doing the above already. It _is_ possible, given some binary (or bpf) hacks, but that'd be such an awesome hack of a project we'd definitely hear about it.
14:51notthatclippy[d]: What some folks might have done is extracted the signed PMU firmware from nvidia.ko and loaded that through nouveau.
14:53notthatclippy[d]: Which is arguably the better approach in every way since you don't ever run closed source kernel code on your machine, let alone hacked up one. And it breaks the license/eula/whatever just the same.
15:11Izty: Hello, my GPU is an NVIDIA Corporation GK107M [GeForce GT 640M LE] (rev a1). GK107 belongs to NVE0 but 640M LE belongs to NVC0 according to https://nouveau.freedesktop.org/CodeNames.html
15:11Izty: So, which one do I have?
15:12Izty: sudo dmesg | grep -i chipset doesn't output anything. I am on Ubuntu 24.10.
15:12karolherbst[d]: notthatclippy[d]: module unloading doesn't power off devices
15:13karolherbst[d]: notthatclippy[d]: no, they unloaded nvidia after it clocked to max and got max clocks on nouveau
15:14karolherbst: Izty: you have a nve7, but model names are "weird" and they aren't necessarily consistent
15:16Izty: karolherbst: Ok thanks a lot. So I would have VP5 according to https://nouveau.freedesktop.org/VideoAcceleration.html right?
15:17notthatclippy[d]: karolherbst[d]: I'm very confused how this works. How do I unload a module without invoking the close() on the FDs it exposes?
15:17karolherbst[d]: notthatclippy[d]: how is that related to the clocks?
15:18notthatclippy[d]: `/dev/nvidia0` is refcounted and when the last close() on it happens, nvidia.ko will shut down the GPU.
15:18karolherbst[d]: that doesn't have to mean that clocks are set to something low
15:19karolherbst[d]: maybe with GSP it's different now
15:19karolherbst[d]: but pre GSP nvidia just left the clocks alone
15:19notthatclippy[d]: That is totally news to me and I can't even imagine how you'd get to that point.
15:19karolherbst[d]: why?
15:19karolherbst[d]: you set the GPU to perf mode
15:20karolherbst[d]: you unload nvidia
15:20karolherbst[d]: you have a GPU with high clocks
15:20karolherbst[d]: then you load nouveau which won't run devinit, because the GPU is already initialized
15:21karolherbst[d]: I think it was even something terrible, like as long as xorg wasn't running, the GPU clocks never changed 🙃
15:21karolherbst[d]: in the past at least
15:22notthatclippy[d]: I imagine if you use the GPU management API to set the clocks explicitly, it will obey what you said, so that's expected. What I don't get is how unloading nvidia.ko (really, just running last `close("/dev/nvidia0")`) doesn't shut down all power to the GPU and clear out the PMU firmware.
15:23karolherbst[d]: how could it shut down all power?
15:23karolherbst[d]: the PCI spec doesn't even allow you to do it
15:23karolherbst[d]: sure, there is the d3hot state you could set, but that doesn't cut power
15:24karolherbst[d]: and d3cold can only be achieved through platform specific methods you don't have on a desktop
15:24karolherbst[d]: d3hot doesn't do much to the GPU state, because it's not really removing any power
15:27karolherbst[d]: and anyway, can't power down the GPU on a desktop, because it's driving the system framebuffer still
15:30notthatclippy[d]: I had no idea this was a thing...
15:30notthatclippy[d]: // Detach the PMU. After this point, PMU is detached from RM, thus not able
15:30notthatclippy[d]: // to service any commands, and it may run in autonomous mode.
15:30notthatclippy[d]: ``` but looks like the behavior split isn't GSP/nonGSP, but rather FALCON/RISCV
15:30notthatclippy[d]: Still, very interesting that it works. Thanks!
15:31Izty: If I understand correctly, to use video acceleration, I just need the firmwares in /lib/firmwares/nouveau as explained in https://nouveau.freedesktop.org/VideoAcceleration.html right?
15:32Izty: Or do I need to apt install libvdpau as well?
15:36karolherbst[d]: you need some kind of API to target, be it vdpau or vaapi
15:41karolherbst[d]: notthatclippy[d]: I wonder if autonomous mode is similar to pre OS
15:41karolherbst[d]: just enough to do basic stuff like making sure the GPU doesn't overheat
15:46Izty: karolherbst[d]: Thanks for answering :) Sorry I'm not familiar with this. How do I chose between vdpau and vaapi?
15:47karolherbst[d]: you normally don't, application use them
15:47karolherbst[d]: they are both video acceleration APIs
15:48Izty: So if I watch a movie with vlc, it will use video acceleration?
15:49karolherbst[d]: probably
16:49Izty: So I only need to put the firmware files in /lib/firmwares/nouveau to have video acceleration available, that's it?
16:49Izty: How can I check it actually works?
19:49awilfox[d]: You said Ubuntu so: apt-get install vainfo, then from a running X or Wayland session, `vainfo`
19:49awilfox[d]: Should say something like "vainfo: Driver version: Nouveau ...."
19:50awilfox[d]: There is also apt-get install vdpauinfo then `vdpauinfo`, which has the benefit of also telling you which formats it supports
19:51awilfox[d]: `vainfo` only says decoders (i.e. "VC-1", "MPEG-4", etc) while `vdpauinfo` also tells you resolution and pixel formats etc, which is fun for nerds like me 🙂
21:59Ermine: vainfo should also state profiles, which may or may not be related to pixel formats/resolutions/etc