nvidia-exec icon indicating copy to clipboard operation
nvidia-exec copied to clipboard

Remove all subdevices

Open moll-re opened this issue 1 year ago • 1 comments

Hi there. Apologies for not adhering to any naming guidelines. My gpu is a 1050-ti (max-q) integrated by HP. It also handles sound over HDMI, using the kernel module snd_hda_intel. Relevant ouput of lspci -nnk:

...
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP107M [GeForce GTX 1050 Ti Mobile] [10de:1c8c] (rev a1)
	DeviceName: NVIDIA GeForce GTX 1050 Ti
	Subsystem: Hewlett-Packard Company GP107M [GeForce GTX 1050 Ti Mobile] [103c:8519]
	Kernel driver in use: nvidia
	Kernel modules: nouveau, nvidia_drm, nvidia
01:00.1 Audio device [0403]: NVIDIA Corporation GP107GL High Definition Audio Controller [10de:0fb9] (rev a1)
	Kernel driver in use: snd_hda_intel
	Kernel modules: snd_hda_intel
...

When running nvx off the Audio device remains dangling, causing many freezes - the snd_hda_intel waits for the device to exit D3_cold and times out after 60000 (!!) ms. Very annoying

Jan 05 23:36:33 -- kernel: snd_hda_intel 0000:01:00.1: not ready 1023ms after resume; waiting
Jan 05 23:36:33 -- kernel: snd_hda_intel 0000:01:00.1: not ready 2047ms after resume; waiting
Jan 05 23:36:33 -- kernel: snd_hda_intel 0000:01:00.1: not ready 4095ms after resume; waiting
Jan 05 23:36:33 -- kernel: snd_hda_intel 0000:01:00.1: not ready 8191ms after resume; waiting
Jan 05 23:36:33 -- kernel: snd_hda_intel 0000:01:00.1: not ready 16383ms after resume; waiting
Jan 05 23:36:33 -- kernel: snd_hda_intel 0000:01:00.1: not ready 32767ms after resume; waiting
Jan 05 23:36:33 -- kernel: snd_hda_intel 0000:01:00.1: not ready 65535ms after resume; giving up
Jan 05 23:36:33 -- kernel: snd_hda_intel 0000:01:00.1: Unable to change power state from D3cold to D0, device inaccessible

The above patch also removes the sound device and fixes these issue. I was only able to test this for my specific device though.

moll-re avatar Jan 05 '24 23:01 moll-re

@moll-re thanks so much! This has been a life saver....

ni-ka avatar Apr 06 '24 13:04 ni-ka

Closing this, I rewrote the project in python. Please check the new project, there is a simple config where you can add extra device filters, not well tested though.

pedro00dk avatar May 23 '24 02:05 pedro00dk

@moll-re did you have any luck setting the device filter to include the audio device?

ni-ka avatar Jun 24 '24 08:06 ni-ka

Here's my /etc/nvx.conf

# kernel modules to load and unload
# extra options can be passed to modprobe
kernel_modules=nouveau, nvidia, nvidia_drm modeset=1 fbdev=1, nvidia_uvm, nvidia_modeset

# device classes filter, perfect match
device_classes=display,multimedia

# device vendors filter, partial match
device_vendors=nvidia

# nvidia's egl vendor path, if provided, the file will be edited to disable the vendor on boot
# this prevents some applications e.g. gnome-shell from grabbing the gpu and preventing turning it off
egl_vendor_path=/usr/share/glvnd/egl_vendor.d/10_nvidia.json
egl_vendor_apply=true

# attempt to kill running processes using the gpu before unloading the driver
kill_on_off=false

I think it's nearly unchanged, I just added the multimedia line so the sound device is shut down as well.

moll-re avatar Jun 24 '24 11:06 moll-re

Thanks @moll-re it turned out to be easy and came up with the same which gets rid of the timeout. However seems I have other issues with the new version (system hangs when enabling nvx) but currently no time to look into it.

ni-ka avatar Jun 26 '24 11:06 ni-ka