You are not logged in.

#1 2024-10-25 18:51:27

ItsFireStorm
Member
Registered: 2024-10-07
Posts: 18

[SOLVED] Cannot run OpenGL related applications in Integrated Graphics

This only happened as of installing NVidia Graphic Drivers for my ASUS laptop, to make use of Hybrid graphics for better performance while playing, the issue is, that it is VERY slow when navigating through my desktop (Hyprland). And as far as I know, there is no way to use only discrete graphics, there is no switch in my BIOS that allows me to do so, and Hyprland explicitly refrains the use of optimus-manager, a tool I used previously to control this behavior, so whenever I'm running on my battery, I tend to use Integrated Graphics and get better performance in my desktop.

The issue is that any game that uses OpenGL, as in the case for Terraria or Minecraft, it refrains from starting, Minecraft actually printed the following issue "GLFW error 65543: GLX: Failed to create context: GLXBadFBConfig", after digging around, I found out that I had to use a environment variable to force my OpenGL version to be 4.3, this however, did not work in the slightest, so whenever I want to play games, I have to switch to Hybrid and plug my AC cable.

How would I be able to fix this? Thanks for your support, I'm still trying to dig deeper into this, I'll try to keep you guys updated.

Last edited by ItsFireStorm (2024-10-26 10:16:27)

Offline

#2 2024-10-26 07:43:36

seth
Member
Registered: 2012-09-03
Posts: 59,045

Re: [SOLVED] Cannot run OpenGL related applications in Integrated Graphics

glxinfo -B
prime-run glxinfo -B

https://wiki.hyprland.org/Configuring/Multi-GPU/
Afaik OM only writes xorg configs (and, as a matter of fact, a stale one might get in the way when trying to run opengl on xwayland)

Offline

#3 2024-10-26 09:17:00

ItsFireStorm
Member
Registered: 2024-10-07
Posts: 18

Re: [SOLVED] Cannot run OpenGL related applications in Integrated Graphics

When running the command glxinfo -B on Integrated Graphics I get this.

> glxinfo -B
name of display: :1
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  150 (GLX)
  Minor opcode of failed request:  24 (X_GLXCreateNewContext)
  Value in failed request:  0x0
  Serial number of failed request:  62
  Current serial number in output stream:  63

prime-run also returns this, but it may as well be because the dGPU is disabled while in this state.

seth wrote:

Afaik OM only writes xorg configs (and, as a matter of fact, a stale one might get in the way when trying to run opengl on xwayland)

How would I be able to check if this is the case?

Offline

#4 2024-10-26 09:34:43

ItsFireStorm
Member
Registered: 2024-10-07
Posts: 18

Re: [SOLVED] Cannot run OpenGL related applications in Integrated Graphics

Issue was solved by removing these lines in my hyprland.conf

env = LIBVA_DRIVER_NAME,nvidia
env = XDG_SESSION_TYPE,wayland
env = GBM_BACKEND,nvidia-drm
env = __GLX_VENDOR_LIBRARY_NAME,nvidia

Yet, the current issue now is that its using the Intel Graphics on Hybrid Mode, so the issue is still not entirely solved.

Offline

#5 2024-10-26 09:42:47

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

Re: [SOLVED] Cannot run OpenGL related applications in Integrated Graphics

You can and probably should retain XDG_SESSION_TYPE but don't set the others globally.

Install nvidia-prime, go to programs that actually require the nvidia GPU do "prime-run $applicationthatactuallyrequirestheGPU" ??? profit

Last edited by V1del (2024-10-26 09:44:16)

Offline

#6 2024-10-26 10:06:56

ItsFireStorm
Member
Registered: 2024-10-07
Posts: 18

Re: [SOLVED] Cannot run OpenGL related applications in Integrated Graphics

This works, would there be a way to automate prime-run to open applications with NVidia Graphics (when available) or is this not possible?

Offline

#7 2024-10-26 13:03:31

seth
Member
Registered: 2012-09-03
Posts: 59,045

Re: [SOLVED] Cannot run OpenGL related applications in Integrated Graphics

This works, would there be a way to automate prime-run to open applications with NVidia Graphics (when available) or is this not possible?

If you just mean to condition prime-run on whether there's an nvidia GPU, try sth. like

if lsmod | grep nvidia > /dev/null; then prime-run exec "$@"; else exec "$@"

If you mean "programs i want to run on the nvidia chip in my head" it depends on whether you've your brain wired up as input device for the computer.

Offline

#8 2024-10-26 14:41:29

ItsFireStorm
Member
Registered: 2024-10-07
Posts: 18

Re: [SOLVED] Cannot run OpenGL related applications in Integrated Graphics

seth wrote:

If you just mean to condition prime-run on whether there's an nvidia GPU, try sth. like

if lsmod | grep nvidia > /dev/null; then prime-run exec "$@"; else exec "$@"

Where should I implement this code in?

Offline

#9 2024-10-26 14:48:36

seth
Member
Registered: 2012-09-03
Posts: 59,045

Re: [SOLVED] Cannot run OpenGL related applications in Integrated Graphics

Wherever you start stuff, it's basically a script that executes it's parameters via prime-run or not.

Offline

#10 2024-10-26 14:54:04

ItsFireStorm
Member
Registered: 2024-10-07
Posts: 18

Re: [SOLVED] Cannot run OpenGL related applications in Integrated Graphics

I've been digging around, and I use wofi as my application launcher, and sadly it does not support the use of custom scripts. Meaning I should probably still follow V1del's advice.

Offline

#11 2024-10-26 15:09:48

seth
Member
Registered: 2012-09-03
Posts: 59,045

Re: [SOLVED] Cannot run OpenGL related applications in Integrated Graphics

If wofi processes entries through $SHELL you could try to redefine that.

Offline

#12 2024-10-26 16:32:43

ItsFireStorm
Member
Registered: 2024-10-07
Posts: 18

Re: [SOLVED] Cannot run OpenGL related applications in Integrated Graphics

I ended up adding this condition to the binary file corresponding to the one showing up in my Application launcher, it is now working as intended. Thanks for helping out!

Offline

Board footer

Powered by FluxBB