You are not logged in.

#1 2021-08-28 18:09:27

knaeckebrot
Member
Registered: 2021-08-28
Posts: 4

[SOLVED]NVIDIA prime-run X Error "BadWindow"

Hello guys,

I'm trying to get nvidia prime to run on my razer blade 15.
I got it working in the past but now it's not working properly.
I installed nvidia, nvidia-utils, nvidia-prime

following the instructions from the arch wiki, running the following commands gives me the expected return:

[max@klapprechner1 ~]$ prime-run glxinfo | grep "OpenGL renderer"
OpenGL renderer string: NVIDIA GeForce RTX 2070 with Max-Q Design/PCIe/SSE2

while:

[max@klapprechner1 ~]$ glxinfo | grep "OpenGL renderer"
OpenGL renderer string: Mesa Intel(R) UHD Graphics 630 (CFL GT2)

as expected. But when I try to run any game or even a small OpenGL benchmark utility glmark2
I get the following error:

X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  152 (GLX)
  Minor opcode of failed request:  16 (X_GLXVendorPrivate)
  Resource id in failed request:  0x7200002
  Serial number of failed request:  0
  Current serial number in output stream:  53

when i run it without prime-run it executes on my intel cpu as expected. anyone knows what could be the cause of this? thank you

my system:
[SPOILER]

[max@klapprechner1 ~]$ neofetch
                   -`                    max@klapprechner1 
                  .o+`                   ----------------- 
                 `ooo/                   OS: Arch Linux x86_64 
                `+oooo:                  Host: Blade 3.04 
               `+oooooo:                 Kernel: 5.13.13-arch1-1 
               -+oooooo+:                Uptime: 8 mins 
             `/:-:++oooo+:               Packages: 1719 (pacman) 
            `/++++/+++++++:              Shell: bash 5.1.8 
           `/++++++++++++++:             Resolution: 1920x1080 
          `/+++ooooooooooooo/`           DE: Plasma 5.22.4 
         ./ooosssso++osssssso+`          WM: KWin 
        .oossssso-````/ossssss+`         WM Theme: McMojave 
       -osssssso.      :ssssssso.        Theme: McMojave [Plasma], Sierra-dark-alt [GTK2/3] 
      :osssssss/        osssso+++.       Icons: breeze-dark [Plasma], breeze-dark [GTK2/3] 
     /ossssssss/        +ssssooo/-       Terminal: konsole 
   `/ossssso+/:-        -:/+osssso+-     Terminal Font: DEC Terminal 11 
  `+sso+:-`                 `.-/+oso:    CPU: Intel i7-9750H (12) @ 4.500GHz 
 `++:.                           `-/+/   GPU: NVIDIA GeForce RTX 2070 Mobile 
 .`                                 `/   GPU: Intel CoffeeLake-H GT2 [UHD Graphics 630] 
                                         Memory: 1718MiB / 15900MiB 

[/SPOILER]

edit:
also my nvidia card is missing in:

[max@klapprechner1 ~]$ xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x43 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 1 associated providers: 0 name:modesetting

Last edited by knaeckebrot (2021-08-29 12:36:13)

Offline

#2 2021-08-29 03:29:56

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,950

Re: [SOLVED]NVIDIA prime-run X Error "BadWindow"

Which instructions did you follow exactly and what did you do? The only thing you need to do on a modern driver is install nvidia-prime and not create any xorg.conf. Post a xorg log in doubt.

There are some gotchas that can happen like delayed driver init, in which case you want to set up for both the nvidia and i915 modules: https://wiki.archlinux.org/title/Kernel … _KMS_start (... for generally better anti-tearing/vsync you might additionally set up the nvidia-drm.modeset=1 parameter)

Offline

#3 2021-08-29 08:07:45

knaeckebrot
Member
Registered: 2021-08-28
Posts: 4

Re: [SOLVED]NVIDIA prime-run X Error "BadWindow"

hi thank you for your help, i was using the instructions from here: https://wiki.archlinux.org/title/PRIME
I added the kernel parameters you recommended and found out I still had the option "pcie_acs_override=downstream,multifunctio" enabled from earlier, which i removed.
now when I run xrandr it shows me 2 devices:

[max@klapprechner1 ~]$ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x45 cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 4 outputs: 2 associated providers: 1 name:Intel
Provider 1: id: 0x1dc cap: 0x2, Sink Output crtcs: 4 outputs: 4 associated providers: 1 name:modesetting

Now for the benchmark it sometimes works with prime-run and sometimes fails with the same error:

[max@klapprechner1 ~]$ prime-run glmark2
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  152 (GLX)
  Minor opcode of failed request:  16 (X_GLXVendorPrivate)
  Resource id in failed request:  0x7800002
  Serial number of failed request:  0
  Current serial number in output stream:  38
[max@klapprechner1 ~]$ prime-run glmark2
=======================================================
    glmark2 2021.02
=======================================================
    OpenGL Information
    GL_VENDOR:     NVIDIA Corporation
    GL_RENDERER:   NVIDIA GeForce RTX 2070 with Max-Q Design/PCIe/SSE2
    GL_VERSION:    4.6.0 NVIDIA 470.63.01
=======================================================
[build] use-vbo=false: FPS: 2929 FrameTime: 0.341 ms
=======================================================
                                  glmark2 Score: 2929 
=======================================================

I have no idea whats happening, I still cant start any game. My full Xorg log is here: https://pastebin.com/LGCMXJ90

