add info block and rename

pull/3/head
w-e-w 2023-08-26 20:07:50 +09:00
parent bf614317a0
commit c8d6d12c63
1 changed files with 9 additions and 2 deletions

View File

@ -5,8 +5,15 @@ import subprocess
import time
import re
if hasattr(shared, "OptionHTML"): # < 1.6.0 support
shared.options_templates.update(shared.options_section(('GPU_temperature_protection', "GPU Temperature"), {
"gpu_temps_sleep_temperature_src_explanation": shared.OptionHTML("""<b>NVIDIA - nvidia-smi</b> is available on Windows and Linux.<br>
<b>AMD - ROCm-smi</b> is Linux only
""")
}))
shared.options_templates.update(shared.options_section(('GPU_temperature_protection', "GPU Temperature"), {
"gpu_temps_sleep_temperature_src": shared.OptionInfo("NVIDIA - nvidia-smi", "Temperature source mode", gr.Radio, {"choices": ["NVIDIA - nvidia-smi", "AMD GPU - ROCm-smi Linux only"]}),
"gpu_temps_sleep_temperature_src": shared.OptionInfo("NVIDIA - nvidia-smi", "Temperature source mode", gr.Radio, {"choices": ["NVIDIA - nvidia-smi", "AMD - ROCm-smi"]}),
"gpu_temps_sleep_enable": shared.OptionInfo(True, "Enable GPU temperature protection"),
"gpu_temps_sleep_print": shared.OptionInfo(True, "Print GPU Core temperature while sleeping in terminal"),
"gpu_temps_sleep_minimum_interval": shared.OptionInfo(5.0, "GPU temperature monitor minimum interval", gr.Number).info("won't check the temperature again until this amount of seconds have passed"),
@ -63,7 +70,7 @@ class GPUTemperatureProtection(scripts.Script):
temperature_src_dict = {
"NVIDIA - nvidia-smi": get_gpu_temperature_nvidia_smi,
"AMD GPU - ROCm-smi Linux only": get_gpu_temperature_amd_rocm_smi
"AMD - ROCm-smi": get_gpu_temperature_amd_rocm_smi
}
@staticmethod