Issue with hybrid nvidia-amdgpu setup

When I try to run programs with prime-run they don’t work. For example when I ‘run glxinfo | grep OpenGL’ I get this output

OpenGL vendor string: AMD
OpenGL renderer string: AMD Radeon(TM) Vega 10 Graphics (RAVEN, DRM 3.40.0, 5.10.42-1-MANJARO, LLVM 12.0.0)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 21.1.2
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6 (Compatibility Profile) Mesa 21.1.2
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 21.1.2
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

When I run ‘prime-run glxinfo’ I get this

name of display: :0
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  152 (GLX)
  Minor opcode of failed request:  24 (X_GLXCreateNewContext)
  Value in failed request:  0x0
  Serial number of failed request:  50
  Current serial number in output stream:  51

Output of inxi --admin --verbosity=7 --filter --no-host --width

System:
  Kernel: 5.10.42-1-MANJARO x86_64 bits: 64 compiler: gcc v: 11.1.0 
  parameters: BOOT_IMAGE=/boot/vmlinuz-5.10-x86_64 
  root=UUID=df8db3ee-8753-4b5f-a109-90b66fcb1628 rw quiet apparmor=1 
  security=apparmor udev.log_priority=3 
  Desktop: KDE Plasma 5.21.5 tk: Qt 5.15.2 wm: kwin_x11 vt: 1 dm: SDDM 
  Distro: Manjaro Linux base: Arch Linux 
Machine:
  Type: Laptop System: ASUSTeK product: TUF Gaming FX505DT_FX505DT v: 1.0 
  serial: <filter> 
  Mobo: ASUSTeK model: FX505DT v: 1.0 serial: <filter> 
  UEFI: American Megatrends v: FX505DT.316 date: 01/28/2021 
Battery:
  ID-1: BAT0 charge: 38.5 Wh (100.0%) condition: 38.5/48.1 Wh (80.1%) 
  volts: 12.5 min: 11.7 model: FX50442 type: Li-ion serial: N/A status: Full 
Memory:
  RAM: total: 15.14 GiB used: 2.1 GiB (13.9%) 
  RAM Report: permissions: Unable to run dmidecode. Root privileges required. 
CPU:
  Info: Quad Core model: AMD Ryzen 7 3750H with Radeon Vega Mobile Gfx 
  bits: 64 type: MT MCP arch: Zen/Zen+ note: check family: 17 (23) 
  model-id: 18 (24) stepping: 1 microcode: 8108102 cache: L2: 2 MiB 
  bogomips: 36751 
  Speed: 1286 MHz min/max: 1400/2300 MHz boost: enabled Core speeds (MHz): 
  1: 1286 2: 1295 3: 1233 4: 1177 5: 1304 6: 1381 7: 1278 8: 1214 
  Flags: 3dnowprefetch abm adx aes aperfmperf apic arat avic avx avx2 bmi1 
  bmi2 bpext clflush clflushopt clzero cmov cmp_legacy constant_tsc cpb cpuid 
  cr8_legacy cx16 cx8 de decodeassists extapic extd_apicid f16c flushbyasid 
  fma fpu fsgsbase fxsr fxsr_opt ht hw_pstate ibpb irperf lahf_lm lbrv lm mca 
  mce misalignsse mmx mmxext monitor movbe msr mtrr mwaitx nonstop_tsc nopl 
  npt nrip_save nx osvw overflow_recov pae pat pausefilter pclmulqdq pdpe1gb 
  perfctr_core perfctr_llc perfctr_nb pfthreshold pge pni popcnt pse pse36 
  rdrand rdseed rdtscp rep_good sep sev sev_es sha_ni skinit smap smca sme 
  smep ssbd sse sse2 sse4_1 sse4_2 sse4a ssse3 succor svm svm_lock syscall tce 
  topoext tsc tsc_scale v_vmsave_vmload vgif vmcb_clean vme vmmcall wdt 
  xgetbv1 xsave xsavec xsaveerptr xsaveopt xsaves 
  Vulnerabilities: Type: itlb_multihit status: Not affected 
  Type: l1tf status: Not affected 
  Type: mds status: Not affected 
  Type: meltdown status: Not affected 
  Type: spec_store_bypass 
  mitigation: Speculative Store Bypass disabled via prctl and seccomp 
  Type: spectre_v1 
  mitigation: usercopy/swapgs barriers and __user pointer sanitization 
  Type: spectre_v2 mitigation: Full AMD retpoline, IBPB: conditional, STIBP: 
  disabled, RSB filling 
  Type: srbds status: Not affected 
  Type: tsx_async_abort status: Not affected 
