Prime-run: Segmentation fault

When I run any graphical program with prime-run I get the following error:

[jomosoto@Jomosoto ~]$ prime-run glxinfo
name of display: :0
/usr/bin/prime-run: line 2:  7630 Segmentation fault      __NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia "$@"

The problem should be the __GLX_VENDOR_LIBRARY_NAME=nvidia:

[jomosoto@Jomosoto ~]$ __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo
name of display: :0
Segmentation fault

System Info:

OS: Artix Linux x86_64
Host: 82JQ Legion 5 Pro 16ACH6H
Kernel: 5.18.2-artix1-1


lspci -k | grep -A 3 VGA:

01:00.0 VGA compatible controller: NVIDIA Corporation GA104M [GeForce RTX 3070 Mobile / Max-Q] (rev a1)
        Subsystem: Lenovo Device 3a4f
        Kernel driver in use: nvidia
        Kernel modules: nouveau, nvidia_drm, nvidia
--
05:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Cezanne (rev c5)
        Subsystem: Lenovo Device 3a4f
        Kernel driver in use: amdgpu
        Kernel modules: amdgpu

My /etc/X11/xorg.conf.d/ and /etc/modprobe.d/ are empty and there’s no /etc/X11/xorg.conf


Any ideas?

Side note: I think I caused this problem when trying to configure my optimus (I tried optimus-manager, bumblebee, prime-select and more - all uninstalled now). It may be (not sure) some auto-generated config.

Side question: Does steam automatically use offloading? Steam games stopped launching shortly before I discoreverd my problem with prime-run.

Steam doesn’t use offloading unless started with prime-run.
Please run nvidia-bug-report.sh as root and attach the resulting nvidia-bug-report.log.gz file to your post.

I don’t know what I did, I didn’t change anything between multiple reboots, but now suddenly prime-run works. Steam also works and automatically uses the dGPU.

However, now I have screen tearing issues. On every program, that I run via prime-run I get this problem. I’ve read about PRIME syncronization, but I’m not sure if it is what I’m looking for.

I did xrandr --output eDP --set "PRIME Synchronization" 1:

X Error of failed request:  BadName (named color or font does not exist)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  11 (RRQueryOutputProperty)
  Serial number of failed request:  55
  Current serial number in output stream:  55

xrandr --prop:

Screen 0: minimum 320 x 200, current 2560 x 1600, maximum 16384 x 16384
eDP connected primary 2560x1600+0+0 (normal left inverted right x axis y axis) 345mm x 215mm
        EDID: 
                00ffffffffffff000e6f001600000000
                001e0104b522167803ee95a3544c9926
                0f505400000001010101010101010101
                0101010101016e6e00a0a04084603020
                360059d710000018000000fd0c3ca51f
                1f4e010a202020202020000000fe0043
                534f542054330a2020202020000000fe
                004d4e473030374441312d310a200103
                02031d00e3058000e60605016a6a246d
                1a000002033ca500046a246a24000000
                00000000000000000000000000000000
                00000000000000000000000000000000
                00000000000000000000000000000000
                00000000000000000000000000000000
                00000000000000000000000000000000
                000000000000000000000000000000ff
        GAMMA_LUT_SIZE: 4096 
                range: (0, -1)
        DEGAMMA_LUT_SIZE: 4096 
                range: (0, -1)
        GAMMA_LUT: 0 
                range: (0, 65535)
        CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
                0 1 
        DEGAMMA_LUT: 0 
                range: (0, 65535)
        TearFree: auto 
                supported: off, on, auto
        HDCP Content Type: HDCP Type0 
                supported: HDCP Type0, HDCP Type1
        Content Protection: Undesired 
                supported: Undesired, Desired, Enabled
        vrr_capable: 1 
                range: (0, 1)
        abm level: 0 
                range: (0, 4)
        max bpc: 16 
                range: (8, 16)
        underscan vborder: 0 
                range: (0, 128)
        underscan hborder: 0 
                range: (0, 128)
        underscan: off 
                supported: off, on, auto
        scaling mode: None 
                supported: None, Full, Center, Full aspect
        link-status: Good 
                supported: Good, Bad
        CONNECTOR_ID: 78 
                supported: 78
        non-desktop: 0 
                range: (0, 1)
   2560x1600     60.01*+
   1920x1200     60.01  
   1920x1080     60.01  
   1600x1200     60.01  
   1680x1050     60.01  
   1280x1024     60.01  
   1440x900      60.01  
   1280x800      60.01  
   1280x720      60.01  
   1024x768      60.01  
   800x600       60.01  
   640x480       60.01  
