OpenGL refuses to use my NVIDIA GPU

I have a Dell XPS 15 with Fedora Workstation 38 on Wayland using systemd-boot. Everything is working great except for the fact that every OpenGL application refuses to use my NVIDIA GPU. If I run DRI_PRIME=1 glxinfo I get two errors and it uses llvmpipe instead.
The errors are as follows:

libGL error: glx: failed to create dri3 screen
libGL error: failed to load driver: nouveau

This is the output of lspci -k:

01:00.0 3D controller: NVIDIA Corporation AD107M [GeForce RTX 4060 Max-Q / Mobile] (rev a1)
	Subsystem: Dell Device 0beb
	Kernel driver in use: nvidia
	Kernel modules: nouveau, nvidia_drm, nvidia

Does anyone know what is going on?

Try using the rpmfusion nvidia drivers.

See Howto/NVIDIA - RPM Fusion for instructions.

I did enable the rpmfusion non free repositories in the gnome software settings. Do I need to somehow specify I want the packages from there?

The Howto document has installation instructions:

Installing the drivers

  1. Current GeForce/Quadro/Tesla

This section says:

Current GeForce/Quadro/Tesla
Supported on current stable Xorg server release.
This driver is suitable for any GPU found in 2014 and later.

Please note the 5-mnute wait for the rpm transaction to finish (use the modinfo check to determine if the module is installed).

The modinfo version command correctly outputs 535.98, however OpenGL is still using llvmpipe with DRI_PRIME=1