Having hard time with nvidia drivers

hy guys , very new with linux i did struggle the last time i did update my system as nouveau driver overwrite my nvidia drivers and i ended with the minimal screen resolution at 720 p. I was able to install back nvidia drivers but i’m afraid this will happen again at the next update . here is what show dnf list installed *nvidia* any advices ?

First, it appears that you have not installed the latest nvidia driver. That is version 550.67 from rpmfusion. An update of the system, including the nvidia drivers could be done with
sudo dnf upgrade --refresh then wait for at least 5 minutes before rebooting.

If that does not help then please provide more info about what is happening.
To see if the nvidia driver is actually loading run lsmod | grep -iE "nvidia|nouveau" to see which may actually be loaded. A list of nvidia modules would show the nvidia driver is actually loaded while a list of nouveau modules would show the nvidia driver did not load.

Since you have installed the nvidia drivers from rpmfusion there should be no issue with updates. Both dnf and gnome software will normally update those drivers with regular system updates.

The only issue that some have seen is that occasionally the system may automatically reboot too quickly after the installation of a new kernel and cause corruption in the drivers. As long as the reboot is delayed adequately after installation this does not appear to happen.

One additional thing that might prevent the nvidia drivers from loading would be secure boot. If secure boot is enabled and the nvidia drivers are not properly signed then those modules will not load.

Thanks Jeff here is the result of what you asked, i remenber doing something like this
Append ‘rd.driver.blacklist=nouveau’ (and ‘nvidia-drm.modeset=1’) to end of ‘GRUB_CMDLINE_LINUX=”…”‘.
Screenshot from 2024-03-26 19-35-19

That says the nvidia driver is properly loaded so there should be no problems.

If you have a specific identifiable issue then state that, but otherwise it appears perfectly normal to me.

To see what the kernel command line uses try cat /etc/kernel/cmdline

Please copy and paste text into the post instead of using images. It takes less storage space, is easier to read, and is searchable that way. Images are not searchable.
Use this method.
```
paste the text here
```

1 Like

sorry for images, my mistake
here is the result
root=UUID=7a13a122-71a7-4898-a672-d7ff860d513e ro rootflags=subvol=root rd.driver.blacklist=nouveau modprobe.blacklist=nouveau rhgb quiet rd.driver.blacklist=nouveau modprobe.blacklist=nouveau

This is duplicated in that. rd.driver.blacklist=nouveau modprobe.blacklist=nouveau (which does not actually hurt since the duplicate seems to be ignored) and it does not have nvidia-drm.modeset=1 which I would have expected.

