### Linux Game Discovery: Scan Proton, Wine, and Flatpak (Python) Source: https://context7.com/recol/dlss-updater/llms.txt This Python module provides utilities for discovering game installations on Linux systems. It detects Steam's Proton compatibility layer, native Wine prefixes, and Lutris game installations. The module also handles permission checking and Flatpak sandbox detection to ensure proper access management. ```python import asyncio from dlss_updater.linux_paths import ( get_linux_steam_path, get_linux_steam_libraries, get_proton_prefixes, get_wine_prefixes, get_all_linux_game_paths, is_flatpak, get_flatpak_override_command, can_write_path, filter_accessible_paths ) from pathlib import Path async def linux_game_discovery(): # Check if running in Flatpak sandbox if is_flatpak(): print("Running in Flatpak sandbox") # Generate override command for custom paths cmd = get_flatpak_override_command("/mnt/games") print(f"Grant access with: {cmd}") # Detect native Steam installation steam_path = await get_linux_steam_path() if steam_path: print(f"\nSteam installation: {steam_path}") # Get all Steam library folders libraries = await get_linux_steam_libraries(steam_path) print(f"Steam libraries: {len(libraries)}") for lib in libraries: print(f" {lib}") # Find Proton prefixes (Windows compatibility layers) proton_prefixes = await get_proton_prefixes(steam_path) print(f"\nProton prefixes: {len(proton_prefixes)}") for prefix in proton_prefixes[:3]: print(f" {prefix}") # Find Wine prefixes (non-Steam games) wine_prefixes = await get_wine_prefixes() print(f"\nWine prefixes: {len(wine_prefixes)}") for prefix in wine_prefixes: print(f" {prefix}") # Get all game paths with permission filtering all_paths = await get_all_linux_game_paths() print(f"\n=== All Linux Game Paths ===") print(f"Steam native: {len(all_paths['steam_native'])} libraries") print(f"Proton games: {len(all_paths['proton'])} prefixes") print(f"Wine games: {len(all_paths['wine'])} prefixes") # Show skipped paths (permission issues) if all_paths['skipped_paths']: print(f"\nSkipped {len(all_paths['skipped_paths'])} inaccessible paths:") for info in all_paths['skipped_paths'][:3]: print(f" {info['path']}: {info['reason']}") # Output: # Running in Flatpak sandbox ``` -------------------------------- ### Backup Manager - Create and Restore DLL Backups Source: https://context7.com/recol/dlss-updater/llms.txt Manages the creation, listing, and restoration of DLL backups for games. It utilizes the BackupManager class to store metadata like original version and creation time. This snippet demonstrates creating manual backups, retrieving backups for a specific game, getting a summary of all backups, restoring a backup by its ID, and cleaning up old backups. ```python import asyncio from pathlib import Path from dlss_updater.backup_manager import BackupManager async def manage_backups(): backup_manager = BackupManager() # Create a backup manually dll_path = Path("/games/Cyberpunk 2077/bin/x64/nvngx_dlss.dll") backup_result = await backup_manager.create_backup( dll_path=dll_path, game_name="Cyberpunk 2077", dll_type="DLSS DLL", original_version="3.5.0.0" ) if backup_result: print(f"Backup created: {backup_result}") # List all backups for a game game_backups = await backup_manager.get_game_backups(game_name="Cyberpunk 2077") print(f"\nBackups for Cyberpunk 2077:") for backup in game_backups: print(f" {backup.dll_filename} v{backup.original_version} " f"({backup.backup_size / 1024:.1f} KB) - {backup.backup_created_at}") # Get backup summary for all games summaries = await backup_manager.get_all_game_backup_summaries() print("\nBackup Summary:") for summary in summaries: print(f" {summary.game_name}: {summary.backup_count} backups, " f"{summary.total_backup_size / 1024 / 1024:.1f} MB") # Restore a specific backup if game_backups: latest_backup = game_backups[0] restore_success = await backup_manager.restore_backup( backup_id=latest_backup.id ) if restore_success: print(f"\nRestored {latest_backup.dll_filename} to v{latest_backup.original_version}") # Cleanup old backups (keep only latest N per game) deleted = await backup_manager.cleanup_old_backups(keep_latest=3) print(f"\nCleaned up {deleted} old backup files") asyncio.run(manage_backups()) ``` -------------------------------- ### Scan Games for DLL Files using Python Source: https://context7.com/recol/dlss-updater/llms.txt This Python script uses the `asyncio` library and the `dlss_updater.scanner` module to discover and list supported DLL files within game installations. It supports scanning across multiple launchers and custom directories, caches scan results, and checks against a whitelist for known compatibility issues. The output is a dictionary mapping launcher names to lists of found DLL paths. ```python import asyncio from dlss_updater.scanner import ( scan_for_dlls, get_launcher_from_path, get_game_name_from_path ) from dlss_updater.whitelist import initialize_whitelist, is_whitelisted async def scan_games(): # Initialize whitelist for compatibility checking await initialize_whitelist() # Define paths to scan (can be game directories or launcher libraries) paths_to_scan = [ "/home/user/.steam/steam/steamapps/common", "/home/user/Games/Epic", "/mnt/games/Ubisoft" ] # Scan all paths for supported DLLs # Returns dict: {launcher_name: [list of DLL paths]} results = await scan_for_dlls(paths_to_scan) for launcher, dll_paths in results.items(): print(f"\n{launcher}:") for dll_path in dll_paths: game_name = get_game_name_from_path(dll_path) # Check if game is whitelisted (known compatibility issues) if await is_whitelisted(dll_path): print(f" [SKIP] {game_name}: Whitelisted game") continue print(f" {game_name}: {dll_path}") # Output: # Steam: # Cyberpunk 2077: /steam/steamapps/common/Cyberpunk 2077/bin/x64/nvngx_dlss.dll # [SKIP] Alan Wake 2: Whitelisted game # Epic Games: # Control: /Games/Epic/Control/nvngx_dlss.dll asyncio.run(scan_games()) ``` -------------------------------- ### Cache Manager - Initialize, Register, and Manage Caches Source: https://context7.com/recol/dlss-updater/llms.txt Demonstrates initializing the cache manager, registering a custom cache with specific policies, retrieving cache statistics, and performing manual cleanup. It also shows how to use memory-mapped files for efficient DLL access and how to shut down the manager cleanly. Dependencies include asyncio and pathlib. ```python import asyncio from pathlib import Path from dlss_updater.cache_manager import ( cache_manager, initialize_cache_manager, shutdown_cache_manager, CachePolicy ) async def cache_management(): # Initialize with default caches (dlls, images, scans) await initialize_cache_manager() # Register a custom cache await cache_manager.register_cache( name="custom_backups", cache_dir=Path("/tmp/dlss_backups"), policy=CachePolicy( max_size_mb=500, # 500MB limit max_age_days=30, # Remove after 30 days cleanup_interval_hours=6, eviction_enabled=True ) ) # Get cache statistics stats = await cache_manager.get_stats() for name, stat in stats.items(): print(f"\n{name} cache:") print(f" Entries: {stat.total_entries}") print(f" Size: {stat.total_size_bytes / 1024 / 1024:.1f} MB") print(f" Memory-mapped: {stat.memory_mapped_count}") print(f" Evictions: {stat.evictions_performed}") # Memory-map a DLL file for efficient reading dll_path = Path("/home/user/.config/DLSS-Updater/dll_cache/nvngx_dlss.dll") if dll_path.exists(): mm = await cache_manager.get_memory_mapped(dll_path) try: # Read DLL header (first 1KB) header = mm[:1024] print(f"\nRead {len(header)} bytes from memory-mapped DLL") # Read entire file efficiently full_data = mm[:] print(f"Total DLL size: {len(full_data) / 1024 / 1024:.2f} MB") finally: # Always release memory mapping await cache_manager.release_memory_mapped(dll_path) # Get global statistics global_stats = await cache_manager.get_global_stats() print(f"\n=== Global Cache Stats ===") print(f"Total caches: {global_stats['total_caches']}") print(f"Total entries: {global_stats['total_entries']}") print(f"Total size: {global_stats['total_size_mb']:.1f} MB") print(f"Active memory maps: {global_stats['active_mmaps']}") # Manual cleanup evicted = await cache_manager.cleanup(cache_name="images") print(f"\nEvicted {evicted} entries from images cache") # Shutdown cleanly await shutdown_cache_manager() asyncio.run(cache_management()) ``` -------------------------------- ### Whitelist Management - Initialize, Check, and Skip Games Source: https://context7.com/recol/dlss-updater/llms.txt This module initializes the game whitelist from a remote source, allows checking individual game paths for compatibility, and supports batch checking for efficiency. It also demonstrates how to add games to a skip list to override blacklist status. Dependencies include asyncio, dlss_updater.whitelist, and dlss_updater.config. ```python import asyncio from dlss_updater.whitelist import ( initialize_whitelist, is_whitelisted, get_whitelist, get_all_blacklisted_games, check_whitelist_batch ) from dlss_updater.config import config_manager async def whitelist_management(): # Initialize whitelist from remote await initialize_whitelist() # Get all whitelisted (blacklisted) games all_games = get_all_blacklisted_games() print(f"Games in whitelist: {len(all_games)}") for game in sorted(all_games)[:10]: print(f" - {game}") # Check individual game paths test_paths = [ "/steam/steamapps/common/Alan Wake 2/AlanWake2.exe", "/steam/steamapps/common/Cyberpunk 2077/bin/x64/nvngx_dlss.dll", "/Epic Games/Control/Control.exe", ] print("\nWhitelist checks:") for path in test_paths: is_blocked = await is_whitelisted(path) status = "BLOCKED" if is_blocked else "allowed" print(f" [{status}] {path}") # Batch check multiple paths (optimized) results = await check_whitelist_batch(test_paths, max_concurrent=10) blocked_count = sum(1 for v in results.values() if v) print(f"\nBatch check: {blocked_count}/{len(test_paths)} blocked") # Skip a blacklisted game (user override) config_manager.add_blacklist_skip("Alan Wake 2") print("\nAdded 'Alan Wake 2' to skip list") # Now the check should pass is_blocked = await is_whitelisted(test_paths[0]) print(f"Alan Wake 2 now blocked: {is_blocked}") # Example usage (assuming this function is called elsewhere or in a main script) # asyncio.run(whitelist_management()) ``` -------------------------------- ### Initialize and Manage DLL Cache Asynchronously - Python Source: https://context7.com/recol/dlss-updater/llms.txt This Python snippet demonstrates how to asynchronously initialize a DLL cache, fetch the remote manifest, check for updates, download DLLs with progress callbacks, and retrieve the local path of cached DLLs. It utilizes the `dlss_updater.dll_repository` module. ```python import asyncio from dlss_updater.dll_repository import ( initialize_dll_cache_async, get_remote_manifest_async, check_for_dll_update_async, download_latest_dll_async, get_local_dll_path ) async def setup_dll_cache(): # Progress callback for UI updates async def on_progress(current, total, message): percent = int((current / total) * 100) print(f"[{percent}%] {message}") # Initialize cache - downloads manifest and updates outdated DLLs await initialize_dll_cache_async(progress_callback=on_progress) # Check manifest for available DLLs manifest = await get_remote_manifest_async() print("\nAvailable DLLs:") for dll_name, info in manifest.items(): print(f" {dll_name}: v{info['version']}") # Check if specific DLL needs update needs_update = await check_for_dll_update_async("nvngx_dlss.dll", manifest) if needs_update: # Download with progress tracking async def download_progress(downloaded, total, dll_name): mb_downloaded = downloaded / (1024 * 1024) mb_total = total / (1024 * 1024) print(f"Downloading {dll_name}: {mb_downloaded:.1f}/{mb_total:.1f} MB") success = await download_latest_dll_async( "nvngx_dlss.dll", manifest=manifest, progress_callback=download_progress ) print(f"Download {'succeeded' if success else 'failed'}") # Get path to cached DLL for updates local_path = get_local_dll_path("nvngx_dlss.dll", skip_update_check=True) print(f"\nCached DLL path: {local_path}") # Output: # [0%] Fetching DLL manifest... # [10%] Checking for DLL updates... # [40%] Downloading 2 DLL updates... # [100%] DLL cache initialized # # Available DLLs: # nvngx_dlss.dll: v3.7.20.0 # nvngx_dlssg.dll: v3.8.10.0 # libxess.dll: v1.3.1 # amd_fidelityfx_dx12.dll: v3.1.0 # # Cached DLL path: /home/user/.config/DLSS-Updater/dll_cache/nvngx_dlss.dll asyncio.run(setup_dll_cache()) ``` -------------------------------- ### Perform Async Database Operations with aiosqlite (Python) Source: https://context7.com/recol/dlss-updater/llms.txt This snippet showcases asynchronous database operations using the aiosqlite library for managing game, DLL, update history, and Steam integration data. It includes functions to retrieve all games, games by launcher, DLLs for a specific game, recent update history, and perform Steam app lookups with FTS5 full-text search. ```python import asyncio from dlss_updater.database import db_manager from dlss_updater.models import Game, GameDLL async def database_operations(): # Games are auto-discovered during scanning, but can be queried games = await db_manager.get_all_games() print(f"Total games in database: {len(games)}") # Get games by launcher steam_games = await db_manager.get_games_by_launcher("Steam") print(f"\nSteam games: {len(steam_games)}") for game in steam_games[:5]: print(f" {game.name} (Steam App ID: {game.steam_app_id})") # Get DLLs for a specific game if steam_games: game = steam_games[0] dlls = await db_manager.get_game_dlls(game.id) print(f"\nDLLs in {game.name}:") for dll in dlls: print(f" {dll.dll_type}: {dll.current_version}") # Query update history history = await db_manager.get_recent_update_history(limit=10) print(f"\nRecent updates:") for entry in history: status = "Success" if entry.success else "Failed" print(f" [{status}] {entry.from_version} -> {entry.to_version}") # Steam app lookup with FTS5 search results = await db_manager.search_steam_app("cyberpunk", limit=5) print(f"\nSteam search 'cyberpunk':") for app_id, name in results: print(f" {app_id}: {name}") # Get cached Steam image path image_path = await db_manager.get_cached_image_path(1091500) # Cyberpunk 2077 if image_path: print(f"\nCached image: {image_path}") asyncio.run(database_operations()) ``` -------------------------------- ### Configuration Manager - Application Settings Source: https://context7.com/recol/dlss-updater/llms.txt Manages application settings, including update preferences for various DLL types (DLSS, XeSS, FSR, etc.), custom launcher paths, and performance tuning options. Settings are stored in INI format and support automatic migration. This snippet shows how to retrieve current preferences, update them, and configure custom launcher paths. ```python from dlss_updater.config import ( config_manager, LATEST_DLL_PATHS, Concurrency ) from dlss_updater.models import UpdatePreferencesConfig, LauncherPathsConfig # Get current update preferences prefs = config_manager.get_update_preferences() print("Update Preferences:") print(f" Update DLSS: {prefs.update_dlss}") print(f" Update XeSS: {prefs.update_xess}") print(f" Update FSR: {prefs.update_fsr}") print(f" Update DirectStorage: {prefs.update_direct_storage}") print(f" Update Streamline: {prefs.update_streamline}") print(f" Create Backups: {prefs.create_backups}") print(f" High Performance Mode: {prefs.high_performance_mode}") # Update preferences new_prefs = UpdatePreferencesConfig( update_dlss=True, update_xess=True, update_fsr=False, # Disable FSR updates update_direct_storage=True, update_streamline=True, create_backups=True, high_performance_mode=True # Enable memory-cached updates ) config_manager.set_update_preferences(new_prefs) print("\nPreferences updated") # Configure custom launcher paths launcher_paths = LauncherPathsConfig( steam_path="/mnt/games/Steam", epic_path="/mnt/games/Epic Games", custom_path_1="/mnt/ssd/Games", custom_path_2="/home/user/Games" ) config_manager.set_launcher_paths(launcher_paths) ``` -------------------------------- ### Update DLL Files using Python Source: https://context7.com/recol/dlss-updater/llms.txt This Python script demonstrates how to update game DLL files using the `dlss_updater.updater` module. It checks for available updates by comparing the current DLL version (read from PE headers) with the latest version from a repository. If an update is found, it creates a backup of the original DLL and then performs the update. The script handles version parsing and reports the success or failure of the update process. ```python import asyncio from pathlib import Path from dlss_updater.updater import ( get_dll_version, parse_version, update_dll, create_backup ) from dlss_updater.config import LATEST_DLL_PATHS async def update_game_dlls(game_path: str): game_dir = Path(game_path) dlss_dll = game_dir / "nvngx_dlss.dll" if not dlss_dll.exists(): print("No DLSS DLL found in game directory") return # Get current version from PE file headers current_version = get_dll_version(str(dlss_dll)) print(f"Current version: {current_version}") # Get latest version from cached DLL repository latest_dll_path = LATEST_DLL_PATHS.get("nvngx_dlss.dll") if latest_dll_path: latest_version = get_dll_version(latest_dll_path) print(f"Latest version: {latest_version}") # Compare versions (handles various version formats) if parse_version(current_version) < parse_version(latest_version): print(f"Update available: {current_version} -> {latest_version}") # Create backup before updating backup_path = create_backup(dlss_dll) print(f"Backup created: {backup_path}") # Perform the update result = await update_dll( str(dlss_dll), create_backup=True # Backup is created internally too ) if result.success: print(f"Successfully updated to {latest_version}") else: print(f"Update failed: {result}") else: print("Already up to date") # Output: # Current version: 3.5.0.0 # Latest version: 3.7.20.0 # Update available: 3.5.0.0 -> 3.7.20.0 # Backup created: /game/nvngx_dlss.dll.bak_20250101_120000 # Successfully updated to 3.7.20.0 asyncio.run(update_game_dlls("/games/Cyberpunk 2077/bin/x64")) ``` -------------------------------- ### Python VSVersionInfo Configuration Source: https://github.com/recol/dlss-updater/blob/main/version.txt Defines the version and file information for the DLSS Updater executable using Python's VSVersionInfo structure. This includes file version, product version, company name, and copyright. ```python VSVersionInfo( ffi=FixedFileInfo( filevers=(3, 9, 3, 0), prodvers=(3, 9, 3, 0), mask=0x3f, flags=0x0, OS=0x4, fileType=0x1, subtype=0x0, date=(0, 0) ), kids=[ StringFileInfo([ StringTable( u'040904B0', [ StringStruct(u'CompanyName', u'Deco'), StringStruct(u'FileDescription', u'DLSS Updater'), StringStruct(u'FileVersion', u'3.9.3'), StringStruct(u'InternalName', u'DLSS_Updater'), StringStruct(u'LegalCopyright', u'Copyright (c) Deco'), StringStruct(u'OriginalFilename', u'DLSS_Updater.exe'), StringStruct(u'ProductName', u'DLSS Updater'), StringStruct(u'ProductVersion', u'3.9.3') ]) ]), VarFileInfo([VarStruct(u'Translation', [1033, 1200])]) ] ) ``` -------------------------------- ### Access Concurrency Settings and Cached DLL Paths (Python) Source: https://context7.com/recol/dlss-updater/llms.txt This snippet demonstrates how to access and print concurrency settings like threadpool IO workers, IO heavy operations, and IO extreme operations. It also shows how to iterate through and display cached DLL names and their corresponding paths after cache initialization. ```python print(f"\nConcurrency Settings:") print(f" Threadpool IO workers: {Concurrency.THREADPOOL_IO}") print(f" IO Heavy operations: {Concurrency.IO_HEAVY}") print(f" IO Extreme operations: {Concurrency.IO_EXTREME}") print(f"\nCached DLL Paths:") for dll_name, path in LATEST_DLL_PATHS.items(): if path: print(f" {dll_name}: {path}") ``` -------------------------------- ### Run Batch Game Updates Source: https://context7.com/recol/dlss-updater/llms.txt Executes a batch update process for multiple games. This function is asynchronous and relies on the asyncio library. It loads source DLLs, checks versions, creates backups, applies updates, and verifies the changes. The output provides a summary of the update process, including success counts, duration, and peak memory usage. ```python asyncio.run(batch_update_games()) ``` -------------------------------- ### Execute High-Performance Batch DLL Updates - Python Source: https://context7.com/recol/dlss-updater/llms.txt This Python snippet demonstrates how to perform high-performance batch updates for multiple DLLs across different games. It includes checking system memory for compatibility, defining update tasks, executing the updates using `HighPerformanceUpdateManager`, and handling potential `MemoryPressureError` exceptions. Progress callbacks are supported. ```python import asyncio from dlss_updater.high_performance_updater import ( HighPerformanceUpdateManager, DLLTask, check_memory_for_high_performance_mode, MemoryPressureError ) async def batch_update_games(): # Check if system can support high-performance mode can_use, reason = check_memory_for_high_performance_mode() print(f"High-performance mode: {reason}") # Define update tasks for multiple games tasks = [ DLLTask( target_path="/games/Cyberpunk 2077/bin/x64/nvngx_dlss.dll", source_dll_name="nvngx_dlss.dll", game_name="Cyberpunk 2077", dll_type="DLSS DLL" ), DLLTask( target_path="/games/Control/nvngx_dlss.dll", source_dll_name="nvngx_dlss.dll", game_name="Control" ), DLLTask( target_path="/games/Death Stranding/libxess.dll", source_dll_name="libxess.dll", game_name="Death Stranding" ), ] # Progress callback def on_progress(current, total, message): print(f"[{current}/{total}] {message}") # Execute high-performance batch update manager = HighPerformanceUpdateManager() try: result = await manager.execute( dll_tasks=tasks, settings={"CreateBackups": True}, progress_callback=on_progress ) print(f"\n=== Update Results ===") print(f"Mode used: {result.mode_used}") print(f"Updates succeeded: {result.updates_succeeded}") print(f"Updates skipped: {result.updates_skipped}") print(f"Updates failed: {result.updates_failed}") print(f"Backups created: {result.backups_created}") print(f"Duration: {result.duration_seconds:.2f}s") print(f"Peak memory: {result.memory_peak_mb:.1f}MB") # Show detailed update info for update in result.detailed_updates: print(f" Updated {update['game_name']}: " f"{update['old_version']} -> {update['new_version']}") for error in result.errors: print(f" Error in {error['phase']}: {error['error']}") except MemoryPressureError as e: print(f"Memory pressure too high ({e.percent_used:.1f}%)", "falling back to standard update mode") asyncio.run(batch_update_games()) ``` -------------------------------- ### Steam Integration: Fetch Game Artwork and Detect App IDs (Python) Source: https://context7.com/recol/dlss-updater/llms.txt This Python module integrates with Steam to fetch game header images from the Steam CDN, maintain a searchable database of Steam apps using FTS5, and detect Steam app IDs from game directories via manifest files. It handles image caching and format conversion to WebP thumbnails. ```python import asyncio from pathlib import Path from dlss_updater.steam_integration import ( steam_integration, find_steam_app_id_by_name, detect_steam_app_id_from_manifest, fetch_steam_image, search_steam_apps, update_steam_app_list_if_needed, migrate_image_cache_if_needed ) async def steam_features(): # Initialize Steam app list (downloads if needed) await update_steam_app_list_if_needed() # Migrate image cache to WebP format (one-time) migrated = await migrate_image_cache_if_needed() if migrated: print("Image cache migrated to WebP format") # Find Steam app ID by game name (FTS5 search) app_id = await find_steam_app_id_by_name("Cyberpunk 2077") print(f"Cyberpunk 2077 App ID: {app_id}") # Detect app ID from game directory manifest game_dir = Path("/home/user/.steam/steam/steamapps/common/Cyberpunk 2077") manifest_app_id = await detect_steam_app_id_from_manifest(game_dir) print(f"App ID from manifest: {manifest_app_id}") # Search Steam apps results = await search_steam_apps("witcher", limit=5) print("\nSearch results for 'witcher':") for app_id, name in results: print(f" {app_id}: {name}") # Fetch game header image (downloads and converts to WebP thumbnail) if app_id: image_path = await fetch_steam_image(app_id) if image_path: print(f"\nFetched image: {image_path}") print(f"Image size: {image_path.stat().st_size / 1024:.1f} KB") # Queue multiple image downloads concurrently app_ids_to_fetch = [1091500, 870780, 1190460, 1475810, 990080] await steam_integration.queue_image_downloads(app_ids_to_fetch) print(f"\nQueued {len(app_ids_to_fetch)} image downloads") # Output: # Cyberpunk 2077 App ID: 1091500 # App ID from manifest: 1091500 # # Search results for 'witcher': # 292030: The Witcher 3: Wild Hunt # 499450: The Witcher 3: Wild Hunt - Blood and Wine # 378649: The Witcher 3: Wild Hunt - Hearts of Stone # 20900: The Witcher: Enhanced Edition # 1281100: The Witcher: Monster Slayer # # Fetched image: /home/user/.config/DLSS-Updater/steam_images/1091500.webp # Image size: 12.4 KB # Queued 5 image downloads asyncio.run(steam_features()) ``` -------------------------------- ### Run DLSS Updater Management Source: https://context7.com/recol/dlss-updater/llms.txt Executes the main management function for DLSS Updater using asyncio. This is the primary entry point for running the application's core logic. ```python import asyncio asyncio.run(whitelist_management()) ``` -------------------------------- ### Detect NVIDIA GPU Architecture with NVML Source: https://context7.com/recol/dlss-updater/llms.txt This Python code snippet demonstrates how to detect NVIDIA GPU presence and identify its architecture using the nvidia-ml-py library. It checks for DLSS overlay support based on the detected architecture, such as Ada Lovelace and newer GPUs. The function also handles cleanup of NVML resources. ```python import asyncio from dlss_updater.gpu_detection import ( detect_nvidia_gpu, is_nvidia_gpu_present, cleanup_nvml ) from dlss_updater.models import GPUArchitecture async def detect_gpu(): # Quick check for NVIDIA GPU presence has_nvidia = await is_nvidia_gpu_present() print(f"NVIDIA GPU present: {has_nvidia}") if has_nvidia: # Full GPU detection with architecture info gpu_info = await detect_nvidia_gpu() if gpu_info: print(f"\n=== GPU Information ===") print(f"Name: {gpu_info.name}") print(f"Architecture: {gpu_info.architecture}") print(f"SM Version: {gpu_info.sm_version_major}.{gpu_info.sm_version_minor}") print(f"VRAM: {gpu_info.vram_mb} MB") print(f"Driver: {gpu_info.driver_version}") print(f"Detection method: {gpu_info.detection_method}") # Check architecture for feature support if gpu_info.architecture in ["Ada", "Blackwell"]: print("\nDLSS Overlay supported (RTX 40/50 series)") elif gpu_info.architecture in ["Turing", "Ampere"]: print("\nDLSS supported (RTX 20/30 series)") else: print("\nDLSS not supported on this GPU") # Cleanup NVML resources on shutdown await cleanup_nvml() asyncio.run(detect_gpu()) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.