Graphics:
  Device-1: NVIDIA TU117M [GeForce GTX 1650 Mobile / Max-Q] vendor: ASUSTeK 
  driver: nvidia v: 465.31 alternate: nouveau,nvidia_drm bus-ID: 01:00.0 
  chip-ID: 10de:1f91 class-ID: 0300 
  Device-2: AMD Picasso vendor: ASUSTeK driver: amdgpu v: kernel 
  bus-ID: 05:00.0 chip-ID: 1002:15d8 class-ID: 0300 
  Device-3: IMC Networks USB2.0 HD UVC WebCam type: USB driver: uvcvideo 
  bus-ID: 3-1:2 chip-ID: 13d3:56a2 class-ID: 0e02 serial: <filter> 
  Display: x11 server: X.Org 1.20.11 compositor: kwin_x11 driver: 
  loaded: modesetting display-ID: :0 screens: 1 
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.0x11.2") 
  s-diag: 582mm (22.9") 
  Monitor-1: eDP-1 res: 1920x1080 hz: 144 dpi: 142 size: 344x193mm (13.5x7.6") 
  diag: 394mm (15.5") 
  OpenGL: renderer: AMD Radeon Vega 10 Graphics (RAVEN DRM 3.40.0 
  5.10.42-1-MANJARO LLVM 12.0.0) 
  v: 4.6 Mesa 21.1.2 direct render: Yes 
Audio:
  Device-1: AMD Family 17h HD Audio vendor: ASUSTeK driver: snd_hda_intel 
  v: kernel bus-ID: 05:00.6 chip-ID: 1022:15e3 class-ID: 0403 
  Sound Server-1: ALSA v: k5.10.42-1-MANJARO running: yes 
  Sound Server-2: JACK v: 0.125.0 running: no 
  Sound Server-3: PulseAudio v: 14.2 running: yes 
  Sound Server-4: PipeWire v: 0.3.30 running: yes 
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  vendor: ASUSTeK driver: r8169 v: kernel port: e000 bus-ID: 02:00.0 
  chip-ID: 10ec:8168 class-ID: 0200 
  IF: enp2s0 state: up speed: 1000 Mbps duplex: full mac: <filter> 
  IP v4: <filter> type: dynamic noprefixroute scope: global 
  broadcast: <filter> 
  Device-2: Realtek RTL8822CE 802.11ac PCIe Wireless Network Adapter 
  vendor: AzureWave driver: rtw_8822ce v: N/A modules: rtw88_8822ce port: d000 
  bus-ID: 04:00.0 chip-ID: 10ec:c822 class-ID: 0280 
  IF: wlp4s0 state: up mac: <filter> 
  IP v4: <filter> type: dynamic noprefixroute scope: global 
  broadcast: <filter> 
  IF-ID-1: tun0 state: unknown speed: 10 Mbps duplex: full mac: N/A 
  IP v4: <filter> scope: global broadcast: <filter> 
  WAN IP: <filter> 
Bluetooth:
  Device-1: IMC Networks Bluetooth Radio type: USB driver: btusb v: 0.8 
  bus-ID: 1-4:3 chip-ID: 13d3:3548 class-ID: e001 serial: <filter> 
  Report: rfkill ID: hci0 rfk-id: 1 state: up address: see --recommends 
Logical:
  Permissions: Unable to run lvs. Root privileges required. 
RAID:
  Message: No RAID data found. 
Drives:
  Local Storage: total: 715.41 GiB used: 264.78 GiB (37.0%) 
  SMART Message: Unable to run smartctl. Root privileges required. 
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Intel model: SSDPEKNW512G8 
  size: 476.94 GiB block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s 
  lanes: 4 rotation: SSD serial: <filter> rev: 002C temp: 33.9 C scheme: GPT 
  ID-2: /dev/sda maj-min: 8:0 vendor: SanDisk model: X400 M.2 2280 256GB 
  size: 238.47 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s 
  rotation: SSD serial: <filter> rev: 2012 scheme: GPT 
  Message: No optical or floppy data found. 
Partition:
  ID-1: / raw-size: 237.99 GiB size: 233.75 GiB (98.22%) 
  used: 95.26 GiB (40.8%) fs: ext4 dev: /dev/sda4 maj-min: 8:4 label: N/A 
  uuid: df8db3ee-8753-4b5f-a109-90b66fcb1628 
  ID-2: /boot/efi raw-size: 500 MiB size: 496 MiB (99.20%) 
  used: 63.2 MiB (12.7%) fs: vfat dev: /dev/sda1 maj-min: 8:1 label: ESP 
  uuid: 6EB2-4468 
  ID-3: /run/media/angusw/storage raw-size: 476.68 GiB 
  size: 468.14 GiB (98.21%) used: 169.46 GiB (36.2%) fs: ext4 
  dev: /dev/nvme0n1p2 maj-min: 259:2 label: storage 
  uuid: 39ef530a-307f-4a21-bfee-88b348e58669 
Swap:
  Alert: No swap data was found. 
Unmounted:
  ID-1: /dev/nvme0n1p1 maj-min: 259:1 size: 260 MiB fs: <superuser required> 
  label: SYSTEM uuid: 4E41-03C5 
USB:
  Hub-1: 1-0:1 info: Full speed (or root) Hub ports: 4 rev: 2.0 
  speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900 
  Device-1: 1-2:2 info: Microsoft Basic Optical Mouse v2.0 type: Mouse 
  driver: hid-generic,usbhid interfaces: 1 rev: 1.1 speed: 1.5 Mb/s 
  power: 100mA chip-ID: 045e:00cb class-ID: 0301 
  Device-2: 1-4:3 info: IMC Networks Bluetooth Radio type: Bluetooth 
  driver: btusb interfaces: 2 rev: 1.0 speed: 12 Mb/s power: 500mA 
  chip-ID: 13d3:3548 class-ID: e001 serial: <filter> 
  Hub-2: 2-0:1 info: Full speed (or root) Hub ports: 4 rev: 3.1 speed: 10 Gb/s 
  chip-ID: 1d6b:0003 class-ID: 0900 
  Hub-3: 3-0:1 info: Full speed (or root) Hub ports: 2 rev: 2.0 
  speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900 
  Device-1: 3-1:2 info: IMC Networks USB2.0 HD UVC WebCam type: Video 
  driver: uvcvideo interfaces: 2 rev: 2.0 speed: 480 Mb/s power: 500mA 
  chip-ID: 13d3:56a2 class-ID: 0e02 serial: <filter> 
  Device-2: 3-2:4 info: Gaming KB Gaming KB type: Keyboard 
  driver: hid-generic,usbhid interfaces: 2 rev: 0.2 speed: 12 Mb/s 
  power: 300mA chip-ID: 258a:001a class-ID: 0301 
  Hub-4: 4-0:1 info: Full speed (or root) Hub ports: 1 rev: 3.1 speed: 10 Gb/s 
  chip-ID: 1d6b:0003 class-ID: 0900 
Sensors:
  System Temperatures: cpu: 45.1 C mobo: 45.0 C gpu: amdgpu temp: 45.0 C 
  Fan Speeds (RPM): cpu: 2800 
Info:
  Processes: 265 Uptime: 1h 06m wakeups: 2 Init: systemd v: 248 
  tool: systemctl Compilers: gcc: 11.1.0 clang: 12.0.0 Packages: 1479 
  pacman: 1477 lib: 429 flatpak: 0 snap: 2 Shell: Zsh v: 5.8 default: Bash 
  v: 5.1.8 running-in: konsole inxi: 3.3.04

The hybrid drivers are installed

I have had this issue many times and have been able to solve it by reinstalling manjaro, but this is a hassle and it would be much better to have a proper fix.

Hi @ang_www, and welcome!

  1. Have a look here: How to provide good information and please edit your post accordingly.
  2. Do you have the Hybrid drivers installed?

I won’t be the one to hep you as I have 0 knowledge and/or experience with a hybrid setup, but the info will be necessary for anyone else trying to help as well.

Thanks. I’ve updated the post.

I was able to solve the issue on my own. I just appended /sbin/prime-offload to the end of /usr/share/sddm/scripts/Xsetup and /sbin/prime-switch to the end of /usr/share/sddm/scripts/Xstop and then running optimus-manager --switch hybrid

Many other people on the fourm appear to be having the same or a similar issue so i hope this solution will be of some use.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.