You could edit /etc/default/grub and make those changes to the GRUB_CMDLINE_LINUX entry then run sudo grub2-mkconfig -o /boot/grub2/grub.cfg to make the changes permanent.
`

2 Likes

Now, i should be fine updating with sudo dnf upgrade --refresh ?
root=UUID=7a13a122-71a7-4898-a672-d7ff860d513e ro rootflags=subvol=root rd.driver.blacklist=nouveau modprobe.blacklist=nouveau rhgb quiet nvidia-drm.modeset=1

Fedora uses the grub2-mkconfig command I posted just above.

If that is from the /etc/default/grub file then the ro should not be there.
Users edit that file then run the grub2-mkconfig command and not by editing the /etc/kernel/cmdline file.

1 Like

Hello JEFF, things is that editing /etc/default/grub with nano or with a text editor i don,t see where is the ro rootflags=subvol=root part
here is what i’ve got typing nano /etc/default/grub ( and it says that the file is unwritable):
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=“$(sed ‘s, release .*$,g’ /etc/system-release)”
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT=“console”
GRUB_CMDLINE_LINUX=“rd.driver.blacklist=nouveau modprobe.blacklist=nouveau rhgb quiet nvidia-drm.modeset=1”
GRUB_DISABLE_RECOVERY=“true”
GRUB_ENABLE_BLSCFG=true

The “ro” flag is inserted by grub2-mkconfig.

Long time ago, when the initial ram-disk wasn’t used, the root file system needed to be mounted read-only so it could be checked by fsck. This can only be done when not mounted or mounted read-only, and you don’t have the fsck program available before the root file system is mounted. After fsck the root can then be re-mounted read-write.

Nowadays, you would run fcsk from the initial ram disk before mounting the root file system.

1 Like

hello, i found the grub2-mkconfig files but don’t know if i should edit it , and how ?
here is the file :
prefix=“/usr”
exec_prefix=“/usr”
datarootdir=“/usr/share”

prefix=“/usr”
exec_prefix=“/usr”
sbindir=“/usr/sbin”
bindir=“/usr/bin”
sysconfdir=“/etc”
PACKAGE_NAME=GRUB
PACKAGE_VERSION=2.06
host_os=linux-gnu
datadir=“/usr/share”
if [ “x$pkgdatadir” = x ]; then
pkgdatadir=“${datadir}/grub”
fi

export it for scripts

export pkgdatadir

grub_cfg=“”
grub_mkconfig_dir=“${sysconfdir}”/grub.d

self=basename $0

grub_probe=“${sbindir}/grub2-probe”
grub_file=“${bindir}/grub2-file”
grub_editenv=“${bindir}/grub2-editenv”
grub_script_check=“${bindir}/grub2-script-check”
grub_get_kernel_settings=“${sbindir}/grub2-get-kernel-settings”

export TEXTDOMAIN=grub
export TEXTDOMAINDIR=“${datarootdir}/locale”

export GRUB_GRUBENV_UPDATE=“yes”

. “${pkgdatadir}/grub-mkconfig_lib”

Usage: usage

Print the usage.

usage () {
gettext_printf “Usage: %s [OPTION]\n” “$self”
gettext “Generate a grub config file”; echo
echo
print_option_help “-o, --output=$(gettext FILE)” “$(gettext “output generated config to FILE [default=stdout]”)”
print_option_help “–no-grubenv-update” “$(gettext “do not update variables in the grubenv file”)”
print_option_help “-h, --help” “$(gettext “print this message and exit”)”
print_option_help “-V, --version” “$(gettext “print the version information and exit”)”
echo
gettext “Report bugs to bug-grub@gnu.org.”; echo
}

argument () {
opt=$1
shift

if test $# -eq 0; then
gettext_printf “%s: option requires an argument – `%s’\n” “$self” “$opt” 1>&2
exit 1
fi
echo $1
}

Check the arguments.

while test $# -gt 0
do
option=$1
shift

case "$option" in
-h | --help)
usage
exit 0 ;;
-V | --version)
echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}"
exit 0 ;;
-o | --output)
grub_cfg=`argument $option "$@"`; shift;;
--output=*)
grub_cfg=`echo "$option" | sed 's/--output=//'`
;;
--no-grubenv-update)
GRUB_GRUBENV_UPDATE="no"
;;
-*)
gettext_printf "Unrecognized option \`%s'\n" "$option" 1>&2
usage
exit 1
;;
# Explicitly ignore non-option arguments, for compatibility.
esac

done

if [ “x$EUID” = “x” ] ; then
EUID=id -u
fi

if [ “$EUID” != 0 ] ; then
root=f
case “uname 2>/dev/null” in
CYGWIN*)
# Cygwin: Assume root if member of admin group
for g in id -G 2>/dev/null ; do
case $g in
0|544) root=t ;;
esac
done ;;
esac
if [ $root != t ] ; then
gettext_printf “%s: You must run this as root\n” “$self” >&2
exit 1
fi
fi

set $grub_probe dummy
if test -f “$1”; then
:
else
gettext_printf “%s: Not found.\n” “$1” 1>&2
exit 1
fi

Device containing our userland. Typically used for root= parameter.

