You are not logged in.

#1 2021-12-27 20:05:19

ichosethisname
Member
Registered: 2021-12-27
Posts: 2

[SOLVED] Trouble getting NVIDIA card to work with xinit on laptop

Hello, I'm a new Arch user, and I've been trying for the past few days to get my NVIDIA GTX 1060 Mobile graphics card to run on my laptop (Acer Predator Helios 300 G3-571). My laptop has integrated graphics (Intel HD Graphics 630), which seems to work pretty fine, but I have been really wanting to get the other xserver to run on the other graphics card. But when I force xinit to use the NVIDIA card, the screen freezes when I run "xstart". In the log, I see the following message:

[    99.265] (--) NVIDIA(1): No enabled display devices found; starting anyway because
[    99.265] (--) NVIDIA(1):     AllowEmptyInitialConfiguration is enabled
[    99.265] (II) NVIDIA(1): Validated MetaModes:
[    99.265] (II) NVIDIA(1):     "NULL"
[    99.265] (II) NVIDIA(1): Virtual screen size determined to be 640 x 480
[    99.265] (WW) NVIDIA(1): Unable to get display device for DPI computation.
[    99.265] (==) NVIDIA(1): DPI set to (75, 75); computed from built-in default

This is the only obvious error I can find here, and I think it means what it says, that somehow the NVIDIA driver cannot find my monitor.
Another thing to note is that input still works here. My .xinitrc file launches i3wm, and even with the frozen screen I can do Alt+Enter then type 'pkill xinit', which causes the screen to unfreeze since I kill the xserver.
I think the fact that the NVIDIA driver/card was detected here means that the problem is not with choosing the Intel driver over the NVIDIA one. I have been trying a bunch of things from the archlinux wiki's NVIDIA and NVIDIA troubleshooting pages, although I don't think my exact issue is anywhere on there, and instead I've been assuming my issue is similar to "X11 chooses the wrong device" or "X11 start has a black screen" even though neither is a fully accurate description. Searching up online, I cannot seem to find other users with the exact same problem, since most people with a similar issue are running things like "Optimus" and use like an optimus manager to fix it. A lot of others have the "(EE) no screens found" error, which I've caused by messing with xorg config files too much, but I'm pretty sure it's a completely different issue.
I may just be too much of an Arch Linux noob to understand the issue here, so I've come for help. Here is a bunch of other info I've gathered in advance:

lshw.txt - output from lshw -a
grubcfg-src.txt - used with grub-mkconfig to make my grub configuration for dual boot with Windows
mkinitcpio-custom.conf - tried using this to load nvidia drivers at startup
20-nvidia.conf - generated from nvidia-xconfig, although the import part (specifying the graphics card) seems identical to what I would manually configure
X11-crash-log.txt - the full log from startx above (/var/log/xorg.0.log) when it freezes due to forcing the NVIDIA card

# uname -a
Linux Isaac-Linux 5.15.11-arch2-1 #1 SMP PREEMPT Wed, 22 Dec 2021 09:23:54 +0000 x86_64 GNU/Linux

To disable my integrated graphics, I have:
In /etc/modprobe.d/blacklist.conf:
install i915 /usr/bin/false
install intel_agp /usr/bin/false

One small thing from the wiki I tried:
In /etc/modprobe.d/modprobe.conf:
options nvidia NVreg_Mobile=3

Showing my NVIDIA drivers I'm trying to use:
# pacman -Qs nvidia
local/egl-wayland 2:1.1.9+r3+g582b2d3-1
    EGLStream-based Wayland external platform
local/libvdpau 1.4-1
    Nvidia VDPAU library
local/nvidia 495.46-5
    NVIDIA drivers for linux
local/nvidia-utils 495.46-1
    NVIDIA drivers utilities

Not using nouveau (although I tried replacing nvidia with it):
# pacman -Qs nouveau
[this is empty]

Also, although I don't think it matters here, the desktop environment I'm using is i3wm. And in order to post this, I reenable my integrated graphics to launch xinit with i3wm, then I open firefox and paste the text files I compiled.
Thanks in advance. I'm not very experienced with Linux configuration, so any help is appreciated.

Last edited by ichosethisname (2021-12-27 21:46:40)

Offline

#2 2021-12-27 20:18:12

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,296

Re: [SOLVED] Trouble getting NVIDIA card to work with xinit on laptop

Welcome to the boards, please wrap outputs in code tags.

You do indeed have an Optimus system. They way Optimus systems work is that there's no screen attached to the nvidia card and it is instead used as a way to render an image, and then offload displaying said image to the integrated GPU. To set this up properly you either need to do some setup, or just render applications on a as needed basis.

For a start you need to remove these 2 modprobe conf files and the nvidia-xconfig generated xorg.conf and you should add i915 to the list of early loaded modules as well if you have an adjusted mkinitcpio.conf (and regenerate the initramfs with mkinitcpio). Now if you want to do what you want and offload the entire session to the nvidia card you can follow https://wiki.archlinux.org/title/NVIDIA … phics_only pay attention to the additional setup required in your .xinitrc mentioned there.  If you want to use the latter approach to only enable the card explicitly for applications that require it you can follow: https://wiki.archlinux.org/title/PRIME# … er_offload and then run applications you want on the nvidia card with the prime-run command prefixed.

Last edited by V1del (2021-12-27 20:21:15)

Offline

#3 2021-12-27 21:44:54

ichosethisname
Member
Registered: 2021-12-27
Posts: 2

Re: [SOLVED] Trouble getting NVIDIA card to work with xinit on laptop

Following the Optimus configuration tutorials solved my issues. I had not realized that my laptop used Optimus, thank you for pointing that out.

Offline

Board footer

Powered by FluxBB