negativo17 / nvidia-driver

NVIDIA's proprietary display driver for NVIDIA graphic cards
81 stars 25 forks source link

Nvidia audio device not loading with 435.21 #84

Closed Atticfire closed 5 years ago

Atticfire commented 5 years ago

Using Fedora 5.2.11-200.fc30.x86_64 nvidia-driver.x86_64 3:430.40-1.fc30 @fedora-nvidia

If I update to nvidia-driver - 3:435.21-1.fc30 I no longer have an Nvidia audio device and pulseaudio no longer starts.

If I downgrade back to 3:430 then audio device returns 01:00.0 VGA compatible controller: NVIDIA Corporation GP107 [GeForce GTX 1050 Ti] (rev a1) 01:00.1 Audio device: NVIDIA Corporation GP107GL High Definition Audio Controller (rev a1)

No errors in dmesg or journalctl only lspci showing no Audio device Video is still working fine.

I haven't found anyone else with this problem, any ideas where to start?

leigh123linux commented 5 years ago

Works fine here

$ inxi -SGA
System:
  Host: leigh.computer-desktop Kernel: 5.2.11-200.fc30.x86_64 x86_64 
  bits: 64 Desktop: Cinnamon 4.2.3 Distro: Fedora release 30 (Thirty) 
Graphics:
  Device-1: NVIDIA GP107 [GeForce GTX 1050 Ti] driver: nvidia v: 435.21 
  Display: x11 server: Fedora Project X.org 1.20.5 driver: nvidia 
  unloaded: fbdev,modesetting,nouveau,vesa resolution: 3840x2160~60Hz 
  OpenGL: renderer: GeForce GTX 1050 Ti/PCIe/SSE2 v: 4.6.0 NVIDIA 435.21 
Audio:
  Device-1: AMD SBx00 Azalia driver: snd_hda_intel 
  Device-2: NVIDIA GP107GL High Definition Audio driver: snd_hda_intel 
  Sound Server: ALSA v: k5.2.11-200.fc30.x86_64 
$ lspci |grep NVIDIA
01:00.0 VGA compatible controller: NVIDIA Corporation GP107 [GeForce GTX 1050 Ti] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GP107GL High Definition Audio Controller (rev a1)

What type of connection is used for the monitor? (DP or HDMI) and are any cable converters used?

Atticfire commented 5 years ago

Working Nvidia version 430.20 :-

$ dmesg | grep 0000:01 [ 0.359235] pci 0000:01:00.0: [10de:1c82] type 00 class 0x030000 [ 0.359346] pci 0000:01:00.0: reg 0x10: [mem 0xf9000000-0xf9ffffff] [ 0.359448] pci 0000:01:00.0: reg 0x14: [mem 0xd0000000-0xdfffffff 64bit pref] [ 0.359586] pci 0000:01:00.0: reg 0x1c: [mem 0xee000000-0xefffffff 64bit pref] [ 0.359722] pci 0000:01:00.0: reg 0x24: [io 0xef00-0xef7f] [ 0.359822] pci 0000:01:00.0: reg 0x30: [mem 0x00000000-0x0007ffff pref] [ 0.359979] pci 0000:01:00.0: 32.000 Gb/s available PCIe bandwidth, limited by 2.5 GT/s x16 link at 0000:00:01.0 (capable of 126.016 Gb/s with 8 GT/s x16 link) [ 0.360174] pci 0000:01:00.1: [10de:0fb9] type 00 class 0x040300 [ 0.360280] pci 0000:01:00.1: reg 0x10: [mem 0xfaffc000-0xfaffffff] [ 0.369952] pci 0000:01:00.0: vgaarb: setting as boot VGA device [ 0.370044] pci 0000:01:00.0: vgaarb: VGA device added: decodes=io+mem,owns=io+mem,locks=none [ 0.370176] pci 0000:01:00.0: vgaarb: bridge control possible [ 0.394643] pci 0000:01:00.0: BAR 6: assigned [mem 0xfa000000-0xfa07ffff pref] [ 0.396936] pci_bus 0000:01: resource 0 [io 0xe000-0xefff] [ 0.397032] pci_bus 0000:01: resource 1 [mem 0xf9000000-0xfaffffff] [ 0.397126] pci_bus 0000:01: resource 2 [mem 0xd0000000-0xefffffff 64bit pref] [ 0.426128] pci 0000:01:00.0: Video device with shadowed ROM at [mem 0x000c0000-0x000dffff] [ 28.605039] nvidia 0000:01:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=io+mem [ 28.745401] snd_hda_intel 0000:01:00.1: Disabling MSI [ 28.745506] snd_hda_intel 0000:01:00.1: Handle vga_switcheroo audio client [ 29.155871] input: HDA NVidia HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input23 [ 29.156228] input: HDA NVidia HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input24 [ 29.156468] input: HDA NVidia HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input25 [ 29.334452] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 0 [ 128.801622] snd_hda_intel 0000:01:00.1: IRQ timing workaround is activated for card #1. Suggest a bigger bdl_pos_adj.

