CUDA_VISIBLE_DEVICES 无法指定 GPU
ArminLee opened this issue · 3 comments
ArminLee commented
我使用 CUDA_VISIBLE_DEVICES=3 python train.py
后,仍然会判断 GPU 0 的占用情况,无法用其他卡训练。请问怎么指定 GPU 进行训练呢?报错如下(GPU0正在使用)
Out of memory error on GPU 0. Cannot allocate 27.000000MB memory on GPU 0, 10.744995GB memory has been allocated and available memory is only 16.562500MB.
Please check whether there is any other process using GPU 0.
- If yes, please stop them, or start PaddlePaddle on another GPU.
- If no, please decrease the batch size of your model.
If the above ways do not solve the out of memory problem, you can try to use CUDA managed memory. The command isexport FLAGS_use_cuda_managed_memory=false
.
(at /paddle/paddle/fluid/memory/allocation/cuda_allocator.cc:87)
. (at /paddle/paddle/fluid/imperative/tracer.cc:307)
yeyupiaoling commented
不应该把,GPU 0应该是在你CUDA_VISIBLE_DEVICES知道的第一个。
yeyupiaoling commented
你改小batch_size试试看
ArminLee commented
嗯嗯,确实是内存不够的问题,谢谢!