You are not logged in.

#1 2019-10-19 12:31:31

polders
Member
Registered: 2019-09-28
Posts: 2

[SOLVED] nvidia-xrun fails on AMD iGPU/Nvidia dGPU laptop

Hello,

I have an ASUS TUF565DU with a Ryzen 7 3750H and an Nvidia GTX 1660Ti.
I am an Archlinux newbie, but after following the wiki I managed to make Xorg work without issues, using only the iGPU. I am now trying to use nvidia-xrun to start a second Xorg server on tty2.
The problem is that Xorg errors out with this error in Xorg.1.log:

modeset(G0): failed to set mode: No space left on device

Here is the complete Xorg.1.log, and also the full Xorg.0.log just in case.

Here is my /etc/X11/nvidia-xorg.conf :

Section "Files"
  ModulePath "/usr/lib/nvidia"
  ModulePath "/usr/lib32/nvidia"
  ModulePath "/usr/lib32/nvidia/xorg/modules"
  ModulePath "/usr/lib32/xorg/modules"
  ModulePath "/usr/lib64/nvidia/xorg/modules"
  ModulePath "/usr/lib64/nvidia/xorg"
  ModulePath "/usr/lib64/xorg/modules"
EndSection

Section "ServerLayout"
  Identifier "layout"
  Screen 1 "nvidia"
  Inactive "amdgpu"
EndSection

Section "Device"
  Identifier "nvidia"
  Driver "nvidia"
  BusID "PCI:1:0:0"
EndSection

Section "Screen"
  Identifier "nvidia"
  Device "nvidia"      
  Monitor "Monitor0"
  Option "AllowEmptyInitialConfiguration" "Yes"
EndSection

Section "Device"
  Identifier "amdgpu"
  Driver "modesetting"
EndSection

Section "Screen"
  Identifier "amd"
  Device "amdgpu"
EndSection

And here is /etc/X11/nvidia.xorg.conf.d/30-nvidia.conf :

Section "ServerLayout"
  Identifier "layout"
  Screen 1 "nvidia"
  Inactive "amdgpu"
EndSection

Section "Screen"
  Identifier "nvidia"
  Device "nvidia"
  Monitor "Monitor0"
  Option "AllowEmptyInitialConfiguration" "True"
  Option "Coolbits" "28"
  Option "TripleBuffer" "true"
EndSection

Section "Device"
  Identifier "amdgpu"
  Driver "modesetting"
EndSection

Section "Screen"
  Identifier "amd"
  Device "amdgpu"
EndSection

I also touched the default /usr/share/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf because it referenced the intel driver which I obviously don't have, but it's unclear to me if this file is even used by nvidia-xrun :

Section "OutputClass"
    Identifier "amdgpu"
    MatchDriver "amdgpu"
    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

There isn't a lot of documentation on configuration for AMD/Nvidia, it's very possible I've made a mistake but I'm a bit stuck on what to do now. What am I missing?

Last edited by polders (2019-10-20 09:21:51)

Offline

#2 2019-10-19 22:17:30

gnox
Member
Registered: 2013-05-18
Posts: 81

Re: [SOLVED] nvidia-xrun fails on AMD iGPU/Nvidia dGPU laptop

This is my  config for nvidia-xrun (aur nvidia-xrun-git) for a laptop with same dgpu and igpu (nvidia 1660ti, picasso igpu)

- /etc/modprobe.d/blacklist.conf

blacklist nouveau
blacklist rivafb
blacklist nvidiafb
blacklist rivatv
blacklist nv
blacklist nvidia
blacklist nvidia_drm
blacklist ipmi_msghandler 

- /etc/udev/rules.d/80-nvidia-pm.rules

# Remove NVIDIA USB xHCI Host Controller devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{remove}="1"

# Remove NVIDIA USB Type-C UCSI devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{remove}="1"

# Remove NVIDIA Audio devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{remove}="1"

# Enable runtime PM for NVIDIA VGA/3D controller devices on driver bind
#ACTION=="bind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", TEST=="power/control", ATTR{power/control}="auto"
#ACTION=="bind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030200", TEST=="power/control", ATTR{power/control}="auto"

# Disable runtime PM for NVIDIA VGA/3D controller devices on driver unbind
ACTION=="unbind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", TEST=="power/control", ATTR{power/control}="on"
ACTION=="unbind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030200", TEST=="power/control", ATTR{power/control}="on"

