LukeSmithxyz / LARBS

Luke's Auto-Rice Bootstrapping Scripts: Installation Scripts for My Arch Linux Meta-Distribution
GNU General Public License v3.0
2.02k stars 797 forks source link

Issues with Larbs Installation: Screen Resolution, Brightness Adjustment, and Nvidia Driver Installation #554

Open PabloMartinMoreno opened 3 months ago

PabloMartinMoreno commented 3 months ago

I just installed larbs and I'm having the following problems:

1) The screen resolution is incorrect, and I can't seem to correct it. To prevent it from being too small, I modified 'xrandr dpi' and the font size in 'xresources,' but applications still appear extremely small. I would like to know where I can modify the resolution.

2) I can't adjust the screen brightness up or down.

3) I can't install Nvidia drivers.

emrakyz commented 3 months ago

Your problems are not descriptive enough so it's extremely hard to help. "I can't do foo" doesn't provide enough information for the person who wants to help.

  1. In order to change resolution on X with Nvidia GPUs, you need Nvidia drivers and/or you need xrandr. On Wayland, it's possible to do it within DWL or with wlrandr but on X, you definitely need drivers' tools.
  2. This is also related with Nvidia drivers. Specifically check "2.3. 4. Enabling brightness control" from the below link.
  3. https://wiki.archlinux.org/title/NVIDIA
PabloMartinMoreno commented 3 months ago

Your problems are not descriptive enough so it's extremely hard to help. "I can't do foo" doesn't provide enough information for the person who wants to help.

1. In order to change resolution on X with Nvidia GPUs, you need Nvidia drivers and/or you need xrandr. On Wayland, it's possible to do it within DWL or with wlrandr but on X, you definitely need drivers' tools.

2. This is also related with Nvidia drivers. Specifically check **"2.3. 4. Enabling brightness control"** from the below link.

3. https://wiki.archlinux.org/title/NVIDIA

First of all, although I'm not sure if it makes a difference, I'll mention that I have UEFI boot. Of the Nvidia cards listed on that page, mine isn't there. I hadn't had any issues installing it on an Arch system with Wayland before. My card is a NVIDIA Corporation TU117M [GeForce MX450].

The Nvidia package installs fine, but when adding it to the hook in /etc/mkinitcpio.conf, it gives an error: "Hook 'nvidia' cannot be found."

I wouldn't know what else to detail, really.

PabloMartinMoreno commented 3 months ago

I found someone on this blog with the same graphics card but a different GPU. I've been trying to do the same thing as them but haven't found a solution yet.

https://bbs.archlinux.org/viewtopic.php?id=272613

Does anyone understand what I should put in my case?

Their configuration is as follows:

Section "OutputClass"
    Identifier "intel"
    MatchDriver "i915"
    Driver "modesetting"
EndSection

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    Option "PrimaryGPU" "yes"
    ModulePath "/usr/lib/nvidia/xorg"
    ModulePath "/usr/lib/xorg/modules"
EndSection

For the first part, I should put mine, but I can't figure it out. In my case, my GPU is as follows:

05:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Lucienne (rev c2)
        Subsystem: ASUSTeK Computer Inc. Lucienne
        Kernel driver in use: amdgpu

I put "amdgpu" in MatchDriver, while in Identifier I put "AMD".

"If anyone comes up with a solution, I would greatly appreciate it. I'm losing a lot of time for studying and working."

emrakyz commented 3 months ago

I have never ever set anything on /etc/X11/xorg.conf when I used to use X.

As far as I know, manually editing this file was even deprecated 10 years ago.

mkinitcpio is about initramfs. You don't even need this for Nvidia drivers to work. Initramfs is useful when you want to load things before the booting process.

Let me give you another example:

On Gentoo & Wayland, I have a very minimal, customized kernel without external modules, without initramfs or anything. It just produces one small binary (3mb) when I compile it and I copy the compiled binary to my boot partition. Then it is detected by UEFI bootloader automatically without even having to use a bootloader (this requires EFISTUB enabled on kernel).