Non-working Nvidia version 435.21 No Nvidia audio device :-

$ dmesg | grep 0000:01 [ 0.359439] pci 0000:01:00.0: [10de:1c82] type 00 class 0x030000 [ 0.359550] pci 0000:01:00.0: reg 0x10: [mem 0xf9000000-0xf9ffffff] [ 0.359652] pci 0000:01:00.0: reg 0x14: [mem 0xd0000000-0xdfffffff 64bit pref] [ 0.359790] pci 0000:01:00.0: reg 0x1c: [mem 0xee000000-0xefffffff 64bit pref] [ 0.359926] pci 0000:01:00.0: reg 0x24: [io 0xef00-0xef7f] [ 0.360026] pci 0000:01:00.0: reg 0x30: [mem 0x00000000-0x0007ffff pref] [ 0.360102] pci 0000:01:00.0: 32.000 Gb/s available PCIe bandwidth, limited by 2.5 GT/s x16 link at 0000:00:01.0 (capable of 126.016 Gb/s with 8 GT/s x16 link) [ 0.360297] pci 0000:01:00.1: [10de:0fb9] type 00 class 0x040300 [ 0.360403] pci 0000:01:00.1: reg 0x10: [mem 0xfaffc000-0xfaffffff] [ 0.370049] pci 0000:01:00.0: vgaarb: setting as boot VGA device [ 0.370140] pci 0000:01:00.0: vgaarb: VGA device added: decodes=io+mem,owns=io+mem,locks=none [ 0.370271] pci 0000:01:00.0: vgaarb: bridge control possible [ 0.394786] pci 0000:01:00.0: BAR 6: assigned [mem 0xfa000000-0xfa07ffff pref] [ 0.397084] pci_bus 0000:01: resource 0 [io 0xe000-0xefff] [ 0.397179] pci_bus 0000:01: resource 1 [mem 0xf9000000-0xfaffffff] [ 0.397274] pci_bus 0000:01: resource 2 [mem 0xd0000000-0xefffffff 64bit pref] [ 0.426227] pci 0000:01:00.0: Video device with shadowed ROM at [mem 0x000c0000-0x000dffff] [ 29.828965] nvidia 0000:01:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=io+mem [ 30.412884] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 0

Atticfire commented 5 years ago

Using nvidia-driver.x86_64 - 3:430.40-1.fc30 $ inxi -SGA System: Host: computer Kernel: 5.2.11-200.fc30.x86_64 x86_64 bits: 64 Desktop: Gnome 3.32.2 Distro: Fedora release 30 (Thirty) Graphics: Device-1: NVIDIA GP107 [GeForce GTX 1050 Ti] driver: nvidia v: 430.40 Display: server: Fedora Project X.org 1.20.5 driver: nvidia resolution: 1920x1080~60Hz, 1920x1080~60Hz, 1920x1080~60Hz OpenGL: renderer: GeForce GTX 1050 Ti/PCIe/SSE2 v: 4.6.0 NVIDIA 430.40 Audio: Device-1: Intel 6 Series/C200 Series Family High Definition Audio driver: snd_hda_intel Device-2: NVIDIA GP107GL High Definition Audio driver: snd_hda_intel Sound Server: ALSA v: k5.2.11-200.fc30.x86_64 $ lspci |grep NVIDIA 01:00.0 VGA compatible controller: NVIDIA Corporation GP107 [GeForce GTX 1050 Ti] (rev a1) 01:00.1 Audio device: NVIDIA Corporation GP107GL High Definition Audio Controller (rev a1) $ lshw -c multimedia | grep 'vendor|bus info' vendor: NVIDIA Corporation bus info: pci@0000:01:00.1 vendor: Intel Corporation bus info: pci@0000:00:1b.0 Audio is fine