- /etc/X11/nvidia-xorg.conf

Section "Files"
  ModulePath "/usr/lib/nvidia"
  ModulePath "/usr/lib32/nvidia"
  ModulePath "/usr/lib32/nvidia/xorg/modules"
  ModulePath "/usr/lib32/xorg/modules"
  ModulePath "/usr/lib64/nvidia/xorg/modules"
  ModulePath "/usr/lib64/xorg/modules"
EndSection

Section "ServerLayout"
  Identifier "layout"
  Screen 0 "nvidia"
  Inactive "amdgpu"
EndSection

Section "Device"
  Identifier "nvidia"
  Driver "nvidia"
  BusID "PCI:1:0:0"
EndSection

Section "Screen"
  Identifier "nvidia"
  Device "nvidia"
  Monitor "Monitor0"
  Option "AllowEmptyInitialConfiguration" "True"
  Option "Coolbits" "28"
  Option "TripleBuffer" "true"
EndSection

Section "Device"
  Identifier "amdgpu"
  Driver "amdgpu" # can be modesetting too
EndSection

Section "Screen"
  Identifier "amd"  
  Device "amdgpu"
EndSection

- /etc/X11/xinit/nvidia-xinitrc for some reason the latest version of this file from the aur creates another problem, with a previous version make nvidia-xrun works, like the one that I'm putting here:

#!/bin/bash
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap
userxinitrc=$HOME/.nvidia-xinitrc

# merge in defaults and keymaps
if [ -f ${sysresources} ]; then
    xrdb -merge ${sysresources}
fi

if [ -f ${sysmodmap} ]; then
    xmodmap ${sysmodmap}
fi

if [ -f "$userresources" ]; then
    xrdb -merge "$userresources"
fi

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi

export LD_LIBRARY_PATH=/usr/lib64/nvidia/:/usr/lib32/nvidia:/usr/lib:${LD_LIBRARY_PATH}

# load additional configs
if [ -d /etc/X11/xinit/nvidia-xinitrc.d ] ; then
 for f in /etc/X11/xinit/nvidia-xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi

xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
xrandr --dpi 96 

if [ -f "$userxinitrc" ]; then
    sh ${userxinitrc} $*
else
    if [ $# -gt 0 ]; then
        "$*"
	fi
fi

You dont need to modify 10-nvidia-drm-outputclass.conf  that section is not being called because the intel driver is not loaded, the package extra/xf86-video-amdgpu comes with 10-amdgpu.conf with the correct section.

Another thing, I stopped using this configuration on the laptop because when the nvidia drivers are not loaded I saw an increase in temps like 10C more than normal, even removing the pci/changing power modes, tlp, powertop. Now I'm only using prime offload with the drivers loaded at any time.

Last edited by gnox (2019-10-19 23:20:46)

Offline

#3 2019-10-20 09:21:29

polders
Member
Registered: 2019-09-28
Posts: 2

Re: [SOLVED] nvidia-xrun fails on AMD iGPU/Nvidia dGPU laptop

Thank you so much, I managed to launch a stable xorg session using my dGPU. What actually worked was your modified nvidia-xinitrc. I'm not really sure why though, I'll have to look more into it.

I do use the aur nvidia-xrun-git, for anyone else coming here. I also do have the 10-amdgpu.conf that I didn't mention because I did not touch, thanks for the explanation on that.

I'm worried about your warning and I'll watch out for temps. It's weird but it seems that on the dGPU session my laptop seems to have lower fan speed. About the PRIME offload, is there any performance drawbacks?

Offline

#4 2019-10-21 04:52:31

gnox
Member
Registered: 2013-05-18
Posts: 81

Re: [SOLVED] nvidia-xrun fails on AMD iGPU/Nvidia dGPU laptop

polders wrote:

It's weird but it seems that on the dGPU session my laptop seems to have lower fan speed.

For me that happens when booting on Windows and setting the silent mode on the armoury crate (low fan speed), that mode stays on reboot when going into linux.

About the PRIME offload, is there any performance drawbacks?

Not that I've noticed when in stable temps, I prefer to use it because vsync works, in nvidia-xrun there is a lot of tearing even setting the modeset=1 prime sync doesnt work if you do a xrandr --verbose, also you dont have to go to another tty, and also the temps that are low when not using the nvidia card.

Offline

Board footer

Powered by FluxBB