# Use CUDA\_VISIBLE\_DEVICES with accelarator

**URL:** <https://discuss.huggingface.co/t/use-cuda-visible-devices-with-accelarator/9326>\
**Category:** 🤗Accelerate\
**Created:** [August 18, 2021, 1:41pm UTC](https://discuss.huggingface.co/t/use-cuda-visible-devices-with-accelarator/9326 "2021-08-18T13:41:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![debwol](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@debwol](https://discuss.huggingface.co/u/debwol)\
**Post date:** [August 18, 2021, 1:41pm UTC](https://discuss.huggingface.co/t/use-cuda-visible-devices-with-accelarator/9326/1 "2021-08-18T13:41:10Z")

</div>

I try to set CUDA\_VISIBLE\_DEVICES on the command line. But when accelerator set the device, it chose the wrong one. What should I do?  
Thanks

---

<div class="post-metadata">

**Author:** ![sgugger](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/sgugger/32/2291_2.png) [@sgugger](https://discuss.huggingface.co/u/sgugger)\
**Post date:** [August 30, 2021, 6:16pm UTC](https://discuss.huggingface.co/t/use-cuda-visible-devices-with-accelarator/9326/2 "2021-08-30T18:16:18Z")

</div>

How do you know it chose the wrong one? What command did you type exactly?