But, in order to start a graphical session with Nvidia GPU on this case, firstly, you need Nvidia drivers. This is provided as a package on distros. Then you need to start 4 different modules. Normally Arch Linux packages should either do this automatically for mkinitcpio or they create an external file to start those modules at boot. This doesn't happen on your case, most probably because of the complexity behind double GPU laptop setups. This is known as problematic.

On my case, since I don't have an initramfs, I start those Nvidia modules at boot manually.

mkdir -p "/etc/modules-load.d"

{
        echo "nvidia"
        echo "nvidia_modeset"
        echo "nvidia_uvm"
        echo "nvidia_drm"
} > "/etc/modules-load.d/video.conf"

With this way, you use either EFI Framebuffer drivers or built-in AMD kernel drivers while booting, and after booting, your nvidia modules are loaded and are ready to start a session.

At the same time I set some settings on /etc/modprobe.d/nvidia.conf

options nvidia-drm modeset=1
options nvidia NVreg_UsePageAttributeTable=1

According to Arch Linux wiki, nvidia_drm.modeset=1 modeset=1 settings should also be on the CONFIG_CMDLINE kernel parameters. If you don't manually build your kernel then you should probably put these on your GRUB commandline.

Your problems are mostly because of your dual GPU setup. I hope these help to some extent.

PabloMartinMoreno commented 3 months ago

I have never ever set anything on /etc/X11/xorg.conf when I used to use X.

As far as I know, manually editing this file was even deprecated 10 years ago.

mkinitcpio is about initramfs. You don't even need this for Nvidia drivers to work. Initramfs is useful when you want to load things before the booting process.

Let me give you another example:

On Gentoo & Wayland, I have a very minimal, customized kernel without external modules, without initramfs or anything. It just produces one small binary (3mb) when I compile it and I copy the compiled binary to my boot partition. Then it is detected by UEFI bootloader automatically without even having to use a bootloader (this requires EFISTUB enabled on kernel).

But, in order to start a graphical session with Nvidia GPU on this case, firstly, you need Nvidia drivers. This is provided as a package on distros. Then you need to start 4 different modules. Normally Arch Linux packages should either do this automatically for mkinitcpio or they create an external file to start those modules at boot. This doesn't happen on your case, most probably because of the complexity behind double GPU laptop setups. This is known as problematic.

On my case, since I don't have an initramfs, I start those Nvidia modules at boot manually.

mkdir -p "/etc/modules-load.d"

{
        echo "nvidia"
        echo "nvidia_modeset"
        echo "nvidia_uvm"
        echo "nvidia_drm"
} > "/etc/modules-load.d/video.conf"

With this way, you use either EFI Framebuffer drivers or built-in AMD kernel drivers while booting, and after booting, your nvidia modules are loaded and are ready to start a session.

At the same time I set some settings on /etc/modprobe.d/nvidia.conf

options nvidia-drm modeset=1
options nvidia NVreg_UsePageAttributeTable=1

According to Arch Linux wiki, nvidia_drm.modeset=1 modeset=1 settings should also be on the CONFIG_CMDLINE kernel parameters. If you don't manually build your kernel then you should probably put these on your GRUB commandline.

Your problems are mostly because of your dual GPU setup. I hope these help to some extent.

Thank you for your response. I tried downloading the driver directly from the Nvidia website, but it fails during the Initramfs configuration stage.

On the other hand, Mkinitcpio gives an error when I add Nvidia to the hooks; it seems not to recognize the packages I have installed. When I install nvidia, nvidia-utils, and nvidia-settings, I encounter the following error:

Creating zstd-compressed initcpio image: '/boot/initramfs-linux-fallback.img'
==> WARNING: errors were encountered during the build. The image may not be complete.
error: command failed to execute correctly

pic-full-240314-1023-02

PabloMartinMoreno commented 3 months ago

Update.

I would think it's recognizing the video card, however, I still can't adjust the brightness up and down from the keyboard, and I still have the issue of not being able to adapt the screen size of the applications. However, it does let me adjust the brightness from keyboard commands.

pic-full-240316-2354-34