Update to nvidia-driver.x86_64 - 3:435.21-1.fc30 Manual remove dkms nvidia/435.21 Manual dkms install nvidia/435.21 (To check output for errors - none found) Compiled all four files correctly -rw-r--r--. 1 root root 19K Sep 12 10:03 nvidia-drm.ko.xz -rw-r--r--. 1 root root 11M Sep 12 10:03 nvidia.ko.xz -rw-r--r--. 1 root root 440K Sep 12 10:03 nvidia-modeset.ko.xz -rw-r--r--. 1 root root 304K Sep 12 10:03 nvidia-uvm.ko.xz reboot

$ inxi -SGA System: Host: computer Kernel: 5.2.11-200.fc30.x86_64 x86_64 bits: 64 Desktop: Gnome 3.32.2 Distro: Fedora release 30 (Thirty) Graphics: Device-1: NVIDIA GP107 [GeForce GTX 1050 Ti] driver: nvidia v: 435.21 Display: server: Fedora Project X.org 1.20.5 driver: nvidia resolution: 1920x1080~60Hz, 1920x1080~60Hz, 1920x1080~60Hz OpenGL: renderer: GeForce GTX 1050 Ti/PCIe/SSE2 v: 4.6.0 NVIDIA 435.21 Audio: Device-1: Intel 6 Series/C200 Series Family High Definition Audio driver: snd_hda_intel Sound Server: ALSA v: k5.2.11-200.fc30.x86_64 $ lspci |grep NVIDIA 01:00.0 VGA compatible controller: NVIDIA Corporation GP107 [GeForce GTX 1050 Ti] (rev a1) $ lshw -c video | grep 'configuration' configuration: driver=nvidia latency=0 $ lshw -c multimedia | grep 'vendor|bus info' vendor: Intel Corporation bus info: pci@0000:00:1b.0

No nvidia audio working

DKMS is working correctly $ journalctl -xb | grep DKMS Starting Builds and install new kernel modules through DKMS... Started Builds and install new kernel modules through DKMS. Xorg config does not deal with audio grub kernel opts - rd.driver.blacklist=nouveau nvidia-drm.modeset=0 (Working for a long time) nouveau is blacklisted

Then I dnf downgrade nvidia-driver to old 430 and audio device returns

jp7677 commented 5 years ago

I have the same issue here. Since the update to 435.21 the Nvidia audio device is no longer detected.

lspci | grep Audio shows

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 lspci -H1 | grep Audio (as root) shows the Nvidia audio device

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 not for the better in my case. https://devtalk.nvidia.com/default/topic/1024022/linux/gtx-1060-no-audio-over-hdmi-only-hda-intel-detected-azalia/5

I don't think this is related to packaging.

Atticfire commented 5 years ago

Thank you jp7677,

I tried the following fix

!/bin/sh

setpci -s 01:00.0 0x488.l=0x2000000:0x2000000 rmmod nvidia-drm nvidia-modeset nvidia sh -c 'echo 1 > /sys/bus/pci/devices/0000:01:00.0/remove' sh -c 'echo 1 > /sys/bus/pci/devices/0000:00:01.0/rescan' modprobe nvidia nvidia-modeset nvidia-drm

It does remove and rescan the pci bus

