lllyasviel / lllyasviel/sd-forge-layerdiffuse
Command "set COMMANDLINE_ARGS="--device-id=1" does not work
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.1k
- Forks
- 352
- PR merge metrics
- No merged PRs in 30d
Description
I have gpu 0 rtx 4090, the rest are 3090.
_Launching Web UI with arguments: --device-id=1
Total VRAM 24564 MB, total RAM 130950 MB
pytorch version: 2.1.2+cu121
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 4090 : native_
Despite the command, it still uses my GPU 0 - 4090.
I want to run stable diffusion forge on my second GPU. How to achieve this?
Automatic1111 I used previously did so.
I use **\stable-diffusion-webui-forge run.bat** windows batch file to run it.
I edit **\stable-diffusion-webui-forge\webui webui-user.bat** to set which GPU to use.
```
@echo off
set PYTHON=
set GIT=
set VENV_DIR=
set COMMANDLINE_ARGS="--device-id=1"
@REM Uncomment following code to reference an existing A1111 checkout.
@REM set A1111_HOME=Your A1111 checkout dir
@REM
@REM set VENV_DIR=%A1111_HOME%/venv
@REM set COMMANDLINE_ARGS=%COMMANDLINE_ARGS% ^
@REM --ckpt-dir %A1111_HOME%/models/Stable-diffusion ^
@REM --hypernetwork-dir %A1111_HOME%/models/hypernetworks ^
@REM --embeddings-dir %A1111_HOME%/embeddings ^
@REM --lora-dir %A1111_HOME%/models/Lora
call webui.bat
```
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how webui-user.bat passes COMMANDLINE_ARGS to webui.bat, then inspect how the --device-id value is parsed during startup. Use the reported batch-file configuration and startup output as the reproduction case. Done means the launch selects the requested second GPU rather than cuda:0.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100