Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] First install on AMD PC stuck at Loading Linux
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
LemonadeLlama
Tux's lil' helper
Tux's lil' helper


Joined: 26 May 2021
Posts: 101
Location: New Zealand

PostPosted: Wed Jan 04, 2023 11:51 pm    Post subject: [SOLVED] First install on AMD PC stuck at Loading Linux Reply with quote

Hello everyone. I recently build a new PC, and I'm trying to install Gentoo on it. I've installed Gentoo on my old PC before, but this new PC has an AMD GPU instead of an nvidia GPU.

I stepped through the installation process, but when I tried booting into Gentoo for the first time, I got stuck on the "Loading Linux" screen. I suspect this is to do with my GPU configuration, since that's what changed for me between PCs. Picture of my screen

A lot of what I see online says to enable some kind of frame buffer, which I believe I've done, but it hasn't fixed the issue.

My GPU is an AMD 7900 XT, which is one of AMDs two newest GPUs. It's been less than a month since they were released, so that could also be playing into it, but my understanding is that the firmware for this GPU is in the kernel source already.

My make.conf:
Code:

# This file is used by Portage to customise your packages.
# Check the manual page for make.conf or the gentoo wiki for more flags.

# These flags are used by your PC's C, C++, and Fortran compilers.
# In this file, all these compilers will use the same flags.
# --march=native will compile all packages for your PC's architecture,
#    ensuring nothing is ever cross-compiled.
# -O2 means our compiler will try and optimise code during compilation.
#    It's not recommended to go to -O3 for all packages, so we'll go
#    with the -O2.
# -pipe dictates how different stages of compilation communicate.
#    -pipe means use pipes instead of temporary files.
COMMON_FLAGS="-march=native -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"

# Defines additional software licenses for us to use.
# I am trying to use more FOSS software, so I only want to packages that Gentoo considers free software.
# The '-*' means 'only use the following licenses'
# Even if this causes problems, I can add exceptions for problematic packages.
ACCEPT_LICENSE="-* @FREE"

# Recent packages are on 'testing' branches. This variable sets the testing branch we'll use for packages.
ACCEPT_KEYWORDS="~amd64"

# Changes Portage's default behaviour
# * fail-clean: Clean temporary directories after a build failure
FEATURES="fail-clean"

# Stores where ebuild logs are kept.
PORTAGE_LOGDIR="/var/log/ebuild-logs"

# MAKEOPTS determines how many parallel compilations should occur when
# installing a package. It's usually not worth making this higher than the
# number of available CPUs.
# For example, I am using an AMD 7950X, which has 16 cores and 2 threads per core, for a toral of 32 available processes.
# -j is the number of processes to run in parallel.
# -l is the maximum allowed load average, which should be about j*0.9
MAKEOPTS="-j32 -l28.8"
# Similar story with this one
EMERGE_DEFAULT_OPTS="${EMERGE_DEFAULT_OPTS} --jobs=32 --load-average=28.8"

# This is used to tell Portage what graphics card you are using (if any).
# Your choices are:
# * 'amdgpu radeonsi' for newer open-source amd drivers
# * 'intel' for intel graphics drivers
# * 'nouveau' for the open-source nvidia drivers
# * 'nvidia' for the proprietary nvidia drivers
# * 'radeon radeonsi' for older open-source amd drivers
VIDEO_CARDS="amdgpu radeonsi"

# This is used to tell Portage what we use to control our PC.
# libinput is for mice and keyboards.
INPUT_DEVICES="libinput"

# Tells the system which version of GRUB to install.
GRUB_PLATFORMS="efi-64"

# Sets the language of the build output to English
LC_MESSAGES=C

# Portage uses the USE variable to determine the default way to build
# a package. You can add/remove flags using the USE variable in this file.
# NOTE: This does not overwrite the value of USE that Portage uses, it only
# appends to it! It also applies to ALL packages you build, so only
# put a flag here if you want it to apply system-wide!
#  alsa:       Add support for the advanced linux sound architecture.
#  elogind:    Build packages that normally require logind from systemd.
#  examples:   Download code examples where applicable.
#  ffmpeg:     Enable certain kinds of audio/video codec support.
#  ipv6 :      Add support for ipv6.
#  multilib:   Allow compilation of 32-bit binaries.
#  opengl:     Add support for openGL graphics.
#  pulseaudio: Add support for PulseAudio.
#  xinerama:   Add support for querying multi-monitor screen geometry.
#  udev:       Enable virtual/udev integration.
#  vulkan:     Build in Vulkan driver support.
#  wayland:    Add support for Wayland.
#  X:          Add support for X11.
#  -emacs:     Don't add support for emacs.
#  -gnome:     Don't add GNOME support.
#  -kde:       Don't use KDE software.
#  -systemd:   Don't use systemd-specific libraries.
#  -wifi:      Don't enable wifi functionality.
USE="alsa elogind examples ffmpeg ipv6 multilib opengl pulseaudio udev vulkan xinerama wayland X -emacs -gnome -kde -systemd -wifi"


My world file:
Code:
app-admin/sudo
app-admin/sysklogd
app-editors/vim
dev-libs/rocm-opencl-runtime
media-libs/mesa
net-misc/dhcp
net-misc/netifrc
net-misc/ntp
sys-apps/mlocate
sys-apps/pciutils
sys-boot/grub:2
sys-fs/dosfstools
sys-kernel/gentoo-sources
sys-process/cronie


My fstab:
Code:
UUID=27F0-AE02                            /boot vfat defaults,noatime 0 2
UUID=50ffc13d-4552-4ab6-90c2-bb94e777f99a none  swap sw               0 0
UUID=ad73fcf5-5f09-4623-a8aa-360f340b8272 /     ext4 noatime          0 1
UUID=8eb1396f-015b-46e0-8ad8-8c5c26d67191 /home ext4 noatime          0 1
UUID=e1b2635b-4aee-441a-8cd9-7637396a68f3 /bulk ext4 noatime          0 1


In my kernel, I have enabled the AMD GPU driver as a module, so I understand that I don't need to manually specify any firmware in the firmware loader section. I have also only enabled certain framebuffer options. Here's a snippet, but if you want more kernel configuration, I can get it for you.
Code:

# CONFIG_DRM_AMD_RADEON is not set
CONFIG_DRM_AMDGPU=m
# CONFIG_DRM_AMDGPU_SI is not set
# CONFIG_DRM_AMDGPU_CIK is not set
CONFIG_DRM_AMDGPU_USERPTR=y

# Frame buffer Devices (only enabled options shown. non-shown options are disabled)
CONFIG_FB_CMDLINE=y
CONFIG_DB_NOTIFY=y
CONFIG_FB=y
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
CONFIG_FB_SYS_FILLRECT=y
CONFIG_FB_SYS_COPYAREA=y
CONFIG_FB_SYS_IMAGEBLIT=y
CONFIG_FB_SYS_FOPS=y
CONFIG_FB_DEFERRED=y

# Frame buffer hardware drivers (only enabled options are shown. non-options are disabled)
CONFIG_FB_EFI=y



Any help is much appreciated.


Last edited by LemonadeLlama on Thu Jan 05, 2023 6:06 am; edited 1 time in total
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1681

PostPosted: Thu Jan 05, 2023 12:54 am    Post subject: Reply with quote

LemonadeLlama wrote:

My world file:
Code:
app-admin/sudo
app-admin/sysklogd
app-editors/vim
dev-libs/rocm-opencl-runtime
media-libs/mesa
net-misc/dhcp
net-misc/netifrc
net-misc/ntp
sys-apps/mlocate
sys-apps/pciutils
sys-boot/grub:2
sys-fs/dosfstools
sys-kernel/gentoo-sources
sys-process/cronie

Any help is much appreciated.


No sign of sys-kernel/linux-firmware being installed which is required to exist on disk for AMDGPU to work.
Back to top
View user's profile Send private message
LemonadeLlama
Tux's lil' helper
Tux's lil' helper


Joined: 26 May 2021
Posts: 101
Location: New Zealand

PostPosted: Thu Jan 05, 2023 1:09 am    Post subject: Reply with quote

grknight wrote:
No sign of sys-kernel/linux-firmware being installed which is required to exist on disk for AMDGPU to work.


I installing the linux-firmware package and rebooted, but I am still stuck on the loading screen.

I then tried doing a clean kernel build afterwards, installing the newly built kernel, and restarting. That still left me stuck.
Back to top
View user's profile Send private message
jburns
Veteran
Veteran


Joined: 18 Jan 2007
Posts: 1214
Location: Massachusetts USA

PostPosted: Thu Jan 05, 2023 1:11 am    Post subject: Reply with quote

Do you have
Code:
CONFIG_FRAMEBUFFER_CONSOLE=y
Back to top
View user's profile Send private message
LemonadeLlama
Tux's lil' helper
Tux's lil' helper


Joined: 26 May 2021
Posts: 101
Location: New Zealand

PostPosted: Thu Jan 05, 2023 1:45 am    Post subject: Reply with quote

jburns wrote:
Do you have
Code:
CONFIG_FRAMEBUFFER_CONSOLE=y


I do. It hasn't helped. Here's all the fframebuffer options in my config:
Code:

(none) /usr/src/linux # grep FRAMEBUFFER .config
CONFIG_FRAMEBUFFER_CONSOLE=y
# CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION is not set
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
# CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER is not set
Back to top
View user's profile Send private message
psycho
Guru
Guru


Joined: 22 Jun 2007
Posts: 534
Location: New Zealand

PostPosted: Thu Jan 05, 2023 2:10 am    Post subject: Reply with quote

