Improved readability and comments.

This commit is contained in:
Marc-Andre Ferland 2022-10-29 00:43:02 -04:00
parent 902ccbd203
commit 9f5202fee3

View File

@ -407,8 +407,10 @@ display_warning = False
if task_manager.is_alive() <= 0: # Either no defauls or no devices after loading config.
# Select best GPU device using free memory, if more than one device.
if task_manager.start_render_thread('auto'): # Detect best device for renders
if task_manager.is_alive(0) <= 0 and task_manager.is_alive('cpu') <= 0: # is not cuda:0 and auto didnt use CPU.
if task_manager.start_render_thread('cuda'): # An other cuda device is better and cuda:0 is missing, start it...
if task_manager.is_alive(0) <= 0: # has no cuda:0
if task_manager.is_alive('cpu') >= 1: # auto used CPU.
pass # Maybe add warning here about CPU mode...
elif task_manager.start_render_thread('cuda'): # An other cuda device is better and cuda:0 is missing, try to start it...
display_warning = True # And warn user to update settings...
else:
print('Failed to start GPU:0...')