HDMI does not seem to work on Fedora

Recently I have tried to display my screen to my TV via HDMI, however neither the TV or my computer have seemed to have any response to the HDMI connection (TV didn’t detect any input and nothing have changed on my laptop).

At first I was concerned that it may be some kind of hardware issue, so I booted up windows on the same laptop, and HDMI on windows seemed to work perfectly fine with no issues whatsoever.

I have tried to follow this tutorial, however encountered an issue at

sudo cp -p /usr/share/X11/xorg.conf.d/nvidia.conf /etc/X11/xorg.conf.d/nvidia.conf

with the output being

cp: cannot stat '/usr/share/X11/xorg.conf.d/nvidia.conf': No such file or directory

I have gotten the same output trying to change the ‘usr’ (I thought it would so something).

I also do not have the same settings as in this tutorial, since I appear to be missing display modes.

What I think may possibly be related to the issue is the fact that for some reason, no matter how much I click the ‘Restart & Update’ button in the software store, the apps, which are NVIDIA Drivers Graphics Control Panel and System Updates, they do not seem to update.

I have also gotten errors while trying to run sudo dnf update

Package                        Arch   Version                 Reposito      Size
Skipping packages with conflicts:
 kmod-nvidia-latest-dkms       x86_64 3:580.105.08-1.fc42     cuda-fed 117.7 MiB
 kmod-nvidia-latest-dkms       x86_64 3:580.126.09-1.fc42     cuda-fed 117.8 MiB
 kmod-nvidia-latest-dkms       x86_64 3:580.126.16-1.fc42     cuda-fed 117.8 MiB
 kmod-nvidia-latest-dkms       x86_64 3:580.126.20-1.fc42     cuda-fed 117.8 MiB
 kmod-nvidia-latest-dkms       x86_64 3:580.159.03-1.fc42     cuda-fed 117.9 MiB
 kmod-nvidia-latest-dkms       x86_64 3:580.159.04-1.fc42     cuda-fed 117.9 MiB
 kmod-nvidia-latest-dkms       x86_64 3:580.167.08-1.fc42     cuda-fed 117.9 MiB
 kmod-nvidia-latest-dkms       x86_64 3:580.173.02-1.fc42     cuda-fed 117.9 MiB
 kmod-nvidia-latest-dkms       x86_64 3:580.65.06-1.fc42      cuda-fed 117.5 MiB
 kmod-nvidia-latest-dkms       x86_64 3:580.82.07-1.fc42      cuda-fed 117.6 MiB
 kmod-nvidia-latest-dkms       x86_64 3:580.95.05-1.fc42      cuda-fed 117.7 MiB
 kmod-nvidia-latest-dkms       x86_64 3:590.44.01-1.fc42      cuda-fed 111.3 MiB
 nvidia-libXNVCtrl             x86_64 3:580.178.04-1.fc42     cuda-fed  44.1 KiB
 nvidia-persistenced           x86_64 3:580.105.08-1.fc42     cuda-fed  58.1 KiB
 nvidia-persistenced           x86_64 3:580.126.09-1.fc42     cuda-fed  58.1 KiB
 nvidia-persistenced           x86_64 3:580.126.16-1.fc42     cuda-fed  58.1 KiB
 nvidia-persistenced           x86_64 3:580.126.20-1.fc42     cuda-fed  58.1 KiB
 nvidia-persistenced           x86_64 3:580.159.03-1.fc42     cuda-fed  58.1 KiB
 nvidia-persistenced           x86_64 3:580.159.04-1.fc42     cuda-fed  58.1 KiB
 nvidia-persistenced           x86_64 3:580.167.08-1.fc42     cuda-fed  58.0 KiB
 nvidia-persistenced           x86_64 3:580.173.02-1.fc42     cuda-fed  58.0 KiB
 nvidia-persistenced           x86_64 3:580.178.04-1.fc42     cuda-fed  58.0 KiB
 nvidia-persistenced           x86_64 3:580.65.06-1.fc42      cuda-fed  58.0 KiB
 nvidia-persistenced           x86_64 3:580.82.07-1.fc42      cuda-fed  58.0 KiB
 nvidia-persistenced           x86_64 3:580.95.05-1.fc42      cuda-fed  58.1 KiB
 nvidia-persistenced           x86_64 3:590.44.01-1.fc42      cuda-fed  58.1 KiB
 xorg-x11-drv-nvidia-cuda-libs x86_64 3:595.58.03-1.fc44      rpmfusio 430.7 MiB
 nvidia-modprobe               x86_64 3:610.57.04-1.fc44      rpmfusio  50.7 KiB
 nvidia-persistenced           x86_64 3:610.57.04-1.fc44      rpmfusio  54.2 KiB
 nvidia-settings               x86_64 3:610.57.04-1.fc44      rpmfusio   4.4 MiB
 xorg-x11-drv-nvidia-cuda      x86_64 3:610.57.04-1.fc44      rpmfusio   7.4 MiB
 xorg-x11-drv-nvidia-cuda-libs x86_64 3:610.57.04-1.fc44      rpmfusio 481.1 MiB
