# HF Accelerate uses multiple GPUs even when setting \`num\_processes\` to 1

**URL:** <https://discuss.huggingface.co/t/hf-accelerate-uses-multiple-gpus-even-when-setting-num-processes-to-1/100497>\
**Category:** 🤗Accelerate\
**Created:** [August 2, 2024, 12:52am UTC](https://discuss.huggingface.co/t/hf-accelerate-uses-multiple-gpus-even-when-setting-num-processes-to-1/100497 "2024-08-02T00:52:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![seanswyi](https://avatars.discourse-cdn.com/v4/letter/s/6f9a4e/32.png) [@seanswyi](https://discuss.huggingface.co/u/seanswyi)\
**Post date:** [August 2, 2024, 12:52am UTC](https://discuss.huggingface.co/t/hf-accelerate-uses-multiple-gpus-even-when-setting-num-processes-to-1/100497/1 "2024-08-02T00:52:32Z")

</div>

My machine has four GPU devices. When I’m running the training script, I’m using `accelerate launch --num_processes 1 train.py`. However, I’m getting the device mismatch error saying that some tensors are on device-0 when they should be on 2 or something like that.

I would think that setting `num_processes` to 1 should prevent this. Is this a design choice?

I can prevent this error by adding `CUDA_VISIBLE_DEVICES=$DEVICE_ID` in front of the launch command but that’s a separate issue.

Thanks!
