nunchaku icon indicating copy to clipboard operation
nunchaku copied to clipboard

Set gpu index doesn't work

Open shencuifeng opened this issue 9 months ago • 4 comments

When I set device=torch.device("cuda:1") it still load the model to cuda:0, how to load the model to different gpus?

shencuifeng avatar Feb 19 '25 11:02 shencuifeng

Are you using comfyui or diffusers? Could you also share the context?

lmxyy avatar Feb 19 '25 18:02 lmxyy

I am using diffusers, and the code is:

device="cuda:1"
device=torch.device(device)
transformer = NunchakuFluxTransformer2dModel.from_pretrained("mit-han-lab/svdq-int4-flux.1-dev", device=device)

but it still load the model to device 'cuda:0'

shencuifeng avatar Feb 20 '25 01:02 shencuifeng

I see. Could you set the CUDA_VISIBLE_DEVICES first? We are fixing this.

lmxyy avatar Feb 20 '25 03:02 lmxyy

Just a heads-up: this issue will be resolved in the next v0.2.0 release. I will let you know then.

lmxyy avatar Mar 10 '25 23:03 lmxyy

@lmxyy any update?

ita9naiwa avatar Apr 19 '25 10:04 ita9naiwa

Got fixed in main branch.

lmxyy avatar Apr 20 '25 02:04 lmxyy

This issue is fixed in v0.3.0dev0.

lmxyy avatar Apr 26 '25 04:04 lmxyy