Skipping packages with broken dependencies:
 cuda-drivers                  x86_64 3:580.105.08-1.fc42     cuda-fed   0.0   B
 cuda-drivers                  x86_64 3:580.126.09-1.fc42     cuda-fed   0.0   B
 cuda-drivers                  x86_64 3:580.126.16-1.fc42     cuda-fed   0.0   B
 cuda-drivers                  x86_64 3:580.126.20-1.fc42     cuda-fed   0.0   B
 cuda-drivers                  x86_64 3:580.159.03-1.fc42     cuda-fed   0.0   B
 cuda-drivers                  x86_64 3:580.159.04-1.fc42     cuda-fed   0.0   B
 cuda-drivers                  x86_64 3:580.167.08-1.fc42     cuda-fed   0.0   B
 cuda-drivers                  x86_64 3:580.173.02-1.fc42     cuda-fed   0.0   B
 cuda-drivers                  x86_64 3:580.178.04-1.fc42     cuda-fed   0.0   B
 cuda-drivers                  x86_64 3:580.65.06-1.fc42      cuda-fed   0.0   B
 cuda-drivers                  x86_64 3:580.82.07-1.fc42      cuda-fed   0.0   B
 cuda-drivers                  x86_64 3:580.95.05-1.fc42      cuda-fed   0.0   B
 cuda-drivers                  x86_64 3:590.44.01-1.fc42      cuda-fed   0.0   B
 nvidia-driver-cuda            x86_64 3:580.105.08-1.fc42     cuda-fed   1.4 MiB
 nvidia-driver-cuda            x86_64 3:580.126.09-1.fc42     cuda-fed   1.4 MiB
 nvidia-driver-cuda            x86_64 3:580.126.16-1.fc42     cuda-fed   1.4 MiB
 nvidia-driver-cuda            x86_64 3:580.126.20-1.fc42     cuda-fed   1.4 MiB
 nvidia-driver-cuda            x86_64 3:580.159.03-1.fc42     cuda-fed   1.4 MiB
 nvidia-driver-cuda            x86_64 3:580.159.04-1.fc42     cuda-fed   1.4 MiB
 nvidia-driver-cuda            x86_64 3:580.167.08-1.fc42     cuda-fed   1.4 MiB
 nvidia-driver-cuda            x86_64 3:580.173.02-1.fc42     cuda-fed   1.4 MiB
 nvidia-driver-cuda            x86_64 3:580.178.04-1.fc42     cuda-fed   1.4 MiB
 nvidia-driver-cuda            x86_64 3:580.65.06-1.fc42      cuda-fed   1.4 MiB
 nvidia-driver-cuda            x86_64 3:580.82.07-1.fc42      cuda-fed   1.4 MiB
 nvidia-driver-cuda            x86_64 3:580.95.05-1.fc42      cuda-fed   1.4 MiB
 nvidia-driver-cuda            x86_64 3:590.44.01-1.fc42      cuda-fed   1.5 MiB
 xorg-x11-drv-nvidia-cuda      x86_64 3:595.58.03-1.fc44      rpmfusio   6.4 MiB
 xorg-x11-drv-nvidia-cuda      x86_64 3:610.57.04-1.fc44      rpmfusio   7.4 MiB

Please keep in mind I am a noob and I am not sure whether the issues are connected.

For reference, my laptop model is Lenovo ThinkPad P16 Gen 2.

Any help is appreciated.

Solved!

Removing the old nvidia drivers and reinstalling them following this tutorial helped (as well as following the steps from the solution)! The HDMI displays fine now, thank you to everyone who has helped.

It probably is. The file /usr/share/X11/xorg.conf.d/nvidia.conf is provided by the nvidia packages from rpmfusion, and it appears you have installed nvidea from some other repository. The package from rpmfusion is built for and tested with Fedora, whereas the dkms packages from some other repository is built for some general linux which may not have been tested with Fedora.

See the rpmfusion nvidia howto.

As noted by @vekruse above, your output shows a lot of packages installed from an nvidia site and not from rpmfusion.

I think the issue will be solved if you do the following.

  1. run dnf repolist and ensure that you see the rpmfusion-nonfree-nvidia-drivers repo in that list. If not the rpmfusion repos can be enabled by following the instructions here which enables the rpmfusion-free and rpmfusion-nonfree repos.
  2. remove all the existing nvidia driver packages with
    sudo dnf remove \*nvidia\* cuda-drivers --exclude nvidia-gpu-firmware
  3. Note the full name of the repo previously used to install the nvidia drivers which would have been shown with the command in step 1, and disable it.
    That repo probably is shown as cuda-fedora-42 and the command would be sudo dnf config-manager setopt "cuda-fedora-42.enable=0"
    (if the name is different please use the name shown in the repolist)
  4. install the nvidia driver from rpmfusion with the command
    sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda
    wait a few minutes after the installation completes before rebooting.
  5. reboot and the newest nvidia driver should be installed and functional.

The issue appears to be that you upgraded from f42 to f44 and that the repo used for the nvidia drivers has 3 issues. 1) it is directly from nvidia which does not always properly support nvidia gpus on fedora, and 2) the update method fails to remove outdated packages when newer versions are released, and 3) because the repo is version specific for fedora 42 it does not allow upgrades without also enabling a newer version specific repo.

With the rpmfusion repos all these failings noted above will no longer exist. The command given in step 4 also enables cuda support with the rpmfusion repo so the tools from the nvidia repo are usually no longer required.

I guess this would also have an iGPU? Is it Intel or AMD?

I am not sure having an iGPU matters, even though likely. His issue is with the external hdmi port.

Many laptops have the dGPU dedicated to the external monitor port with the iGPu supporting the built-in screen. If his laptop is one of those then when the nvidia dGPU is not working a monitor attached to the hdmi port would not work.

Many Lenovo Thinkpads use Optimus graphics, so default is to pass everything through the iGPU, but you should be able to configure with Nvidia as primary GPU using some version of Nividia’s optimus-manager.

Edit: there are multiple programs that perform similar functions

Last time I checked there wasn’t one.

The last time I was explicitly able to set the nvidia GPU as primary was while still using X11. Wayland does not seem to have any way to make it primary, or at least I have never found a way.

Switcherooctl allows something similar but I have never dug deep into how it works except that it allows launching specific apps on the selected gpu.