Skip to content

Commit

Permalink
1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
vinifmor authored Sep 22, 2022
2 parents d832c1b + c911396 commit 915381c
Show file tree
Hide file tree
Showing 20 changed files with 361 additions and 109 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [1.2.2] 2022-09-22
### Improvements
- Minor code refactoring and log improvements regarding AMD GPU management
- Optimizer:
- configuration property `check.finished.interval` now accepts floats and the minimum value accepted is `0.5`
- new configuration property `gpu.id`: allows to define which GPU cards should be optimized (e.g: `gpus.id = 0,1`). If not defined, all available GPUs are considered (default).

### Fixes
- optimizer:
- when running as a system service, sometimes the GPU mapped directories are not available during the system startup and affects the correct behavior of the property `gpu.cache` when it is enabled (`true`)
- so now the available GPUs will be cached after a first request when the `optimizer` is running as a system service (otherwise they will be cached normally during the service startup process)

## [1.2.1] 2022-08-22
### Fixes
- Performance mode not being activated for AMD GPUs from the RX 6XX0 series (tested on kernels >= 5.15)
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,10 @@ makepkg -si
port = 5087 (TCP port)
compositor = (pre-defines the installed compositor. Options: kwin, compiz, marco, picom, compton, nvidia)
scripts.allow_root = false (allow custom scripts/commands to run at the root level)
check.finished.interval = 3 (finished applications checking interval in seconds)
check.finished.interval = 3 (finished applications checking interval in seconds. Min accepted value: 0.5)
launcher.mapping.timeout = 30 (max time in seconds to find the application mapped to a given launcher. float values are allowed)
gpu.cache = false (if 'true': maps all available GPUs on startup. Otherwise, GPUs will be mapped for every request)
gpu.cache = false (if 'true': maps all available GPUs once after the first request (if running as a system service) or during startup (if not running as system service). Otherwise, GPUs will be mapped for every request)
gpu.id = # comma separated list of integers representing which GPU cards should be optimized (e.g: 0, 1). If not defined, all available GPUs are considered (default)
gpu.vendor = # pre-defines your GPU vendor for faster GPUs mapping. Supported: nvidia, amd
cpu.performance = false (set cpu governors and energy policy levels to full performance on startup)
request.allowed_users = (restricts users that can request optimizations, separated by comma. e.g: root,xpto)
Expand Down Expand Up @@ -539,7 +540,7 @@ makepkg -si
```
- Logs:
- Logs are managed through the environemnt variables:
- Logs are managed through the environment variables:
- `GUAPOW_WATCH_LOG`: enables/disables logs. Options: **1** (enables, default), **0** (disables).
- `GUAPOW_WATCH_LOG_LEVEL`: controls the type of logging that should be printed. Options: `info`, `debug`, `error` and `warning` (`debug` is the most detailed type). Default: `info`.
- If the **watcher** is running as a service, these variables can be changed on the definition file (`~.config/systemd/user/guapow-watch.service`)
Expand Down
2 changes: 1 addition & 1 deletion guapow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
__app_name__ = 'guapow'
__version__ = '1.2.1'
__version__ = '1.2.2'
11 changes: 7 additions & 4 deletions guapow/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ class OptimizerConfig(RootFileModel):
FILE_MAPPING = {'port': ('port', int, None),
'compositor': ('compositor', str, None),
'scripts.allow_root': ('allow_root_scripts', bool, True),
'check.finished.interval': ('check_finished_interval', int, None),
'check.finished.interval': ('check_finished_interval', float, None),
'launcher.mapping.timeout': ('launcher_mapping_timeout', float, None),
'gpu.cache': ('gpu_cache', bool, True),
'gpu.id': ('gpu_ids', Set[int], None),
'gpu.vendor': ('gpu_vendor', str, None),
'cpu.performance': ('cpu_performance', bool, True),
'profile.cache': ('profile_cache', bool, True),
Expand All @@ -84,17 +85,19 @@ class OptimizerConfig(RootFileModel):

def __init__(self, port: Optional[int] = None, compositor: Optional[str] = None,
allow_root_scripts: Optional[bool] = False,
check_finished_interval: Optional[int] = None, launcher_mapping_timeout: Optional[float] = 30,
check_finished_interval: Optional[float] = None, launcher_mapping_timeout: Optional[float] = 30,
gpu_cache: Optional[bool] = False, cpu_performance: Optional[bool] = None,
profile_cache: Optional[bool] = None, pre_cache_profiles: Optional[bool] = None,
gpu_vendor: Optional[str] = None, renicer_interval: Optional[float] = None):
gpu_vendor: Optional[str] = None, renicer_interval: Optional[float] = None,
gpu_ids: Optional[Set[int]] = None):
self.port = port
self.compositor = compositor
self.allow_root_scripts = allow_root_scripts
self.check_finished_interval = check_finished_interval
self.launcher_mapping_timeout = launcher_mapping_timeout
self.gpu_cache = gpu_cache
self.gpu_vendor = gpu_vendor
self.gpu_ids = gpu_ids
self.cpu_performance = cpu_performance
self.request = RequestSettings.default()
self.profile_cache = profile_cache
Expand Down Expand Up @@ -127,7 +130,7 @@ def has_valid_launcher_mapping_timeout(self) -> bool:
return self.launcher_mapping_timeout is not None and self.launcher_mapping_timeout >= 0

def has_valid_check_finished_interval(self) -> bool:
return self.check_finished_interval is not None and self.check_finished_interval > 0
return self.check_finished_interval is not None and self.check_finished_interval >= 0.5

def has_valid_renicer_interval(self) -> bool:
return self.renicer_interval is not None and self.renicer_interval > 0
Expand Down
19 changes: 19 additions & 0 deletions guapow/common/model_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,25 @@ def get_raw_type(self) -> type:
return list


class IntSetPropertyMapper(FileModelCollectionPropertyMapper):

def supports(self, prop_type: type) -> bool:
return prop_type == Set[int]

def map(self, prop_val: str, prop_type: type) -> Optional[Set[int]]:
return {int(n) for n in prop_val.split(',') if n.isdigit()}

def create_collection(self) -> object:
return set()

def update_collection(self, collection: object, update: object):
if isinstance(collection, set) and isinstance(update, set):
collection.update(update)

def get_raw_type(self) -> type:
return set


class StringListPropertyMapper(FileModelCollectionPropertyMapper):

def supports(self, prop_type: type) -> bool:
Expand Down
1 change: 1 addition & 0 deletions guapow/dist/daemon/opt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# check.finished.interval = 3 # finished applications checking interval in seconds
# launcher.mapping.timeout = 30 # max time in seconds to find the application mapped to a given launcher. float values are allowed
# gpu.cache = false # if 'true': maps all available GPUs on startup. Otherwise, GPUs will be mapped for every request
# gpu.id = # comma separated list of integers representing which GPU cards should be optimized (e.g: 0, 1). If not defined, all available GPUs are considered (default)
# gpu.vendor = # pre-defines your GPU vendor for faster GPUs mapping. Supported: nvidia, amd
# cpu.performance = false # set cpu governors and energy policy levels to full performance on startup
# request.allowed_users = # restricts users that can request optimizations, separated by comma. e.g: root,xpto)
Expand Down
Loading

0 comments on commit 915381c

Please sign in to comment.