Akmods.service take so much time on boot

Its been 2 days my laptop booting take so much time. its always the akmods.service take much time.

systemd-analyze command:

Startup finished in 2.062s (firmware) + 4.268s (loader) + 1.551s (kernel) + 1.970s (initrd) + 3min 43.137s (userspace) = 3min 52.991s graphical.target reached after 3min 43.087s in userspace.

systemd-analyze critical-chain command:

graphical.target @3min 43.087s
└─multi-user.target @3min 43.086s
  └─plymouth-quit-wait.service @4.922s +3min 38.162s
    └─systemd-user-sessions.service @4.874s +28ms
      └─network.target @4.860s
        └─wpa_supplicant.service @4.827s +31ms
          └─basic.target @2.953s
            └─dbus-broker.service @2.891s +56ms
              └─dbus.socket @2.876s
                └─sysinit.target @2.868s
                  └─systemd-vconsole-setup.service @32.282s +1.613s
                    └─systemd-journald.socket
                      └─system.slice
                        └─-.slice

systemctl status akmods

● akmods.service - Builds and install new kmods from akmod packages
     Loaded: loaded (/usr/lib/systemd/system/akmods.service; enabled; preset: enabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: active (exited) since Mon 2024-09-09 09:04:13 WIB; 14min ago
    Process: 875 ExecStart=/usr/sbin/akmods --from-init (code=exited, status=0/SUCCESS)
   Main PID: 875 (code=exited, status=0/SUCCESS)
        CPU: 23min 54.432s

Sep 09 09:00:40 dvd systemd[1]: Starting akmods.service - Builds and install new kmods from akmod packages...
Sep 09 09:00:41 dvd akmods[875]: Checking kmods exist for 6.10.7-200.fc40.x86_64 [  OK  ]
Sep 09 09:00:41 dvd runuser[1156]: pam_unix(runuser:session): session opened for user akmods(uid=973) by (uid=0)
Sep 09 09:04:11 dvd runuser[1156]: pam_unix(runuser:session): session closed for user akmods
Sep 09 09:04:11 dvd akmods[875]: Building and installing nvidia-kmod [FAILED]
Sep 09 09:04:11 dvd akmods[875]: Building rpms failed; see /var/cache/akmods/nvidia/560.35.03-1-for-6.10.7-200.fc40.x86_64.failed.log for details
Sep 09 09:04:11 dvd akmods[875]: Hint: Some kmods were ignored or failed to build or install.
Sep 09 09:04:11 dvd akmods[875]: You can try to rebuild and install them by by calling
Sep 09 09:04:11 dvd akmods[875]: '/usr/sbin/akmods --force' as root.
Sep 09 09:04:13 dvd systemd[1]: Finished akmods.service - Builds and install new kmods from akmod packages.

here the 560.35.03-1-for-6.10.7-200.fc40.x86_64.failed.log file. I pasted it on gist, since it has 10MB size and I dont know where the useful part of the log.

I got this error on booting


Try running sudo akmods --force from the running OS. At quick glance it sounds like akmods is trying to compile something, takes a while, fails, but keeps trying to do it every reboot.

1 Like

still failed. it show error:

❯ sudo akmods --force
[sudo] password for dvdstywn: 
Checking kmods exist for 6.10.7-200.fc40.x86_64 [  OK  ]
Building and installing nvidia-kmod
 [FAILED]
Building rpms failed; see /var/cache/akmods/nvidia/560.35.03-1-for-6.10.7-200.fc40.x86_64.failed.log for details

Hint: Some kmods were ignored or failed to build or install.
You can try to rebuild and install them by by calling
'/usr/sbin/akmods --force' as root.

❯ sudo /usr/sbin/akmods --force
Checking kmods exist for 6.10.7-200.fc40.x86_64 [  OK  ]
Building and installing nvidia-kmod [FAILED]
Building rpms failed; see /var/cache/akmods/nvidia/560.35.03-1-for-6.10.7-200.fc40.x86_64.failed.log for details

Hint: Some kmods were ignored or failed to build or install.
You can try to rebuild and install them by by calling
'/usr/sbin/akmods --force' as root.

here the failed log

It appears that akmods is failing and retries every time you boot.
see /var/cache/akmods/nvidia/560.35.03-1-for-6.10.7-200.fc40.x86_64.failed.log for details is the message of importance since it tells you where the fault is recorded so you can look at the details.

Please post the output of dnf list installed \*nvidia\* and inxi -Fzxx.
Look near the end of the log noted above to see what it tells you the cause may be.

The log file you linked shows this and seems to indicate that there is a missing command (install) on your system. That command (/usr/bin/install) is provided by both the coreutils and the coreutils-single packages.

2024/09/09 10:33:56 akmodsbuild: /tmp/akmodsbuild.gvWEk0nl/BUILD/nvidia-kmod-560.35.03
2024/09/09 10:33:56 akmodsbuild: + RPM_EC=0
2024/09/09 10:33:56 akmodsbuild: ++ jobs -p
2024/09/09 10:33:56 akmodsbuild: + exit 0
2024/09/09 10:33:56 akmodsbuild: Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.iKM9vw
2024/09/09 10:33:56 akmodsbuild: + umask 022
2024/09/09 10:33:56 akmodsbuild: + cd /tmp/akmodsbuild.gvWEk0nl//BUILD
2024/09/09 10:33:56 akmodsbuild: + '[' /tmp/akmodsbuild.gvWEk0nl/BUILDROOT/nvidia-kmod-560.35.03-1.fc40.x86_64 '!=' / ']'
2024/09/09 10:33:56 akmodsbuild: + rm -rf /tmp/akmodsbuild.gvWEk0nl/BUILDROOT/nvidia-kmod-560.35.03-1.fc40.x86_64
2024/09/09 10:33:56 akmodsbuild: ++ dirname /tmp/akmodsbuild.gvWEk0nl/BUILDROOT/nvidia-kmod-560.35.03-1.fc40.x86_64
2024/09/09 10:33:56 akmodsbuild: + mkdir -p /tmp/akmodsbuild.gvWEk0nl/BUILDROOT
2024/09/09 10:33:56 akmodsbuild: + mkdir /tmp/akmodsbuild.gvWEk0nl/BUILDROOT/nvidia-kmod-560.35.03-1.fc40.x86_64
2024/09/09 10:33:56 akmodsbuild: + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '
2024/09/09 10:33:56 akmodsbuild: + export CFLAGS
2024/09/09 10:33:56 akmodsbuild: + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '
2024/09/09 10:33:56 akmodsbuild: + export CXXFLAGS
2024/09/09 10:33:56 akmodsbuild: + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules '
2024/09/09 10:33:56 akmodsbuild: + export FFLAGS
2024/09/09 10:33:56 akmodsbuild: + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules '
2024/09/09 10:33:56 akmodsbuild: + export FCFLAGS
2024/09/09 10:33:56 akmodsbuild: + VALAFLAGS=-g
2024/09/09 10:33:56 akmodsbuild: + export VALAFLAGS
2024/09/09 10:33:56 akmodsbuild: + RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes -Clink-arg=-specs=/usr/lib/rpm/redhat/redhat-package-notes --cap-lints=warn'
2024/09/09 10:33:56 akmodsbuild: + export RUSTFLAGS
2024/09/09 10:33:56 akmodsbuild: + LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes '
2024/09/09 10:33:56 akmodsbuild: + export LDFLAGS
2024/09/09 10:33:56 akmodsbuild: + LT_SYS_LIBRARY_PATH=/usr/lib64:
2024/09/09 10:33:56 akmodsbuild: + export LT_SYS_LIBRARY_PATH
2024/09/09 10:33:56 akmodsbuild: + CC=gcc
2024/09/09 10:33:56 akmodsbuild: + export CC
2024/09/09 10:33:56 akmodsbuild: + CXX=g++
2024/09/09 10:33:56 akmodsbuild: + export CXX
2024/09/09 10:33:56 akmodsbuild: + cd nvidia-kmod-560.35.03
2024/09/09 10:33:56 akmodsbuild: + for kernel_version in 6.10.7-200.fc40.x86_64___/usr/src/kernels/6.10.7-200.fc40.x86_64
2024/09/09 10:33:56 akmodsbuild: + mkdir -p /tmp/akmodsbuild.gvWEk0nl/BUILDROOT/nvidia-kmod-560.35.03-1.fc40.x86_64//lib/modules//6.10.7-200.fc40.x86_64//extra/nvidia//
2024/09/09 10:33:56 akmodsbuild: + install -D -m 0755 _kmod_build_6.10.7-200.fc40.x86_64/nvidia-drm.ko _kmod_build_6.10.7-200.fc40.x86_64/nvidia-modeset.ko _kmod_build_6.10.7-200.fc40.x86_64/nvidia-peermem.ko _kmod_build_6.10.7-200.fc40.x86_64/nvidia-uvm.ko _kmod_build_6.10.7-200.fc40.x86_64/nvidia.ko /tmp/akmodsbuild.gvWEk0nl/BUILDROOT/nvidia-kmod-560.35.03-1.fc40.x86_64//lib/modules//6.10.7-200.fc40.x86_64//extra/nvidia//
2024/09/09 10:33:56 akmodsbuild: /var/tmp/rpm-tmp.iKM9vw: line 53: install: command not found
2024/09/09 10:33:56 akmodsbuild: error: Bad exit status from /var/tmp/rpm-tmp.iKM9vw (%install)
2024/09/09 10:33:56 akmodsbuild: 
2024/09/09 10:33:56 akmodsbuild: RPM build errors:
2024/09/09 10:33:56 akmodsbuild:     Bad exit status from /var/tmp/rpm-tmp.iKM9vw (%install)
2024/09/09 10:33:56 akmodsbuild: 
2024/09/09 10:33:56 akmods: Building rpms failed; see /var/cache/akmods/nvidia/560.35.03-1-for-6.10.7-200.fc40.x86_64.failed.log for details

One quick way that may work around the error might be to remove and reinstall the drivers. or to reinstall the coreutils package

  1. sudo dnf remove \*nvidia\* --exclude nvidia-gpu-firmware
  2. sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda
  3. wait at least 5 minutes after step 3 ends then reboot.

If that fails again for the same reason then check if the file /usr/bin/install exists and if necessary use sudo dnf reinstall coreutils before trying again.

❯ dnf list installed \*nvidia\* 
Installed Packages
akmod-nvidia.x86_64                                            3:560.35.03-1.fc40                       @rpmfusion-nonfree-nvidia-driver
kmod-nvidia-6.1.98-200.fc40.x86_64.x86_64                      3:555.58.02-1.fc40                       @@commandline                   
kmod-nvidia-6.10.5-200.fc40.x86_64.x86_64                      3:555.58.02-1.fc40                       @@commandline                   
kmod-nvidia-6.10.6-200.fc40.x86_64.x86_64                      3:560.35.03-1.fc40                       @@commandline                   
nvidia-gpu-firmware.noarch                                     20240811-2.fc40                          @updates                        
nvidia-modprobe.x86_64                                         3:560.35.03-1.fc40                       @rpmfusion-nonfree-nvidia-driver
nvidia-persistenced.x86_64                                     3:560.35.03-1.fc40                       @rpmfusion-nonfree-nvidia-driver
nvidia-settings.x86_64                                         3:560.35.03-1.fc40                       @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia.x86_64                                     3:560.35.03-3.fc40                       @rpmfusion-nonfree-updates      
xorg-x11-drv-nvidia-cuda.x86_64                                3:560.35.03-3.fc40                       @rpmfusion-nonfree-updates      
xorg-x11-drv-nvidia-cuda-libs.i686                             3:560.35.03-3.fc40                       @rpmfusion-nonfree-updates      
xorg-x11-drv-nvidia-cuda-libs.x86_64                           3:560.35.03-3.fc40                       @rpmfusion-nonfree-updates      
xorg-x11-drv-nvidia-kmodsrc.x86_64                             3:560.35.03-3.fc40                       @rpmfusion-nonfree-updates      
xorg-x11-drv-nvidia-libs.i686                                  3:560.35.03-3.fc40                       @rpmfusion-nonfree-updates      
xorg-x11-drv-nvidia-libs.x86_64                                3:560.35.03-3.fc40                       @rpmfusion-nonfree-updates      
xorg-x11-drv-nvidia-power.x86_64                               3:560.35.03-3.fc40                       @rpmfusion-nonfree-updates      
❯ inxi -Fzxx
System:
  Kernel: 6.10.7-200.fc40.x86_64 arch: x86_64 bits: 64 compiler: gcc
    v: 2.41-37.fc40
  Desktop: GNOME v: 46.4 tk: GTK v: 3.24.43 wm: gnome-shell dm: GDM
    Distro: Fedora Linux 40 (Workstation Edition)
Machine:
  Type: Laptop System: ASUSTeK product: VivoBook_ASUSLaptop X412FL_A412FL
    v: 1.0 serial: <superuser required>
  Mobo: ASUSTeK model: X412FL v: 1.0 serial: <superuser required>
    UEFI: American Megatrends v: X412FL.308 date: 12/25/2020
Battery:
  ID-1: BAT0 charge: 13.0 Wh (58.6%) condition: 22.2/37.1 Wh (59.8%)
    volts: 7.8 min: 7.8 model: ASUSTeK ASUS Battery serial: N/A
    status: not charging
  Device-1: hidpp_battery_0 model: Logitech Wireless Mouse B330/M330/M331
    serial: <filter> charge: 55% (should be ignored) status: discharging
CPU:
  Info: quad core model: Intel Core i7-8565U bits: 64 type: MT MCP
    arch: Whiskey Lake rev: B cache: L1: 256 KiB L2: 1024 KiB L3: 8 MiB
  Speed (MHz): avg: 712 high: 900 min/max: 400/4600 cores: 1: 900 2: 900
    3: 400 4: 900 5: 900 6: 900 7: 400 8: 400 bogomips: 31999
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: Intel WhiskeyLake-U GT2 [UHD Graphics 620] vendor: ASUSTeK
    driver: i915 v: kernel arch: Gen-9.5 ports: active: eDP-1 empty: HDMI-A-1
    bus-ID: 00:02.0 chip-ID: 8086:3ea0
  Device-2: NVIDIA GP108M [GeForce MX250] vendor: ASUSTeK driver: N/A
    arch: Pascal pcie: speed: 8 GT/s lanes: 4 bus-ID: 02:00.0 chip-ID: 10de:1d13
  Device-3: IMC Networks USB2.0 HD UVC WebCam driver: uvcvideo type: USB
    rev: 2.0 speed: 480 Mb/s lanes: 1 bus-ID: 1-5:5 chip-ID: 13d3:56dc
  Display: wayland server: X.org v: 1.20.14 with: Xwayland v: 24.1.2
    compositor: gnome-shell driver: X: loaded: modesetting,nvidia
    alternate: fbdev,nouveau,nv,vesa dri: iris gpu: i915 display-ID: 0
  Monitor-1: eDP-1 model: BOE Display 0x07c9 res: 1920x1080 dpi: 163
    diag: 345mm (13.6")
  API: OpenGL v: 4.6 vendor: intel mesa v: 24.1.7 glx-v: 1.4 es-v: 3.2
    direct-render: yes renderer: Mesa Intel UHD Graphics 620 (WHL GT2)
    device-ID: 8086:3ea0 display-ID: :0.0
  API: EGL Message: EGL data requires eglinfo. Check --recommends.
Audio:
  Device-1: Intel Cannon Point-LP High Definition Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel bus-ID: 00:1f.3 chip-ID: 8086:9dc8
  API: ALSA v: k6.10.7-200.fc40.x86_64 status: kernel-api
  Server-1: JACK v: 1.9.22 status: off
  Server-2: PipeWire v: 1.0.7 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
Network:
  Device-1: Intel Cannon Point-LP CNVi [Wireless-AC] driver: iwlwifi v: kernel
    bus-ID: 00:14.3 chip-ID: 8086:9df0
  IF: wlo1 state: up mac: <filter>
  IF-ID-1: tailscale0 state: unknown speed: -1 duplex: full mac: N/A
Bluetooth:
  Device-1: Intel Bluetooth 9460/9560 Jefferson Peak (JfP) driver: btusb
    v: 0.8 type: USB rev: 2.0 speed: 12 Mb/s lanes: 1 bus-ID: 1-10:6
    chip-ID: 8087:0aaa
  Report: btmgmt ID: hci0 rfk-id: 0 state: down bt-service: enabled,running
    rfk-block: hardware: no software: yes address: <filter> bt-v: 5.1 lmp-v: 10
Drives:
  Local Storage: total: 476.94 GiB used: 29.08 GiB (6.1%)
  ID-1: /dev/nvme0n1 vendor: Intel model: SSDPEKNW512G8 size: 476.94 GiB
    speed: 31.6 Gb/s lanes: 4 serial: <filter> temp: 52.9 C
Partition:
  ID-1: / size: 48.91 GiB used: 16.63 GiB (34.0%) fs: ext4 dev: /dev/nvme0n1p1
  ID-2: /boot/efi size: 99.8 MiB used: 38 MiB (38.1%) fs: vfat
    dev: /dev/nvme0n1p2
  ID-3: /home size: 172.17 GiB used: 11 GiB (6.4%) fs: ext4
    dev: /dev/nvme0n1p4
Swap:
  ID-1: swap-1 type: zram size: 7.6 GiB used: 0 KiB (0.0%) priority: 100
    dev: /dev/zram0
  ID-2: swap-2 type: partition size: 2.05 GiB used: 0 KiB (0.0%)
    priority: -2 dev: /dev/nvme0n1p3
Sensors:
  System Temperatures: cpu: 70.0 C pch: 61.0 C mobo: N/A
  Fan Speeds (rpm): cpu: 3400
Info:
  Memory: total: 8 GiB available: 7.6 GiB used: 4.58 GiB (60.2%)
  Processes: 298 Power: uptime: 1h 8m wakeups: 0 Init: systemd v: 255
    target: graphical (5) default: graphical
  Packages: pm: flatpak pkgs: 23 Compilers: gcc: 14.2.1 Shell: Zsh v: 5.9
    running-in: kitty inxi: 3.3.34

Please add dnf list installed kernel to that output.
I see this which is very strange on fedora 40

f40 has never had a 6.1.98 kernel unless you chose to install a 3rd party kernel.

I think that kernel from nvidia proprietary driver I installed 1st time I try fedora. this my 1st time use linux haha.

kernel.x86_64                                                  6.10.5-200.fc40                                                  @updates
kernel.x86_64                                                  6.10.6-200.fc40                                                  @updates
kernel.x86_64                                                  6.10.7-200.fc40                                                  @updates

I think this solve my problem. I install coreutils and do sudo akmods --force. it show output like this. I think akmods installed successfuly, will reboot my PC and update it here.

Checking kmods exist for 6.10.7-200.fc40.x86_64 [  OK  ]
Building and installing nvidia-kmod [  OK  ]

OK, all good! I will mark that as Solution. Thanks alot! :smile:

❯ systemd-analyze 
Startup finished in 1.327s (firmware) + 2.334s (loader) + 1.341s (kernel) + 1.659s (initrd) + 10.312s (userspace) = 16.974s 
graphical.target reached after 8.357s in userspace.
1 Like

Some users tend to believe that they should remove a lot of things they think is not needed and when doing so it has the potential to break other things in the system.

Using dnf list installed kmod-nvidia-* would show if the package was properly installed for the 6.10.7 kernel.

I believe I never uninstall pre-installed software like coreutils. I only uninstalled app shown up on Gnome software.

I tried dnf list installed kmod-nvidia-*, it show output:
zsh: no matches found: kmod-nvidia-*

Do quote the wildcard like

dnf list installed 'kmod-nvidia-*'

Otherwise the shell will look for files starting with “kmod-nvidia” in the current directory.