diff options
| author | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2025-11-27 22:24:13 -0500 |
|---|---|---|
| committer | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2025-11-27 22:24:13 -0500 |
| commit | 4d6360812d56923b42ee9bd5a13d2f95a1d1c958 (patch) | |
| tree | 2a5b3521e470b42be2f34c61ba2808f1065e16b4 /py_modules/lsfg_vk | |
| parent | 56c493184fc3960e3b33aa789fad618962c339ae (diff) | |
| download | decky-lsfg-vk-4d6360812d56923b42ee9bd5a13d2f95a1d1c958.tar.gz decky-lsfg-vk-4d6360812d56923b42ee9bd5a13d2f95a1d1c958.zip | |
add experimental arm .so and overwrite logic on setup
Diffstat (limited to 'py_modules/lsfg_vk')
| -rw-r--r-- | py_modules/lsfg_vk/constants.py | 1 | ||||
| -rw-r--r-- | py_modules/lsfg_vk/installation.py | 22 |
2 files changed, 22 insertions, 1 deletions
diff --git a/py_modules/lsfg_vk/constants.py b/py_modules/lsfg_vk/constants.py index 3d8e44a..795c1bf 100644 --- a/py_modules/lsfg_vk/constants.py +++ b/py_modules/lsfg_vk/constants.py @@ -14,6 +14,7 @@ CONFIG_FILENAME = "conf.toml" LIB_FILENAME = "liblsfg-vk.so" JSON_FILENAME = "VkLayer_LS_frame_generation.json" ZIP_FILENAME = "lsfg-vk_noui.zip" +ARM_LIB_FILENAME = "liblsfg-vk-arm64.so" FLATPAK_23_08_FILENAME = "org.freedesktop.Platform.VulkanLayer.lsfg_vk_23.08.flatpak" FLATPAK_24_08_FILENAME = "org.freedesktop.Platform.VulkanLayer.lsfg_vk_24.08.flatpak" diff --git a/py_modules/lsfg_vk/installation.py b/py_modules/lsfg_vk/installation.py index 4329d49..f041ea3 100644 --- a/py_modules/lsfg_vk/installation.py +++ b/py_modules/lsfg_vk/installation.py @@ -3,6 +3,7 @@ Installation service for lsfg-vk. """ import os +import platform import shutil import traceback import zipfile @@ -14,7 +15,7 @@ from typing import Dict, Any from .base_service import BaseService from .constants import ( LIB_FILENAME, JSON_FILENAME, ZIP_FILENAME, BIN_DIR, - SO_EXT, JSON_EXT + SO_EXT, JSON_EXT, ARM_LIB_FILENAME ) from .config_schema import ConfigurationManager from .types import InstallationResponse, UninstallationResponse, InstallationCheckResponse @@ -48,6 +49,16 @@ class InstallationService(BaseService): self._extract_and_install_files(zip_path) + # If on ARM, overwrite the .so with the ARM version + if self._is_arm_architecture(): + self.log.info("Detected ARM architecture, using ARM binary") + arm_so_path = plugin_dir / BIN_DIR / ARM_LIB_FILENAME + if arm_so_path.exists(): + shutil.copy2(arm_so_path, self.lib_file) + self.log.info(f"Overwrote with ARM binary: {self.lib_file}") + else: + self.log.warning(f"ARM binary not found at {arm_so_path}, using x86_64 version") + self._create_config_file() self._create_lsfg_launch_script() @@ -64,6 +75,15 @@ class InstallationService(BaseService): self.log.error(error_msg) return self._error_response(InstallationResponse, str(e), message="") + def _is_arm_architecture(self) -> bool: + """Check if running on ARM architecture + + Returns: + True if running on ARM (aarch64/arm64), False otherwise + """ + machine = platform.machine().lower() + return machine in ('aarch64', 'arm64', 'armv8l', 'armv8b') + def _extract_and_install_files(self, zip_path: Path) -> None: """Extract zip file and install files to appropriate locations |
