Fedora 40 on Asus Laptop

Fedora 40 on Asus Laptop

I own an Asus Tuf Dash F15 which I dual bual boot with Windows and Fedora. I am going to document the steps to install Fedora with Nvidia drivers, secureboot enabled and working Asus features. This might work for ROG laptops as well but mileage might vary. Pre-requisites are you need to have Windows installed beforehand and create a free partition. I normally do 400GB for Windows and 100GB for Linux but it is up to you.

  1. Prepare Fedora USB
    Download Fedora Workstation and Rufus and prepare a usb.
  2. Configure BIOS
    Reboot into the BIOS by tapping F2 repeatedly. Set boot priority such that USB is first. Go into advanced (F7), select the security tab and go to secueboot. Ensure Secure Boot Control is enabled. Next go to key management and select reset to setup mode. You will get a new option to restore factory keys. Select that and save & reboot.
  3. Install Fedora
    This should be straight forward. Configure as per your needs. I prefer to encrypt my linux partion.
  4. First Boot
    Update your system. I remove some default applications which I dont use.
# Optional
sudo dnf remove firefox gnome-maps gnome-contacts gnome-tour simple-scan
sudo dnf update -y

# Again Optional
sudo dnf install vim google-chrome-stable

 # Installing rpmfusion repositories
sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

# Firmware update
sudo fwupdmgr get-devices 
sudo fwupdmgr refresh --force 
sudo fwupdmgr get-updates 
sudo fwupdmgr update

# Media Codec
sudo dnf groupupdate 'core' 'multimedia' 'sound-and-video' --setopt='install_weak_deps=False' --exclude='PackageKit-gstreamer-plugin' --allowerasing && sync
sudo dnf swap 'ffmpeg-free' 'ffmpeg' --allowerasing
sudo dnf install gstreamer1-plugins-{bad-\*,good-\*,base} gstreamer1-plugin-openh264 gstreamer1-libav --exclude=gstreamer1-plugins-bad-free-devel ffmpeg gstreamer-ffmpeg
sudo dnf install lame\* --exclude=lame-devel
sudo dnf group upgrade --with-optional Multimedia

# H/W video decoding
sudo dnf install ffmpeg ffmpeg-libs libva libva-utils

# Intel chipset 5th gen and above
sudo dnf swap libva-intel-media-driver intel-media-driver --allowerasing

# Open H264
sudo dnf config-manager --set-enabled fedora-cisco-openh264
sudo dnf install -y openh264 gstreamer1-plugin-openh264

# If you use firefox get this
sudo dnf install mozilla-openh264

# Set your hostname
hostnamectl set-hostname YOUR_HOSTNAME

# Counter time inconsistency in dual boot systems
sudo timedatectl set-local-rtc '0'

sudo reboot now #reboot the system
  1. Nvidia
# Install self signing tools
sudo dnf install kmodtool akmods mokutil openssl

# Generate key
sudo kmodgenca -a

# Kernel will trust drivers signed with this key
sudo mokutil --import /etc/pki/akmods/certs/public_key.der
# You will need to set a password.
# IMPORTANT - If this step fails, you will need to go
# into BIOS key management, do reset to setup mode and 
# restore factory keys again. Reboot and retry the command.

sudo reboot

After reboot you will see the MOK Manager interface. First select Enroll MOK, then "Continue". Finally hit Yes and enter the password you set duing mokutil --import.

sudo dnf install kernel-devel
sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda

# Enable Nvidia power services
sudo systemctl enable nvidia-hibernate.service nvidia-suspend.service nvidia-resume.service nvidia-powerd.service

After installation wait for 5-10 min for the kmod to be build. You can track using system monitor, you will notice high cpu utilization. Reboot only when the cpu usage spike goes down.

  1. Install asusctl and supergfxctl
# Enable copr repository
sudo dnf copr enable lukenukem/asus-linux
sudo dnf update

sudo dnf install asusctl supergfxctl
sudo systemctl enable supergfxd.service
sudo dnf install asusctl-rog-gui

# Hide unnecessary boot message
sudo systemctl mask nvidia-fallback.service
  1. Optional steps
    Refer 'Switching from Nvidia GPU to AMD Integrated' in this guide to switch between Nvidia and Integrated without requiring a reboot.

This works file for 2022 and earlier laptops. For 2023 and newer model you might need to install a custom kernel. For the same refer 'Use custom kernel' in ths guide.

Guide adapted from:
Monosoul's dev blog
Asus-linux
devangshekhawat github