Hi LemonadeLlama.

What's in /boot/grub/grub.cfg or whatever you're using to boot up? Even if your kernel and the rest of your OS is perfectly configured, a bad option in your kernel boot line can still screw up the boot. Booting a working (e.g. the Gentoo installer's) kernel and then maybe
Code:
cat /proc/cmdline
might be a helpful first step in eliminating the possibility that it's not a kernel configuration issue at all... and it also gives you the opportunity to examine e.g.
Code:
dmesg | grep -i firmware

so you can go back and confirm (in your non-booting kernel setup) that you've installed the necessary firmware (and you can browse through lsmod in case you spot something else that's a new requirement on your new system). Sometimes the quickest way to spot what's wrong with a broken setup is to compare it alongside a working one.
Back to top
View user's profile Send private message
LemonadeLlama
Tux's lil' helper
Tux's lil' helper


Joined: 26 May 2021
Posts: 101
Location: New Zealand

PostPosted: Thu Jan 05, 2023 2:21 am    Post subject: Reply with quote

Do you mean I should install gentoo-kernel? I've never tried that before, but at least it'll give me a good starting point.

In addition to differences in the kernel configs between mine and gentoo-kernel, and what you've suggested, what should I look for to diagnose my configuration issues?
Back to top
View user's profile Send private message
psycho
Guru
Guru


Joined: 22 Jun 2007
Posts: 534
Location: New Zealand

PostPosted: Thu Jan 05, 2023 2:59 am    Post subject: Reply with quote

Well, if you've run out of ideas you could simply copy the working kernel's framebuffer options, every useless-looking one of them, and see if your own kernel works with those. If it does you've at least narrowed things down to those config options, and can start customizing them a few at a time (making the most obvious-looking changes first, testing to confirm they work, then making a few more changes and so on and so on until you hit the one that causes the boot to hang). Kernel configuration isn't straightforward because options in different kernel areas can be related in non-obvious ways (you can be faced with different options in one driver menu because of something you selected or failed to select in some other menu): usually you can figure stuff out quickly from the config help and/or the handbook/wiki/etc., but if not, a systematic approach of editing a working config towards your own one in stages is a bit tedious but it gets you there in the end.
Back to top
View user's profile Send private message
LemonadeLlama
Tux's lil' helper
Tux's lil' helper


Joined: 26 May 2021
Posts: 101
Location: New Zealand

PostPosted: Thu Jan 05, 2023 5:18 am    Post subject: Reply with quote

Okay, so installing gentoo-kernel has gotten me to a console at least. I can continue installation from there. One difference I noticed is that the gentoo-kernel configuration sets up an initial ramdisk (a message that says something like 'Loading initial ramdisk' appears on boot), where as my configuration never showed that. I understand that this is optional though, according to the wiki. I'll look more into it during my troubleshooting.

For now, I'm investigating a different issue. I can boot into a terminal now, but on boot, I see a message that says my interface 'does not exist'. There's a log message that says Ensure that you have loaded the correct kernel module for your hardware.

For now, I'm trying to install the kitty terminal, but I can't seem to install media-gfx/graphite or media-gfx/librsync. Both of these use the ninja build system and I can't seem to get it to work. I keep getting error messages like this:
Code:
ninja: error: mainfest 'build.ninja' still dirty after 100 tries, perhaps system time is not set
 * ERROR: media-gfx/graphite2-1.3.14_p20210810-r2::gentoo failed (compile phase):
 *   ninja -v -j32 -l28.8


This error doesn't go away even after rebooting the system or manually triggering an NTP update, so it's preventing me from installing Kitty. Do I have to manually set the time with the date command or something?
Back to top
View user's profile Send private message
psycho
Guru
Guru


Joined: 22 Jun 2007
Posts: 534
Location: New Zealand

PostPosted: Thu Jan 05, 2023 5:48 am    Post subject: Reply with quote

Even for setting the date manually, ntp is better. You can use ntpdate (i.e. type ntpdate [address of ntp server], so ntpdate ntp.whatever.com)... it's basically setting the date manually but getting the exact time via ntp instead of typing it in.

Yes, you could continue your installation using the prebuilt Gentoo kernel, although I wasn't recommending that: I just meant use the working kernel's configuration as a model to inform your own kernel's configuration. Yes, you're right that initramfs is unnecessary: I'm not using one. It is necessary if you're wanting a boot splash like plymouth, but if you're happy watching the console messages you can just boot your kernel directly.
Back to top
View user's profile Send private message
LemonadeLlama
Tux's lil' helper
Tux's lil' helper


Joined: 26 May 2021
Posts: 101
Location: New Zealand

PostPosted: Thu Jan 05, 2023 6:05 am    Post subject: Reply with quote

I think I'll close this thread. I've got a booting system, so that solves my initial issue. I'll open up a new thread for the ninja build issues. Thanks for your help, everyone.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum