Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for hybrid graphic cards #20

Closed
mgerhardy opened this issue Apr 11, 2018 · 12 comments · Fixed by #159
Closed

Support for hybrid graphic cards #20

mgerhardy opened this issue Apr 11, 2018 · 12 comments · Fixed by #159
Labels
question Further information is requested

Comments

@mgerhardy
Copy link

mgerhardy commented Apr 11, 2018

Bumblebee, nvidia-prime and all the other options that exist

@mgerhardy mgerhardy changed the title optirun support for intel/nvidia cards in notebooks. Bumblebee (optirun) support for hybrid graphic cards Apr 11, 2018
@mgerhardy mgerhardy changed the title Bumblebee (optirun) support for hybrid graphic cards Support for hybrid graphic cards Apr 11, 2018
@mdiluz
Copy link
Contributor

mdiluz commented Apr 11, 2018

Hi @mgerhardy, to be specific here, what sort of behavior are you looking for?

Controlling optirun etc. may be something outside of the scope of a daemon, unfortunately.

It's also worth noting too that with Vulkan these issues start to go away - the game should allow you to choose which GPU is to be used.

@mdiluz mdiluz added the question Further information is requested label Apr 11, 2018
@mgerhardy
Copy link
Author

I'm looking for activating the main gpu automatically. To be honest I'm not sure how optirun works - but for e.g. nvidia-prime it is already enough to export an env var (DRI_PRIME=1) in the application context.

for example:

DRI_PRIME=1 glxinfo | grep OpenGL
OpenGL vendor string: nouveau
OpenGL renderer string: Gallium 0.4 on NVC1
OpenGL version string: 3.0 Mesa 9.0
OpenGL shading language version string: 1.30

and on the other side:

glxinfo | grep OpenGL 
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Ironlake Mobile 
OpenGL version string: 2.1 Mesa 9.0
OpenGL shading language version string: 1.20

But I'm not sure what exactly is needed for the other solutions out there.

kakra added a commit to kakra/gamemode that referenced this issue Oct 12, 2018
Such a feature is out of the scope of GameMode and could not be properly
implemented. Let's document this and reference the issue.

Closes: FeralInteractive#20
Signed-off-by: Kai Krakow <kai@kaishome.de>
@stephanlachnit
Copy link
Contributor

stephanlachnit commented Mar 15, 2019

I think with the new gamemoderun command this should be implemented. Currently there are 4 possible options to run an app with a secondary GPU:
DRI_PRIME=1 app, optirun app, primusrun app, nvidia-xrun app

With that in mind, it should also be added an option to set vblank_mode=0, which disables VSync, since afaik primusrun activates this every time.

@mdiluz
Copy link
Contributor

mdiluz commented Mar 15, 2019

This is a cool idea actually, gamemoderun could evolve into a helper script for this kind of stuff!

@stephanlachnit
Copy link
Contributor

In that case, what happens if you run gamemoderun on an app with built-in gamemode support? Because if Hybrid GPU would be implemented in gamemoderun, it would be a very nice replacement to optirun etc for Hybrid GPU user.

@mdiluz
Copy link
Contributor

mdiluz commented Mar 18, 2019

I think this is a fine situation - the only difference is the daemon sees the app request gamemode twice - a safe operation.

@stephanlachnit
Copy link
Contributor

stephanlachnit commented Mar 18, 2019

So is someone working on this? I would give it a shot, but I can't find where the gamemoderun code is (probably would with make, but I never used meson).

Nevermind I found it. But I think if gamemoderun stays just a shell script this will be a problem, since loading a config isn't that trivial.

@mdiluz
Copy link
Contributor

mdiluz commented Mar 18, 2019

It's here: https://github.com/FeralInteractive/gamemode/blob/master/data/gamemoderun.in

It's not on my immediate list, so I'd say go for it

@stephanlachnit
Copy link
Contributor

I already got the bash script working, wasn't that much work, but I would take some advice on how to get the config. I think the best option would be to add a DBUS option to gamemoded to get the config. Any suggestions?

@aejsmith
Copy link
Contributor

@mdiluz Do we want to be adding major functionality to gamemoderun? Doing so means that games which natively support GameMode and don't need to be run through gamemoderun will lose out on functionality.

@mdiluz
Copy link
Contributor

mdiluz commented Mar 25, 2019

Yeah, I'd been mulling on it for a while - realising it'd need access to the config to make it useful kind of makes it a little bit more problematic too.

Perhaps it's simple enough for someone to write a wrapper scipt to do this for themselves?

@stephanlachnit
Copy link
Contributor

I wouldn't call it a major functionality for most people. If you have a hybrid gpu, you have to use a command before starting a game anyway.
The code in gamemoderun is pretty short (see #124), the only things that's missing is the code to get the config, but that should take maybe 2 or 3 lines.
The only change missing is some option to retrieve the config options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
4 participants