Can't install Nvidia drivers on Rocky Linux 9.1

I’ve spent a few days trying to install the drivers for my Nvidia graphics card on my computer running Rocky Linux 9.1.

My graphics card is an NVIDIA 940M and I have followed the steps to install the drivers but when I run “nvidia-smi” I get the following error:

NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

I don’t really know how I can proceed.

I leave here the outputs of some commands that I find useful information:

lspci -vnnn | grep -i nvidia
03:00.0 3D controller [0302]: NVIDIA Corporation GM108M [GeForce 940M] [10de:1347] (rev a2)
        Kernel modules: nouveau, nvidia_drm, nvidia
dkms status
nvidia/530.30.02, 5.14.0-162.23.1.el9_1.x86_64, x86_64: installed

I appreciate your help