Nvidia audio device not detected with 435.21

Cross-posting from here: https://github.com/negativo17/nvidia-driver/issues/84

Since the update to 435.21 the Nvidia audio device gets no longer detected on my machine (GTX 1080 on a Gigabyte GA-X99-UD4P with Fedora 30, Kernel 5.2.13).

lspci | grep Audio

00:1b.0 Audio device: Intel Corporation C610/X99 series chipset HD Audio Controller (rev 05)
04:00.0 Multimedia video controller: Conexant Systems, Inc. CX23885 PCI Video and Audio Decoder (rev 04)

Though strangely (as root)
lspci -H1 | grep Audio

00:1b.0 Audio device: Intel Corporation C610/X99 series chipset HD Audio Controller (rev 05)
02:00.1 Audio device: NVIDIA Corporation GP104 High Definition Audio Controller (rev a1)
04:00.0 Multimedia video controller: Conexant Systems, Inc. CX23885 PCI Video and Audio Decoder (rev 04)

I came across this topic, which confirms that something changed with the latest driver version, though in my case it made the HDA devices disappear. https://devtalk.nvidia.com/default/topic/1024022/linux/gtx-1060-no-audio-over-hdmi-only-hda-intel-detected-azalia/5

When trying the suggestion in that topic:

#!/bin/sh
set -e
setpci -s 02:00.0 0x488.l=0x2000000:0x2000000
rmmod nvidia-uvm nvidia-drm nvidia-modeset nvidia
sh -c 'echo 1 > /sys/bus/pci/devices/0000:02:00.0/remove'
sh -c 'echo 1 > /sys/bus/pci/devices/0000:00:03.0/rescan'
modprobe nvidia

I can see the audio devices but somehow something is still wrong:

kernel: input: HDA NVidia HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:03.0/0000:02:00.1/sound/card1/input24
kernel: input: HDA NVidia HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:03.0/0000:02:00.1/sound/card1/input25
kernel: input: HDA NVidia HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:03.0/0000:02:00.1/sound/card1/input26
kernel: input: HDA NVidia HDMI/DP,pcm=9 as /devices/pci0000:00/0000:00:03.0/0000:02:00.1/sound/card1/input27
systemd-udevd[734]: controlC1: Failed to open ATTR{/sys/devices/pci0000:00/0000:00:03.0/0000:02:00.1/sound/card1/controlC1/../uevent} for writing: No such file or directory

Any idea what could be wrong? Thanks!

I have very similar problem, no Nvidia HDMI/DP sound due to all devices missing as seen in messages. In my case no sound started on Sept 08, 2019 (Seems 435.21 was installed on Sept 07 as shown by “dnf history nvidia-driver”). I am using DisplayPort Monitor with sound and Fedora 30 always fully updated. I have never had problem with sound in years until now. I run latest kernels including "-rc"s.

dnf list *nvidia*
Last metadata expiration check: 2:04:41 ago on Fri 27 Sep 2019 05:16:56 PM EDT.
Installed Packages
akmod-nvidia.x86_64                                     3:435.21-1.fc30                @fedora-nvidia           
kmod-nvidia-5.2.11-200.fc30.x86_64.x86_64               3:435.21-1.fc30                @@commandline            
kmod-nvidia-5.2.16-200.fc30.x86_64.x86_64               3:435.21-1.fc30                @@commandline            
kmod-nvidia-5.2.17-200.fc30.x86_64.x86_64               3:435.21-1.fc30                @@commandline            
kmod-nvidia-5.2.5.x86_64                                3:430.40-1.fc30                @@commandline            
kmod-nvidia-5.2.6.x86_64                                3:430.40-1.fc30                @@commandline            
kmod-nvidia-5.2.7.x86_64                                3:430.40-1.fc30                @@commandline            
kmod-nvidia-5.3.0-rc2.x86_64                            3:435.21-1.fc30                @@commandline            
kmod-nvidia-5.3.0-rc3.x86_64                            3:430.40-1.fc30                @@commandline            
kmod-nvidia-5.3.0-rc4.x86_64                            3:430.40-1.fc30                @@commandline            
kmod-nvidia-5.3.0-rc5.x86_64                            3:430.40-1.fc30                @@commandline            
kmod-nvidia-5.3.0-rc6.x86_64                            3:430.40-1.fc30                @@commandline            
kmod-nvidia-5.3.0-rc7.x86_64                            3:430.40-1.fc30                @@commandline            
kmod-nvidia-5.3.0-rc8.x86_64                            3:435.21-1.fc30                @@commandline            
kmod-nvidia-5.3.0-rc8ii.x86_64                          3:435.21-1.fc30                @@commandline            
kmod-nvidia-5.3.1.x86_64                                3:435.21-1.fc30                @@commandline            
nvidia-driver.x86_64                                    3:435.21-1.fc30                @fedora-nvidia           
nvidia-driver-libs.i686                                 3:435.21-1.fc30                @fedora-nvidia           
nvidia-driver-libs.x86_64                               3:435.21-1.fc30                @fedora-nvidia           
nvidia-kmod-common.noarch                               3:435.21-1.fc30                @fedora-nvidia

Please fix driver. I can test ideas and patches.
Thanks

This rather sounds like the packages you’re using installing udev rules to remove all nvidia subdevices which are meant for render offload power management on Turing Optimus notebooks
http://download.nvidia.com/XFree86/Linux-x86_64/435.17/README/dynamicpowermanagement.html
See the “Known Issues And Workarounds” “Automated Setup” part. If those udev rules exist, complain to the maintainer of the repo.

Thanks a lot @generix, I had indeed the udev rule for power management on my system and removing them resolves this issue for me.

Thanks for the tip! I commented out the “remove” audio line that said:

ACTION==“add”, SUBSYSTEM==“pci”, ATTR{vendor}==“0x10de”, ATTR{class}==“0x040300”, ATTR{remove}=“1”

in file /lib/udev/rules.d/60-nvidia.rules and now sound is working again!

First I had tried the above “dynamicpowermanagement.html” suggestion and made a file “80-nvidia-pm.rules” as given in the “Automatic” section plus the other tiny file. This did not work.