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

[Looking for user feedback] Add support for per-application config profiles #251

Open
ilya-zlobintsev opened this issue Jan 22, 2024 · 7 comments · May be fixed by #327
Open

[Looking for user feedback] Add support for per-application config profiles #251

ilya-zlobintsev opened this issue Jan 22, 2024 · 7 comments · May be fixed by #327

Comments

@ilya-zlobintsev
Copy link
Owner

It would be nice if it was possible to create multiple config profiles, and automatically switch them based on currently running applications. An example use case would be to have one set of settings when you're running a specific game, another when you're running a compute workload etc.

If you're a user and you would find this feature useful, please say so.

Implementation details: ideally this would be done via a eBPF plugin that subscribes to process start/exit events.
bpftrace examples:

bpftrace -e 'tracepoint:syscalls:sys_enter_exec* { printf("SPAWN %d ", pid); join(args.argv); }'
bpftrace -e 'tracepoint:sched:sched_process_exit { printf("EXIT %d %s\n", args.pid, comm); }'

If this ends up being too difficult, another way would be to poll /proc, but need to make sure that it's not too expensive to do so

@43615
Copy link

43615 commented Jan 24, 2024

I'm not sure if I'd use this myself, but it would definitely be a nice bonus feature once full baseline support is there.

For a solid implementation, I'm thinking of a priority-based system (short-circuiting check down a list of conditions with associated profiles). The conditions could be simple checks for the presence of certain processes, maybe with the additional option of setting a custom command and matching on its exit code. Seems easy enough to implement with sysinfo and std::process.
I'm not a fan of using start/stop events since the daemon would forget the current state when restarted. Instead, I propose checking the conditions on a timer (every few seconds?). Any application that misbehaves when the parameters change would do so either way.

@ilya-zlobintsev
Copy link
Owner Author

The problem with scanning the process list every few seconds is that it requires scanning the entire /proc filesystem, which might be a relatively heavy operation. Currently the LACT daemon is very lightweight and doesn't do anything unless it actually needs to, and I'd like to keep it that way considering it's something that always runs in the background. The full scan would still need to be done on service startup to keep track of already existing processes though.

@ilya-zlobintsev
Copy link
Owner Author

Reference for self on how other projects do it:

@In-line
Copy link
Contributor

In-line commented Mar 5, 2024

Gamemode support is only thing needed

@FabianoIlCapo
Copy link

It would be nice if it was possible to create multiple config profiles, and automatically switch them based on currently running applications. An example use case would be to have one set of settings when you're running a specific game, another when you're running a compute workload etc.

Sounds like the equivalent of what the Nvidia control panel does (or did), that would be GOLDEN!

@Umio-Yasuno
Copy link
Contributor

I am developing a simple amdgpu profile switcher.
Some changes are required, but that tool could be used for LACT.

https://github.com/Umio-Yasuno/amdgpu-profile-switcher

@bioxz
Copy link

bioxz commented May 15, 2024

I would love to see this. I don't care about automatic switching, as I like to switch the profiles by hand even using the same application. I have a default undervolted and underclocked mode which allows me to use the GPU without its fans and a overclocked mode which is quite noisy, basically silent just using case fans.

Currently I'm using corectl which (in my eyes) does the whole profile thing in a weird and over complicated way (you can have multiple profiles active at once, partly overwriting others). Biggest "issue" right now is that you cannot ask the command line tool which profile is active, so you have to rely on the GUI to switch profiles.

Having a command/API to simply active a profile and another to request the current profile would be perfect, so I can build interfaces for a Plasma Widget and my Stream Deck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants