NVIDIA Driver breaks screen resolution and iGPU


I know there are quite some threads about this but I am just totally lost and can’t seem to get it to work no matter what.

I have a fresh install of fedora on disk (no VM) of the latest version fedora 38 with KDE plasma.
Originally I was running my display with a native resolution of 3840x2560@60 off of my intel iGPU without any issue.

Yesterday I added a GTX 1650 to my system as I was hoping to give my time series forecasts a little boost with CUDA.
Upon installing nvidia drivers everything went downhill.

I originally tried installing using akmod nivida from rpmfusion.
Issues I encountered were:

  • display resolution went down to 800x600 with no way to change it through the settings.
  • connecting the display to the iGPU instead of the new Nvidia card left me with a black screen.

I tried reinstalling by running dnf remove *nvidia* and running dnf install akmod-nvidia again which didn’t work. All nvidia package seem to be removed but I couldn’t reinstall due to conflicts.

That’s why I decided to install everything as explained on the nvidia homepage:

  • downloaded nvidia run file
  • booted into init 3 without x server
  • installed kernel-devel and executed run file

Next I also installed the Nvidia cuda 12.1 development toolkit from the Nvidia page.

This seems to have somehow worked fine. The sample files from nvidia compile and upon executed provide the expected output. It recognises the card and can execute cuda code.

However, my issue with the low screen resolution remained.

In /sys/class/drm I have my card and adapter as card0-Unknown-1. The modes file only contains 800x600.

I tried changing it adding the line

GRUB_CMDLINE_LINUX_DEFAULT="quiet video=Unknown-1:3840x2560@60"

And ran

sudo grub2-mkconfig -o /boot/grub2/grub.cfg

And because I am desparate and clueless

sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

I have no experience using fedora. This is the first time I am using it. I was running arch before at home and had to use ubuntu at work.

I verified that both generated grub.cfg files contain the resolution. I even added fake 40_custom entries to make sure I got the right file. Booting into grub my changes to 40_custom are visible so I guess it is working as expected.
However the modes file still only shows 800x600.

Ignoring the issue that my iGPU can’t output to displays anymore which I don’t really care about: how do I get my proper screen resolution back?

Nvidia driver version: 525.116.04 (I selected ‘no’ when it propted me for 32 bit support.)

Any help highly appreciated. This is currently my only workstation available and I am really hoping I can get some more calculations done soon.

This was a major error.

This also removed the firmware for the nvidia GPU

This is never recommended since the drivers (including cuda) from rpmfusion are already tweaked to work with fedora. The ones directly from nvidia may or may not have problems.

For recovery the following should be done

  1. Remove all that was installed from nvidia
  2. Reinstall the nvidia firmware dnf install nvidia-gpu-firmware
  3. install the nvidia drivers from rpmfusion
    dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda
  4. wait at least 5 minutes for the new drivers to be properly built, then reboot.

If things still are not working properly then let us know exactly what is happening so we can assist.

I have 2 desktops with GTX 1050 cards and a laptop with a GTX1660 card and all use the rpmfusion drivers (including cuda) and run cuda apps with never a problem.

# nvidia-smi
Mon May 29 10:20:38 2023       
| NVIDIA-SMI 530.41.03              Driver Version: 530.41.03    CUDA Version: 12.1     |
| GPU  Name                  Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf            Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|   0  NVIDIA GeForce GTX 1050         Off| 00000000:01:00.0  On |                  N/A |
| 57%   67C    P0               N/A /  75W|   1161MiB /  2048MiB |    100%      Default |
|                                         |                      |                  N/A |
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|    0   N/A  N/A   1992804      G   /usr/bin/gnome-shell                         80MiB |
|    0   N/A  N/A   1993277      G   /usr/bin/Xwayland                           109MiB |
|    0   N/A  N/A   1993549      G   /usr/libexec/xdg-desktop-portal-gnome         3MiB |
|    0   N/A  N/A   1998491      G   ...4681106,17381961642600002708,262144       58MiB |
|    0   N/A  N/A   2580710      C   ...pc-linux-gnu__FGRPopencl2Pup-nvidia      700MiB |

Finally one needs to fix the error with the file /boot/efi/EFI/fedora/grub.cfg.
That can be done with

  1. sudo rm /boot/grub2/grub.cfg /boot/efi/EFI/fedora/grub.cfg
    followed by
  2. sudo dnf reinstall grub2-common grub2-tools to properly rebuild both those files.

Did you mean to set 3840x2160 not 2560?