lllyasviel / lllyasviel/sd-forge-layerdiffuse

Command "set COMMANDLINE_ARGS="--device-id=1" does not work

Open
#122 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.