GRUB_DEVICE=“${grub_probe} --target=device /
GRUB_DEVICE_UUID=“${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null” || true
GRUB_DEVICE_PARTUUID=“${grub_probe} --device ${GRUB_DEVICE} --target=partuuid 2> /dev/null” || true

Device containing our /boot partition. Usually the same as GRUB_DEVICE.

GRUB_DEVICE_BOOT=“${grub_probe} --target=device /boot
GRUB_DEVICE_BOOT_UUID=“${grub_probe} --device ${GRUB_DEVICE_BOOT} --target=fs_uuid 2> /dev/null” || true

Filesystem for the device containing our userland. Used for stuff like

choosing Hurd filesystem module.

GRUB_FS=“${grub_probe} --device ${GRUB_DEVICE} --target=fs 2> /dev/null || echo unknown

if [ x"$GRUB_FS" = xunknown ]; then
GRUB_FS=“$(stat -f -c %T / || echo unknown)”
fi

Provide a default set of stock linux early initrd images.

Define here so the list can be modified in the sourced config file.

if [ “x${GRUB_EARLY_INITRD_LINUX_STOCK}” = “x” ]; then
GRUB_EARLY_INITRD_LINUX_STOCK=“intel-uc.img intel-ucode.img amd-uc.img amd-ucode.img early_ucode.cpio microcode.cpio”
fi

if test -f ${sysconfdir}/default/grub ; then
. ${sysconfdir}/default/grub
fi

eval “$(”${grub_get_kernel_settings}“)” || true

if [ “x${GRUB_DISABLE_UUID}” = “xtrue” ]; then
if [ -z “${GRUB_DISABLE_LINUX_UUID}” ]; then
GRUB_DISABLE_LINUX_UUID=“true”
fi
if [ -z “${GRUB_DISABLE_LINUX_PARTUUID}” ]; then
GRUB_DISABLE_LINUX_PARTUUID=“true”
fi
fi

XXX: should this be deprecated at some point?

if [ “x${GRUB_TERMINAL}” != “x” ] ; then
GRUB_TERMINAL_INPUT=“${GRUB_TERMINAL}”
GRUB_TERMINAL_OUTPUT=“${GRUB_TERMINAL}”
fi

termoutdefault=0
if [ “x${GRUB_TERMINAL_OUTPUT}” = “x” ]; then
GRUB_TERMINAL_OUTPUT=gfxterm;
termoutdefault=1;
fi

for x in ${GRUB_TERMINAL_OUTPUT}; do
case “x${x}” in
xgfxterm) ;;
xconsole | xserial | xofconsole | xvga_text)
# make sure all our children behave in conformance with ascii…
export LANG=C;;
*) echo “Invalid output terminal "${GRUB_TERMINAL_OUTPUT}"” >&2 ; exit 1 ;;
esac
done

GRUB_ACTUAL_DEFAULT=“$GRUB_DEFAULT”

if [ “x${GRUB_ACTUAL_DEFAULT}” = “xsaved” ] ; then GRUB_ACTUAL_DEFAULT=“"${grub_editenv}" - list | sed -n '/^saved_entry=/ s,^saved_entry=,,p'” ; fi

These are defined in this script, export them here so that user can

override them.

export GRUB_DEVICE
GRUB_DEVICE_UUID
GRUB_DEVICE_PARTUUID
GRUB_DEVICE_BOOT
GRUB_DEVICE_BOOT_UUID
GRUB_FS
GRUB_FONT
GRUB_PRELOAD_MODULES
GRUB_ACTUAL_DEFAULT

These are optional, user-defined variables.