GPU /sys/bus/pci/devices/0000:00:01.0/ Audio /sys/bus/pci/devices/0000:00:01:0/0000:01:00.1

It will remove then add back the pci device on both 430.40 and 435.21 435.21 does see some of the audio subsystem sh -c 'echo 1 > /sys/bus/pci/devices/0000:01:00.0/subsystem/rescan' It does show some information for the audio /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input23 /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input24 /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input25

But 435.21 still won't load driver or enable audio

I agree it's not packaging it's Nvidia, but I'm surprised there aren't more messages about it

jp7677 commented 5 years ago

@Atticfire yes, same results here. I've modified that script for my needs due to different pci layout:

#!/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

Running that script seems to have the desired effect:

[   19.056096] nvidia-uvm: Unloaded the UVM driver.
[   19.065350] [drm] [nvidia-drm] [GPU ID 0x00000200] Unloading driver
[   19.351100] nvidia-modeset: Unloading
[   19.361949] nvidia-nvlink: Unregistered the Nvlink Core, major device number 236
[   19.448025] pci 0000:02:00.0: [10de:1b80] type 00 class 0x030000
[   19.448044] pci 0000:02:00.0: reg 0x10: [mem 0xde000000-0xdeffffff]
[   19.448053] pci 0000:02:00.0: reg 0x14: [mem 0xc0000000-0xcfffffff 64bit pref]
[   19.448062] pci 0000:02:00.0: reg 0x1c: [mem 0xd0000000-0xd1ffffff 64bit pref]
[   19.448068] pci 0000:02:00.0: reg 0x24: [io  0xe000-0xe07f]
[   19.448074] pci 0000:02:00.0: reg 0x30: [mem 0x00000000-0x0007ffff pref]
[   19.448158] pci 0000:02:00.0: 32.000 Gb/s available PCIe bandwidth, limited by 2.5 GT/s x16 link at 0000:00:03.0 (capable of 126.016 Gb/s with 8 GT/s x16 link)
[   19.448214] pci 0000:02:00.0: vgaarb: setting as boot VGA device
[   19.448215] pci 0000:02:00.0: vgaarb: VGA device added: decodes=io+mem,owns=io+mem,locks=none
[   19.448250] pci 0000:02:00.1: [10de:10f0] type 00 class 0x040300
[   19.448263] pci 0000:02:00.1: reg 0x10: [mem 0xdf080000-0xdf083fff]
[   19.461061] pci 0000:02:00.0: BAR 1: assigned [mem 0xc0000000-0xcfffffff 64bit pref]
[   19.461068] pci 0000:02:00.0: BAR 3: assigned [mem 0xd0000000-0xd1ffffff 64bit pref]
[   19.461074] pci 0000:02:00.0: BAR 0: assigned [mem 0xde000000-0xdeffffff]
[   19.461077] pci 0000:02:00.0: BAR 6: assigned [mem 0xdf000000-0xdf07ffff pref]
[   19.461078] pci 0000:02:00.1: BAR 0: assigned [mem 0xdf080000-0xdf083fff]
[   19.461081] pci 0000:02:00.0: BAR 5: assigned [io  0xe000-0xe07f]
[   19.461094] pci 0000:02:00.0: Video device with shadowed ROM at [mem 0x000c0000-0x000dffff]
[   19.461261] snd_hda_intel 0000:02:00.1: Disabling MSI
[   19.461274] snd_hda_intel 0000:02:00.1: Handle vga_switcheroo audio client
[   19.791835] input: HDA NVidia HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:03.0/0000:02:00.1/sound/card1/input24
[   19.791910] input: HDA NVidia HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:03.0/0000:02:00.1/sound/card1/input25
[   19.791970] input: HDA NVidia HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:03.0/0000:02:00.1/sound/card1/input26
[   19.792023] input: HDA NVidia HDMI/DP,pcm=9 as /devices/pci0000:00/0000:00:03.0/0000:02:00.1/sound/card1/input27
[   20.192358] nvidia-nvlink: Nvlink Core is being initialized, major device number 236
[   20.193603] nvidia 0000:02:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=io+mem
[   20.415137] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  435.21  Sun Aug 25 08:17:57 CDT 2019

