Use CUDA_VISIBLE_DEVICES with accelarator

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

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