Multiple displays on Fedora 37 does nothing unless rebooted

I have installed Fedora 37 on my new laptop, which has an HDMI port.
I use it to deliver presentations by mirroring my screen.

When I plugin an external monitor/beamer (through the HDMI port), nothing happens. Pressing the keys Fn + F7 does nothing.

When I reboot the laptop, the external monitor works. Pressing the keys Fn + F7 behaves as expected (switch to mirror etc). When I then unplug the HDMI cable and replug, nothing shows up on the external monitor again. Pressing the keys Fn + F7 does nothing again.

It’s using an AMD Radeon™ Graphics / AMD Radeon™ Graphics. How do I fix this?

Can you give us the output of inxi -CSGxxM in preformatted or code block format?

1 Like

Of course, Scott. Here you go:

System:
  Host: fedora Kernel: 6.1.7-200.fc37.x86_64 arch: x86_64 bits: 64
    compiler: gcc v: 2.38-25.fc37 Desktop: GNOME v: 43.2 tk: GTK v: 3.24.36
    wm: gnome-shell dm: GDM Distro: Fedora release 37 (Thirty Seven)
Machine:
  Type: Laptop System: LENOVO product: 82JU v: Legion 5 15ACH6H
    serial: <superuser required> Chassis: type: 10 v: Legion 5 15ACH6H
    serial: <superuser required>
  Mobo: LENOVO model: LNVNB161216 v: SDK0T76461 WIN
    serial: <superuser required> UEFI: LENOVO v: GKCN50WW date: 11/24/2021
