Skip to content

Commit 90f4d86

Browse files
authored
Improve GPU driver warning detection (#61)
1 parent 172de67 commit 90f4d86

4 files changed

Lines changed: 680 additions & 20 deletions

File tree

ok/gui/StartController.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,14 @@ def start_device(self):
191191
def check_gpu_driver_post_processing(self):
192192
try:
193193
from ok.util.gpu_driver_settings import get_enabled_gpu_driver_post_processing
194-
enabled_features = get_enabled_gpu_driver_post_processing()
194+
device_manager = getattr(og, 'device_manager', None)
195+
hwnd_window = getattr(device_manager, 'hwnd_window', None)
196+
target_exe_path = getattr(hwnd_window, 'exe_full_path', None) if hwnd_window else None
197+
target_hwnd = getattr(hwnd_window, 'hwnd', None) if hwnd_window else None
198+
if not target_exe_path and device_manager:
199+
device = device_manager.get_preferred_device()
200+
target_exe_path = device.get('full_path') if device else None
201+
enabled_features = get_enabled_gpu_driver_post_processing(target_exe_path, target_hwnd)
195202
except Exception as e:
196203
logger.error(f'check_gpu_driver_post_processing exception: {e}', e)
197204
return
@@ -204,6 +211,7 @@ def check_gpu_driver_post_processing(self):
204211
)
205212
for feature in enabled_features
206213
]
214+
logger.warning('\n'.join(warning_lines))
207215
communicate.notification.emit(
208216
'\n'.join(warning_lines),
209217
self.tr('GPU Driver Warning'),

0 commit comments

Comments
 (0)