Offline

#4 2021-08-29 10:14:51

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,950

Re: [SOLVED]NVIDIA prime-run X Error "BadWindow"

Remove xf86-video-intel it's generally buggy anyway, and prime-run is most tested with the built-in modesetting driver. Did you create a xorg.config ? From this log the nvidia  xorg driver isn't loaded. If you didn't create a xorg config and this is the log you get, set up the full early KMS like I mentioned by adjusting your /etc/mkinitcpio.conf and adding all the relevant modules and running mkinitcpio -P

Offline

#5 2021-08-29 10:53:25

knaeckebrot
Member
Registered: 2021-08-28
Posts: 4

Re: [SOLVED]NVIDIA prime-run X Error "BadWindow"

V1del wrote:

Remove xf86-video-intel it's generally buggy anyway, and prime-run is most tested with the built-in modesetting driver. Did you create a xorg.config ? From this log the nvidia  xorg driver isn't loaded. If you didn't create a xorg config and this is the log you get, set up the full early KMS like I mentioned by adjusting your /etc/mkinitcpio.conf and adding all the relevant modules and running mkinitcpio -P

Thank you for your help, however everytime i remove xf86-video-intel i get weird arifacts in kde, very weird flickering, when i reinstall it, it's gone.
I followed all your steps but i get the same problems, this is my xorg.conf:

Section "Device"
  Identifier "iGPU"
  Driver "modesetting"
EndSection

Section "Screen"
  Identifier "iGPU"
  Device "iGPU"
EndSection

Section "Device"
  Identifier "dGPU"
  Driver "nvidia"
EndSection

and this is my mkinitcpio.conf, and i ran sudo mkinitcpio -P

# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run.  Advanced users may wish to specify all system modules
# in this array.  For instance:
#     MODULES=(piix ide_disk reiserfs)
MODULES=(nvme i915 nvidia nvidia_modeset nvidia_uvm nvidia_drm)

# BINARIES
# This setting includes any additional binaries a given user may
# wish into the CPIO image.  This is run last, so it may be used to
# override the actual binaries included by a given hook
# BINARIES are dependency parsed, so you may safely ignore libraries
BINARIES=()

# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in any way.  This is useful for config files.
FILES=()

# HOOKS
# This is the most important setting in this file.  The HOOKS control the
# modules and scripts added to the image, and what happens at boot time.
# Order is important, and it is recommended that you do not change the
# order in which HOOKS are added.  Run 'mkinitcpio -H <hook name>' for
# help on a given hook.
# 'base' is _required_ unless you know precisely what you are doing.
# 'udev' is _required_ in order to automatically load modules
# 'filesystems' is _required_ unless you specify your fs modules in MODULES
# Examples:
##   This setup specifies all modules in the MODULES setting above.
##   No raid, lvm2, or encrypted root is needed.
#    HOOKS=(base)
#
##   This setup will autodetect all modules for your system and should
##   work as a sane default
#    HOOKS=(base udev autodetect block filesystems)
#
##   This setup will generate a 'full' image which supports most systems.
##   No autodetection is done.
#    HOOKS=(base udev block filesystems)
#
##   This setup assembles a pata mdadm array with an encrypted root FS.
##   Note: See 'mkinitcpio -H mdadm' for more information on raid devices.
#    HOOKS=(base udev block mdadm encrypt filesystems)
#
##   This setup loads an lvm2 volume group on a usb device.
#    HOOKS=(base udev block lvm2 filesystems)
#
##   NOTE: If you have /usr on a separate partition, you MUST include the
#    usr, fsck and shutdown hooks.
HOOKS=(base udev autodetect modconf block filesystems keyboard fsck)

# COMPRESSION
# Use this to compress the initramfs image. By default, gzip compression
# is used. Use 'cat' to create an uncompressed image.
#COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
#COMPRESSION="xz"
#COMPRESSION="lzop"
#COMPRESSION="lz4"

# COMPRESSION_OPTIONS
# Additional options for the compressor
#COMPRESSION_OPTIONS=()

Offline

#6 2021-08-29 11:02:32

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,950

Re: [SOLVED]NVIDIA prime-run X Error "BadWindow"

Remove the xorg.conf and retry. As for tearing/artifacts in KDE that just sounds like you disabled the compositor, check

kcmshell5 kwincompositing

and post

 qdbus org.kde.KWin /KWin org.kde.KWin.supportInformation

in doubt (qdbus is part of qt5-tools)

Offline

#7 2021-08-29 11:22:52

knaeckebrot
Member
Registered: 2021-08-28
Posts: 4

Re: [SOLVED]NVIDIA prime-run X Error "BadWindow"

V1del wrote:

Remove the xorg.conf and retry. As for tearing/artifacts in KDE that just sounds like you disabled the compositor, check

kcmshell5 kwincompositing

and post

 qdbus org.kde.KWin /KWin org.kde.KWin.supportInformation

in doubt (qdbus is part of qt5-tools)

thank you so much it works now!

Offline

#8 2021-08-29 11:39:03

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,950

Re: [SOLVED]NVIDIA prime-run X Error "BadWindow"

I wasn't being facetious when saying you only need to install nvidia-prime and not do anything else. That xorg conf just doesn't make any real sense and basically can only lead to issues, should probably be removed from the article tbh.

If this is fixed please mark it as such by adding [SOLVED] or so to the title in your first post by editing it.

Offline

Board footer

Powered by FluxBB