Code Monkey home page Code Monkey logo

Comments (12)

mdiluz avatar mdiluz commented on August 26, 2024

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.

from gamemode.

mgerhardy avatar mgerhardy commented on August 26, 2024

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.

from gamemode.

stephanlachnit avatar stephanlachnit commented on August 26, 2024

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.

from gamemode.

mdiluz avatar mdiluz commented on August 26, 2024

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

from gamemode.

stephanlachnit avatar stephanlachnit commented on August 26, 2024

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.

from gamemode.

mdiluz avatar mdiluz commented on August 26, 2024

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

from gamemode.

stephanlachnit avatar stephanlachnit commented on August 26, 2024

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.

from gamemode.

mdiluz avatar mdiluz commented on August 26, 2024

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

from gamemode.

stephanlachnit avatar stephanlachnit commented on August 26, 2024

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?

from gamemode.

aejsmith avatar aejsmith commented on August 26, 2024

@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.

from gamemode.

mdiluz avatar mdiluz commented on August 26, 2024

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?

from gamemode.

stephanlachnit avatar stephanlachnit commented on August 26, 2024

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.

from gamemode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.