# Accelerate on 1 GPU

**URL:** <https://discuss.huggingface.co/t/accelerate-on-1-gpu/16617>\
**Category:** 🤗Accelerate\
**Created:** [April 8, 2022, 12:25pm UTC](https://discuss.huggingface.co/t/accelerate-on-1-gpu/16617 "2022-04-08T12:25:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nielsr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nielsr/32/39617_2.png) [@nielsr](https://discuss.huggingface.co/u/nielsr)\
**Post date:** [April 8, 2022, 12:25pm UTC](https://discuss.huggingface.co/t/accelerate-on-1-gpu/16617/1 "2022-04-08T12:25:13Z")

</div>

Hi,

I wanted to use Accelerate on 1 GPU. I answered the questions as below:

```auto
(env) niels:~/python_projects/community-events-1$ accelerate config
In which compute environment are you running? ([0] This machine, [1] AWS (Amazon SageMaker)): 0
Which type of machine are you using? ([0] No distributed training, [1] multi-CPU, [2] multi-GPU, [3] TPU): 0
Do you want to run your training on CPU only (even if a GPU is available)? [no]:no
Do you want to use DeepSpeed? [yes/NO]: no
How many processes in total will you use? [1]: 1
Do you wish to use FP16 or BF16 (mixed precision)? [NO/fp16/bf16]: no

```

But when printing the environment, use\_cpu is set to True:

```auto
(env) niels@brutasse:~/python_projects/community-events-1$ accelerate env

Copy-and-paste the text below in your GitHub issue

- `Accelerate` version: 0.6.1
- Platform: Linux-5.3.0-64-generic-x86_64-with-glibc2.30
- Python version: 3.9.10
- Numpy version: 1.22.3
- PyTorch version (GPU?): 1.11.0+cu102 (True)
- `Accelerate` default config:
        - compute_environment: LOCAL_MACHINE
        - distributed_type: NO
        - mixed_precision: no
        - use_cpu: True
        - num_processes: 1
        - machine_rank: 0
        - num_machines: 1
        - main_process_ip: None
        - main_process_port: None
        - main_training_function: main
        - deepspeed_config: {}

```

---

<div class="post-metadata">

**Author:** ![nielsr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/nielsr/32/39617_2.png) [@nielsr](https://discuss.huggingface.co/u/nielsr)\
**Post date:** [April 8, 2022, 12:33pm UTC](https://discuss.huggingface.co/t/accelerate-on-1-gpu/16617/2 "2022-04-08T12:33:28Z")

</div>

To reproduce my error, I am running the following script (that uses Accelerate): [community-events/huggan/pytorch/lightweight\_gan at main · huggingface/community-events · GitHub](https://github.com/huggingface/community-events/tree/main/huggan/pytorch/lightweight_gan).

---

<div class="post-metadata">

**Author:** ![anon592430](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@anon592430](https://discuss.huggingface.co/u/anon592430)\
**Post date:** [April 8, 2022, 3:43pm UTC](https://discuss.huggingface.co/t/accelerate-on-1-gpu/16617/3 "2022-04-08T15:43:48Z")

</div>

Thanks!

Should be fixed once this PR is merged: [bug by muellerzr · Pull Request #311 · huggingface/accelerate · GitHub](https://github.com/huggingface/accelerate/pull/311)