DP-1-0 disconnected (normal left inverted right x axis y axis)
        PRIME Synchronization: 1 
                supported: 0, 1
        CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
                0 1 
        CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
        BorderDimensions: 4 
                supported: 4
        Border: 0 0 0 0 
                range: (0, 65535)
        SignalFormat: DisplayPort 
                supported: DisplayPort
        ConnectorType: DisplayPort 
        ConnectorNumber: 1 
        _ConnectorLocation: 1 
        non-desktop: 0 
                supported: 0, 1
DP-1-1 disconnected (normal left inverted right x axis y axis)
        PRIME Synchronization: 1 
                supported: 0, 1
        CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
                0 1 
        CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
        BorderDimensions: 4 
                supported: 4
        Border: 0 0 0 0 
                range: (0, 65535)
        SignalFormat: TMDS 
                supported: TMDS
        ConnectorType: DisplayPort 
        ConnectorNumber: 1 
        _ConnectorLocation: 1 
        non-desktop: 0 
                supported: 0, 1
DP-1-2 disconnected (normal left inverted right x axis y axis)
        PRIME Synchronization: 1 
                supported: 0, 1
        CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
                0 1 
        CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
        BorderDimensions: 4 
                supported: 4
        Border: 0 0 0 0 
                range: (0, 65535)
        SignalFormat: DisplayPort 
                supported: DisplayPort
        ConnectorType: DisplayPort 
        ConnectorNumber: 2 
        _ConnectorLocation: 2 
        non-desktop: 0 
                supported: 0, 1
DP-1-3 disconnected (normal left inverted right x axis y axis)
        PRIME Synchronization: 1 
                supported: 0, 1
        CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
                0 1 
        CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
        BorderDimensions: 4 
                supported: 4
        Border: 0 0 0 0 
                range: (0, 65535)
        SignalFormat: TMDS 
                supported: TMDS
        ConnectorType: DisplayPort 
        ConnectorNumber: 2 
        _ConnectorLocation: 2 
        non-desktop: 0 
                supported: 0, 1
HDMI-1-0 disconnected (normal left inverted right x axis y axis)
        PRIME Synchronization: 1 
                supported: 0, 1
        CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
                0 1 
        CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
        BorderDimensions: 4 
                supported: 4
        Border: 0 0 0 0 
                range: (0, 65535)
        SignalFormat: TMDS 
                supported: TMDS
        ConnectorType: HDMI 
        ConnectorNumber: 3 
        _ConnectorLocation: 3 
        non-desktop: 0 
                supported: 0, 1
DP-1-4 disconnected (normal left inverted right x axis y axis)
        PRIME Synchronization: 1 
                supported: 0, 1
        CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
                0 1 
        CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
        BorderDimensions: 4 
                supported: 4
        Border: 0 0 0 0 
                range: (0, 65535)
        SignalFormat: DisplayPort 
                supported: DisplayPort
        ConnectorType: Panel 
        ConnectorNumber: 0 
        _ConnectorLocation: 0 
        non-desktop: 0 
                supported: 0, 1

Here’s my nvidia-bug-report.sh: PrivateBin

Edit: I have an 165 hz laptop screen, but in kde it sais that 60 hz is the only supported. I don’t want to solve this problem in this thread, but I don’t know, maybe it has something to do with the problem.

I solved my problem by switching to 165 hz. For others, that try to run Linux on a Lenovo Legion 5: Here is how you get the refresh rate to work in dynamic GPU mode.