export GRUB_DEFAULT
GRUB_HIDDEN_TIMEOUT
GRUB_HIDDEN_TIMEOUT_QUIET
GRUB_TIMEOUT
GRUB_TIMEOUT_STYLE
GRUB_DEFAULT_BUTTON
GRUB_HIDDEN_TIMEOUT_BUTTON
GRUB_TIMEOUT_BUTTON
GRUB_TIMEOUT_STYLE_BUTTON
GRUB_BUTTON_CMOS_ADDRESS
GRUB_BUTTON_CMOS_CLEAN
GRUB_DISTRIBUTOR
GRUB_CMDLINE_LINUX
GRUB_CMDLINE_LINUX_DEFAULT
GRUB_CMDLINE_XEN
GRUB_CMDLINE_XEN_DEFAULT
GRUB_CMDLINE_LINUX_XEN_REPLACE
GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT
GRUB_CMDLINE_NETBSD
GRUB_CMDLINE_NETBSD_DEFAULT
GRUB_CMDLINE_GNUMACH
GRUB_EARLY_INITRD_LINUX_CUSTOM
GRUB_EARLY_INITRD_LINUX_STOCK
GRUB_TERMINAL_INPUT
GRUB_TERMINAL_OUTPUT
GRUB_SERIAL_COMMAND
GRUB_DISABLE_UUID
GRUB_DISABLE_LINUX_UUID
GRUB_DISABLE_LINUX_PARTUUID
GRUB_DISABLE_RECOVERY
GRUB_VIDEO_BACKEND
GRUB_GFXMODE
GRUB_BACKGROUND
GRUB_THEME
GRUB_GFXPAYLOAD_LINUX
GRUB_DISABLE_OS_PROBER
GRUB_INIT_TUNE
GRUB_SAVEDEFAULT
GRUB_ENABLE_CRYPTODISK
GRUB_BADRAM
GRUB_OS_PROBER_SKIP_LIST
GRUB_DISABLE_SUBMENU
GRUB_DEFAULT_DTB
SUSE_BTRFS_SNAPSHOT_BOOTING
GRUB_ENABLE_BLSCFG

if test “x${grub_cfg}” != “x”; then
rm -f “${grub_cfg}.new”
oldumask=$(umask); umask 077
exec > “${grub_cfg}.new”
umask $oldumask
fi
gettext “Generating grub configuration file …” >&2
echo >&2

cat << EOF

DO NOT EDIT THIS FILE

It is automatically generated by $self using templates

from ${grub_mkconfig_dir} and settings from ${sysconfdir}/default/grub

EOF

for i in “${grub_mkconfig_dir}”/* ; do
case “$i” in
# emacsen backup files. FIXME: support other editors
~) ;;
# emacsen autosave files. FIXME: support other editors
/##) ;;
# rpm config files of yore.
.rpmsave|.rpmnew|
.rpmorig) ;;
*)
if grub_file_is_not_garbage “$i” && test -x “$i” ; then
echo
echo “### BEGIN $i ###”
“$i”
echo “### END $i ###”
fi
;;
esac
done

if test “x${grub_cfg}” != “x” ; then
if ! ${grub_script_check} ${grub_cfg}.new; then
# TRANSLATORS: %s is replaced by filename
gettext_printf “Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
%s file attached.” “${grub_cfg}.new” >&2
echo >&2
exit 1
else
# none of the children aborted with error, install the new grub.cfg
oldumask=$(umask); umask 077
cat ${grub_cfg}.new > ${grub_cfg}
umask $oldumask
rm -f ${grub_cfg}.new
fi
fi

gettext “done” >&2
echo >&2

DON’T touch it! And about the “ro” flag: it is irrelevant to your Nvidia problem.

Ok undestood , so should i try to update my system as it is ?

In spite of all the confusion, the only thing I suggested was that you edit that file (using sudo) and save it exactly as you show it here.

You are off on a tangent when you think the content of that file should be exactly the same as the content of /etc/kernel/cmdline. DO NOT attempt to make those 2 lines match. Using grub2-mkconfig to create a new grub.cfg file as the command above shows handles the changes between the different files.

Sorry for any misunderstanding , as i said as the start i’m new here in linux system and i may not understand exactly your advices . Now , if i understand well , i don’t have anything else to do before trying to update or doi have to do some changes ?

Finally update my system as you advised me and everything went well . i did wait for more than 5 mn before reboot and everything seems to be fine
thanks again

1 Like