SillyTavern / SillyTavern-Launcher

Launcher scripts for SillyTavern and ST-Extras.
MIT License
217 stars 59 forks source link

Update Launcher.bat GPU detection code, and others. #81

Closed JaceEthaniel closed 1 month ago

JaceEthaniel commented 1 month ago

As promised... I learned more about batch and have now updated the code for GPU detection in the launcher.bat file, and replaced gpu_info.bat with gpu_info.ps1 because batch is not good at handling/ sorting gpu information. As a result, it is more streamlined and will now pick the GPU with the most VRAM from among all installed gpus, instead of only the last two.

I know. I know. I learned more about batch and so I replaced the batch code with powershell code... but I also made other edits:

I have altered how the GPU information is stored, displayed on the home screen, and how frequently the gpu_info script is called. First, GPU info for the preferred GPU is now stored to the log file without ANSI codes by using the variables set previously (instead of making another call to gpu_info.ps1). Second, the gpuInfo variable is also set using the two variables previously set and is formatted at the same time to include ANSI codes (that way we don't have ANSI codes in places we don't want them). As a result, the gpu_info.ps1 script is only called once at startup and never again; but that is fine since it will always run before the menu is displayed.

I only have one computer, however, so I have not tested it with anything other than a computer with two GPUs. If you have one GPU, or more than two GPUs, you will need to test it.

JaceEthaniel commented 1 month ago

Sorry I didn't manage to get it updated before you merged, but I am also a full time student; so my classes have to come first. I can update my repo as needed to include any changes you make (like if you merge a different pull request first so you can solve other issues), so no need to worry about looking over my pull request right now.

JaceEthaniel commented 1 month ago

Going to actually change other things instead, so this pull request will be redundant. It was just to make the code more efficient, anyway. After looking over my initial PR, I realize that it doesn't just pull from the last two.