(Note that I stopped gdm before that with systemctl stop gdm)

But even when I'm running it with the systemd service on startup the audio devices are still not available.

jp7677 commented 5 years ago

I agree it's not packaging it's Nvidia, but I'm surprised there aren't more messages about it

Yes, that's what I'm wondering too.

jp7677 commented 5 years ago

Looking with journalctl instead of dmesg I'm actually seeing an error:

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

The detected HDA NVidia devices are indeed not there...

jp7677 commented 5 years ago

Cross-posted here: https://devtalk.nvidia.com/default/topic/1063181/linux/nvidia-audio-device-not-detected-with-435-21/

scaronni commented 5 years ago

Should be fixed in kernel 5.3, which has just been released. I guess that in 435 they just removed the workaround that was available in 430 due to the imminente release:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b516ea586d717472178e6ef1c152e85608b0ce32

Atticfire commented 5 years ago

@scaronni interesting after reading that kernel update I tried setting the BIOS to enable onboard VGA With either enabled or AUTO the machine would not start the Nvidia card at all.

Returning BIOS to only enable onboard VGA if the is no PEG just goes back to Video no Audio enabled Just have to wait till kernel 5.3 is out then

jp7677 commented 5 years ago

The solutions turns out much easier in my case, thanks to a tip from the nvidia devtalk forum. The issue is here: https://github.com/negativo17/nvidia-kmod-common/blob/master/60-nvidia.rules#L15

Setting this rule in comments (which explicitly states that it will remove the HDA devices ;)) let the audio devices appear again, even with the current 5.2 kernel.

See also https://devtalk.nvidia.com/default/topic/1063181/linux/nvidia-audio-device-not-detected-with-435-21/post/5387939/#5387939 and http://download.nvidia.com/XFree86/Linux-x86_64/435.17/README/dynamicpowermanagement.html

I don't know what a good solution here would since having these dynamic power management features might be useful for laptop users with a turing GPU (these are the pre-conditions if I read it correctly). May be putting these rules into a separate package would makes sense?

Edit: Mixed up the second link.

scaronni commented 5 years ago

I don't know what a good solution here would since having these dynamic power management features might be useful for laptop users with a turing GPU (these are the pre-conditions if I read it correctly). May be putting these rules into a separate package would makes sense?

Ah, that's interesting, thanks for the feedback. Basically the point is that before the GPU can go to "deep sleep" it needs to unbind all onboard devices. If that can't happen, the GPU can't reach the deep state.

I guess the best option is not enable the deep sleep (so it does not need to power off) with the registry key and keep the devices on it alive.

jp7677 commented 5 years ago

I guess the best option is not enable the deep sleep (so it does not need to power off) with the registry key and keep the devices on it alive.

What do you mean with "keep the devices on it alive"? Removing the udev rules as stated here http://download.nvidia.com/XFree86/Linux-x86_64/435.17/README/dynamicpowermanagement.html (chapter "Automated Setup")? That would certainly work for me.

scaronni commented 5 years ago

Yes, but in that case, to have the poweroff happen with "NVreg_DynamicPowerManagement=0x02", the devices onboard of the GPU board needs to be removed first. Ergo, 0x02 (whatever that is called) can not be reached while the HDA controller is alive.

Considering that the additional 0x02 power state is a complete poweroff compared to 0x01, there is no way to achieve it with the drivers active on the additional onboard devices. I guess this is why it is not enabled by default. I will revert the registry setting + the UDEV rules, or at least leave it commented.

scaronni commented 5 years ago

New build coming. I've left the 0x02 state enabled and just disabled the workaround. At that point, once the various fixes reach the kernel, the suspension of the onboard GPU devices should just work and power off as well.

jp7677 commented 5 years ago

Thanks a lot!

Edit: Packages have landed here and all is good again.

Atticfire commented 5 years ago

@jp7677 @scaronni Thank you, resolved problem for me. Just like to add, help like this is why I love Linux and the Linux community. :)