derrian-distro / LoRA_Easy_Training_Scripts

A UI made in Pyside6 to make training LoRA/LoCon and other LoRA type models in sd-scripts easy
GNU General Public License v3.0
998 stars 101 forks source link

How to run on second GPU? #205

Closed trihardseven closed 2 months ago

trihardseven commented 2 months ago

I want to run the training on a second GPU. Any idea how to do that? It always defaults to my main GPU.

Jelosus2 commented 2 months ago
  1. Go to the folder of the trainer.
  2. Right click on run.bat file and click edit.
  3. Replace it's content with
    
    @echo off

title LoRA Trainer cd %~dp0 call sd_scripts\venv\Scripts\activate set CUDA_VISIBLE_DEVICES=1 python main.py pause


4. Save the file and run it again.
5. Enjoy.

**Note:** If it uses the wrong GPU edit the line to this `set CUDA_VISIBLE_DEVICES=0`