CPU:
  Info: 8-core model: AMD Ryzen 7 5800H with Radeon Graphics bits: 64
    type: MT MCP arch: Zen 3 rev: 0 cache: L1: 512 KiB L2: 4 MiB L3: 16 MiB
  Speed (MHz): avg: 1227 high: 1642 min/max: 1200/4462 boost: enabled cores:
    1: 1200 2: 1200 3: 1642 4: 1200 5: 1200 6: 1200 7: 1200 8: 1200 9: 1200
    10: 1200 11: 1198 12: 1200 13: 1200 14: 1200 15: 1200 16: 1200
    bogomips: 102200
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
  Device-1: NVIDIA GA106M [GeForce RTX 3060 Mobile / Max-Q] vendor: Lenovo
    driver: nouveau v: kernel arch: Ampere pcie: speed: Unknown lanes: 63 ports:
    active: none empty: DP-1, DP-2, HDMI-A-1, eDP-1 bus-ID: 01:00.0
    chip-ID: 10de:2560
  Device-2: AMD Cezanne [Radeon Vega Series / Radeon Mobile Series]
    vendor: Lenovo driver: amdgpu v: kernel arch: GCN-5.1 pcie: speed: 8 GT/s
    lanes: 16 ports: active: eDP-2 empty: none bus-ID: 05:00.0
    chip-ID: 1002:1638 temp: 24.0 C
  Device-3: Acer Integrated Camera type: USB driver: uvcvideo bus-ID: 1-3:3
    chip-ID: 5986:2137
  Display: wayland server: X.org v: 1.20.14 with: Xwayland v: 22.1.7
    compositor: gnome-shell driver: X: loaded: amdgpu
    unloaded: fbdev,modesetting,vesa dri: radeonsi gpu: amdgpu display-ID: 0
  Monitor-1: eDP-2 model: BOE Display 0x0a2d res: 2560x1440 dpi: 189
    diag: 395mm (15.5")
  API: OpenGL v: 4.6 Mesa 22.3.3 renderer: AMD Radeon Graphics (renoir LLVM
    15.0.7 DRM 3.49 6.1.7-200.fc37.x86_64) direct render: Yes
1 Like

In an effort to try to fix this issue, I run sudo dnf module install nvidia-driver:latest-dkms earlier this week, but I ran sudo dnf module remove nvidia-driver today because that made no difference, even after reboot.

This new laptop has an AMD Radeon Graphics and NVidia Geforce RTX sticker. Pretty sure I only paid for 1 graphics card though.

Those are your GPUs. The first is running nouveau and it is known that the nouveau driver does not support hardware acceleration.
Please post the output of dnf list installed '*nvidia*'. If you uninstalled the drivers properly it should only show the nvidia-gpu-firmware package.

I also suggest that when installing the nvidia drivers you do so from the rpmfusion repo as instructed here after enabling the repos as shown here.

Once the rpmfusion repo is enabled the command sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda will install and compile the modules. Wait about 5 minutes for the modules to be built then reboot and the nvidia drivers should load.

It is also worth noting that for an unsigned kernel module to load the user must disable secure boot on the system.

Once booted with the nvidia drivers loaded the user should be able to see something like this.

$ lsmod | grep nvidia
nvidia_drm             73728  9
nvidia_modeset       1220608  12 nvidia_drm
nvidia_uvm           2904064  4
nvidia              56393728  1362 nvidia_uvm,nvidia_modeset
video                  65536  1 nvidia_modeset
2 Likes

Ok, this looks good:

$ dnf list installed '*nvidia*'
Installed Packages
nvidia-gpu-firmware.noarch              20230117-146.fc37               @updates

And this looks bad:

$ sudo dnf install akmod-nvidia
...
 Problem: package akmod-nvidia-3:525.78.01-1.fc37.x86_64 requires nvidia-kmod-common >= 3:525.78.01, but none of the providers can be installed
  - cannot install the best candidate for the job
  - package xorg-x11-drv-nvidia-3:525.78.01-1.fc37.x86_64 is filtered out by modular filtering

It installed a lot of things, but not the final thing:

Installed:
  akmod-nvidia-3:520.56.06-1.fc37.x86_64                                        
  akmods-0.5.7-9.fc37.noarch                                                    
  annobin-docs-10.92-1.fc37.noarch                                              
  annobin-plugin-gcc-10.92-1.fc37.x86_64                                        
  ansible-srpm-macros-1-8.1.fc37.noarch                                         
  bison-3.8.2-3.fc37.x86_64                                                     
  debugedit-5.0-5.fc37.x86_64                                                   
  dkms-3.0.10-1.fc37.noarch                                                     
  dwz-0.14-7.fc37.x86_64                                                        
  ed-1.18-2.fc37.x86_64                                                         
  efi-srpm-macros-5-6.fc37.noarch                                               
  egl-wayland-1.1.11-1.fc37.x86_64                                              
  elfutils-libelf-devel-0.188-3.fc37.x86_64                                     
  fakeroot-1.30.1-1.fc37.x86_64                                                 
  fakeroot-libs-1.30.1-1.fc37.x86_64                                            
  flex-2.6.4-11.fc37.x86_64                                                     
  fonts-srpm-macros-1:2.0.5-9.fc37.noarch                                       
  fpc-srpm-macros-1.3-6.fc37.noarch                                             
  gcc-plugin-annobin-12.2.1-4.fc37.x86_64                                       
  ghc-srpm-macros-1.5.0-7.fc37.noarch                                           
  gnat-srpm-macros-5-1.fc37.noarch                                              
  go-srpm-macros-3.2.0-1.fc37.noarch                                            
  http-parser-2.9.4-7.fc37.x86_64                                               
  kernel-devel-6.1.7-200.fc37.x86_64                                            
  kernel-devel-matched-6.1.7-200.fc37.x86_64                                    
  kernel-srpm-macros-1.0-15.fc37.noarch                                         
  kmod-nvidia-latest-dkms-3:525.60.13-1.fc36.x86_64                             
  kmodtool-1.1-5.fc37.noarch                                                    
  koji-1.31.1-1.fc37.noarch                                                     
  libgit2-1.3.2-1.fc37.x86_64                                                   
  libvdpau-1.5-2.fc37.x86_64                                                    
  lua-srpm-macros-1-7.fc37.noarch                                               
  m4-1.4.19-4.fc37.x86_64                                                       
  nim-srpm-macros-3-7.fc37.noarch                                               
  nvidia-driver-3:525.60.13-1.fc36.x86_64                                       
  nvidia-driver-libs-3:525.60.13-1.fc36.x86_64                                  
  nvidia-kmod-common-3:525.60.13-1.fc36.noarch                                  
  ocaml-srpm-macros-7-2.fc37.noarch                                             
  openblas-srpm-macros-2-12.fc37.noarch                                         
  openssl-1:3.0.5-3.fc37.x86_64                                                 
  openssl-devel-1:3.0.5-3.fc37.x86_64                                           
  package-notes-srpm-macros-0.5-6.fc37.noarch                                   
  patch-2.7.6-17.fc37.x86_64                                                    
  perl-srpm-macros-1-46.fc37.noarch                                             
  python-srpm-macros-3.11-5.fc37.noarch                                         
  python3-babel-2.10.3-3.fc37.noarch                                            
  python3-decorator-5.1.1-4.fc37.noarch                                         
  python3-gssapi-1.7.3-3.fc37.x86_64                                            
  python3-koji-1.31.1-1.fc37.noarch                                             
  python3-progressbar2-3.53.2-6.fc37.noarch                                     
  python3-pygit2-1.7.1-4.fc37.x86_64                                            
  python3-pytz-2022.7.1-1.fc37.noarch                                           
  python3-requests-gssapi-1.2.3-6.fc37.noarch                                   
  python3-rpmautospec-0.3.1-1.fc37.noarch                                       
  python3-utils-3.1.0-3.fc37.noarch                                             
  qt5-srpm-macros-5.15.8-1.fc37.noarch                                          
  redhat-rpm-config-228-1.fc37.noarch                                           
  rpm-build-4.18.0-1.fc37.x86_64                                                
  rpmautospec-rpm-macros-0.3.1-1.fc37.noarch                                    
  rpmdevtools-9.6-2.fc37.noarch                                                 
  rust-srpm-macros-23-1.fc37.noarch                                             
  systemd-rpm-macros-251.10-588.fc37.noarch                                     
  xorg-x11-drv-nvidia-kmodsrc-3:525.78.01-1.fc37.x86_64                         
  zlib-devel-1.2.12-5.fc37.x86_64                                               
Skipped:
  akmod-nvidia-3:525.78.01-1.fc37.x86_64  

I seem to be stuck because this fails:

 sudo dnf install xorg-x11-drv-nvidia-cuda
Last metadata expiration check: 0:16:30 ago on Sun 29 Jan 2023 10:48:48 AM CET.
All matches were filtered out by modular filtering for argument: xorg-x11-drv-nvidia-cuda
Error: Unable to find a match: xorg-x11-drv-nvidia-cuda

Potentially related:

$ sudo dnf module list --enabled
Last metadata expiration check: 0:22:38 ago on Sun 29 Jan 2023 11:06:11 AM CET.
cuda-fedora36-x86_64
Name          Stream             Profiles       Summary                         
nvidia-driver latest-dkms [d][e] default [d], f Nvidia driver for latest-dkms br
                                 m, ks          anch    

Clearly, when I wanted to install the NVidia driver, the first link I had on Google was wrong (it wasn’t the rpm nonfree approach) and now my system is screwed.

Not screwed, merely a little twisted and needs cleaned up.

Lets first find out where everything nvidia was installed from.
dnf list installed '*nvidia*' '*cuda*'
Please post that before proceeding so we can tell what repo may possibly need to be disabled.

If every repo is either fedora or rpmfusion then proceed. If not please wait until I can reply to ensure the commands below are correct.

Then we can get rid of the currently interfering parts and install the latest drivers.

  1. dnf module remove cuda-fedora "nvidia-driver:latest-dkms"
    to remove the interfering modular portions. If there are errors then stop here.

  2. dnf remove '*nvidia*' --exclude=nvidia-gpu-firmware to remove the older version packages that were just installed and leave the required firmware.

  3. dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda to install the newest drivers from rpmfusion including cuda.

That should recover. If there are any errors or questions at any step then stop and lets fix that before proceeding. Blindly proceeding causes more recovery problems.

Note that as far as I can tell, the only repo that at present contains the drivers capable of properly supporting the 3060 and newer nvidia GPUs is rpmfusion. The 520 driver does not. Even the 525.60 driver does not.

2 Likes

Thanks Jeff. I had a dark moment for a second. Here you go:

$ dnf list installed '*nvidia*' '*cuda*'
Installed Packages
akmod-nvidia.x86_64                                                                                               3:520.56.06-1.fc37                                                                                @rpmfusion-nonfree        
kmod-nvidia-latest-dkms.x86_64                                                                                    3:525.60.13-1.fc36                                                                                @cuda-fedora36-x86_64     
nvidia-driver.x86_64                                                                                              3:525.60.13-1.fc36                                                                                @cuda-fedora36-x86_64     
nvidia-driver-libs.x86_64                                                                                         3:525.60.13-1.fc36                                                                                @cuda-fedora36-x86_64     
nvidia-gpu-firmware.noarch                                                                                        20230117-146.fc37                                                                                 @updates                  
nvidia-kmod-common.noarch                                                                                         3:525.60.13-1.fc36                                                                                @cuda-fedora36-x86_64     
xorg-x11-drv-nvidia-kmodsrc.x86_64                                                                                3:525.78.01-1.fc37                                                                                @rpmfusion-nonfree-updates

That @updates one, of nvidia-gpu-firmware.noarch, does it count as fedora?

Ok, with that info you definitely need to remove everything installed from the cuda-fedora repo. Note that you have packages installed from rpmfusion-nonfree, cuda-fedora36-x86_64, and rpmfusion-nonfree-updates and there are 3 different version numbers installed. All the packages must match in version number and should come from the same repo so they all work together. The one that must remain is the nvidia-gpu-firmware package since that is a fedora update and not a driver package.

The steps I provided above need modified.

  1. dnf module remove cuda-fedora nvidia-driver:latest-dkms or maybe dnf module remove nvidia-driver:latest-dkms then repeat the previous dnf list installed '*nvidia*' command to see what is remaining.
    If any nvidia packages (except the firmware) are remaining then remove them with
    dnf remove '*nvidia*' --exclude=nvidia-gpu-firmware

  2. Once all the nvidia driver remenants are removed then install the nvidia packages from rpmfusion with
    dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda --disablerepo=cuda-fedora36-x86_64

This should get the latest nvidia drivers (525.78.01) and the matching cuda packages from rpmfusion.

2 Likes

dnf module remove ... didn’t work for me, but this did:

sudo dnf remove nvidia-driver

Only this one is left:

$ dnf list installed *nvidia*
Installed Packages
nvidia-gpu-firmware.noarch                                 20230117-146.fc37                                  @updates
$ sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda --disablerepo=cuda-fedora36-x86_64
Fedora 37 - x86_64 - Updates                                                          131 kB/s |  16 kB     00:00    
Fedora 37 - x86_64 - Updates                                                          6.5 MB/s | 3.3 MB     00:00    
Fedora Modular 37 - x86_64 - Updates                                                  168 kB/s |  17 kB     00:00    
All matches were filtered out by modular filtering for argument: xorg-x11-drv-nvidia-cuda
Error: Unable to find a match: xorg-x11-drv-nvidia-cuda

I successfully disabled that cuda repository with dnf --disablerepo cuda-fedora36-x86_64.

Yet, the next steps still fail:

$ sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda
Last metadata expiration check: 0:09:46 ago on Mon 30 Jan 2023 08:51:28 PM CET.
All matches were filtered out by modular filtering for argument: xorg-x11-drv-nvidia-cuda
Error: Unable to find a match: xorg-x11-drv-nvidia-cuda


$ sudo dnf install akmod-nvidia
Last metadata expiration check: 0:07:45 ago on Mon 30 Jan 2023 08:51:28 PM CET.
Error: 
 Problem: conflicting requests
  - package akmod-nvidia-3:520.56.06-1.fc37.x86_64 requires nvidia-kmod-common >= 3:520.56.06, but none of the providers can be installed
  - package akmod-nvidia-3:525.78.01-1.fc37.x86_64 requires nvidia-kmod-common >= 3:525.78.01, but none of the providers can be installed
  - package xorg-x11-drv-nvidia-3:520.56.06-1.fc37.x86_64 is filtered out by modular filtering
  - package xorg-x11-drv-nvidia-3:525.78.01-1.fc37.x86_64 is filtered out by modular filtering
(try to add '--skip-broken' to skip uninstallable packages)

This fixed that:

$ sudo dnf module disable nvidia-driver
...
$ sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda

Glad you figured out how to disable the modular issue.
I would assume that it now installed the nvidia 525-78-1 driver version?
Is that correct?

If everything installed correctly you should see a screenfull of packages with dnf list installed '*nvidia*' and about 5 lines of output with lsmod | grep nvidia The installed packages should all show the same version.

1 Like

That command only disables the repo for the current command.
To disable it permanently the command
sudo dnf config-manager --disable cuda-fedora36-x86_64 will do so.

1 Like

I rebooted first.

This looks good:

$ dnf list installed '*nvidia*'
Installed Packages
akmod-nvidia.x86_64                                    3:525.78.01-1.fc37               @rpmfusion-nonfree-nvidia-driver
kmod-nvidia-6.1.8-200.fc37.x86_64.x86_64               3:525.78.01-1.fc37               @@commandline                   
nvidia-gpu-firmware.noarch                             20230117-146.fc37                @updates                        
nvidia-persistenced.x86_64                             3:525.78.01-1.fc37               @rpmfusion-nonfree-nvidia-driver
nvidia-settings.x86_64                                 3:525.78.01-1.fc37               @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia.x86_64                             3:525.78.01-1.fc37               @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-cuda.x86_64                        3:525.78.01-1.fc37               @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-cuda-libs.x86_64                   3:525.78.01-1.fc37               @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-kmodsrc.x86_64                     3:525.78.01-1.fc37               @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-libs.x86_64                        3:525.78.01-1.fc37               @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-power.x86_64                       3:525.78.01-1.fc37               @rpmfusion-nonfree-nvidia-driver

but this doesn’t (no nvidia):

$ lsmod
Module                  Size  Used by
tls                   131072  0
binfmt_misc            28672  1
nft_objref             16384  1
nf_conntrack_netbios_ns    16384  1
nf_conntrack_broadcast    16384  1 nf_conntrack_netbios_ns
nft_fib_inet           16384  1
nft_fib_ipv4           16384  1 nft_fib_inet
nft_fib_ipv6           16384  1 nft_fib_inet
nft_fib                16384  3 nft_fib_ipv6,nft_fib_ipv4,nft_fib_inet
nft_reject_inet        16384  6
nf_reject_ipv4         16384  1 nft_reject_inet
nf_reject_ipv6         20480  1 nft_reject_inet
nft_reject             16384  1 nft_reject_inet
nft_ct                 20480  16
nft_chain_nat          16384  3
nf_nat                 57344  1 nft_chain_nat
nf_conntrack          172032  4 nf_nat,nft_ct,nf_conntrack_netbios_ns,nf_conntrack_broadcast
nf_defrag_ipv6         24576  1 nf_conntrack
nf_defrag_ipv4         16384  1 nf_conntrack
ip_set                 61440  0
nf_tables             282624  237 nft_ct,nft_reject_inet,nft_fib_ipv6,nft_objref,nft_fib_ipv4,nft_chain_nat,nft_reject,nft_fib,nft_fib_inet
nfnetlink              20480  3 nf_tables,ip_set
qrtr                   53248  4
sunrpc                700416  1
vfat                   24576  1
fat                    94208  1 vfat
intel_rapl_msr         20480  0
intel_rapl_common      32768  1 intel_rapl_msr
edac_mce_amd           57344  0
kvm_amd               172032  0
kvm                  1126400  1 kvm_amd
irqbypass              16384  1 kvm
joydev                 28672  0
rapl                   20480  0
k10temp                16384  0
i2c_piix4              36864  0
acpi_cpufreq           32768  0
zram                   36864  2
nvme                   61440  3
nvme_core             196608  4 nvme
ucsi_acpi              16384  0
crct10dif_pclmul       16384  1
crc32_pclmul           16384  0
crc32c_intel           24576  3
hid_multitouch         32768  0
polyval_clmulni        16384  0
polyval_generic        16384  1 polyval_clmulni
ghash_clmulni_intel    16384  0
sha512_ssse3           53248  0
typec_ucsi             53248  1 ucsi_acpi
wdat_wdt               20480  0
serio_raw              20480  0
ccp                   122880  1 kvm_amd
sp5100_tco             20480  0
r8169                  98304  0
typec                  90112  1 typec_ucsi
nvme_common            24576  1 nvme_core
i2c_hid_acpi           16384  0
i2c_hid                40960  1 i2c_hid_acpi
ip6_tables             36864  0
ip_tables              36864  0
fuse                  176128  5