-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
机器有多个gpu,如何指定特定gpu参与模型训练和预测。 #6725
Comments
你可以设置CUDA_VISIBLE_DEVICES |
Closing due to low activity. Feel free to reopen it. |
@pkuyym 使用nvidia-docker的时候貌似这样不行:
GPU的运行状况:
其他的程序要用GPU也会报out of memory的错。 |
找到答案了。根据 https://github.com/NVIDIA/nvidia-docker/wiki/GPU-isolation-(version-1.0)
这样其他的程序能使用其他的GPU。 |
@luotao1 请问这个问题 nvidia-docker 该如何解决呢? |
@linrio 您好,关于您在mlcommons/training#40 里提到的两个问题,能否每个问题发一个issue给我们呢?我们会在新issue里给予解答。 |
okey! |
@luotao1
我有4块GPU,这只使用到了GPU-0,如何设定 fluid.CUDAPlace() 使得可以使用4块GPU?或者2块GPU? |
@linrio 您可以使用ParallelExecutor:http://paddlepaddle.org/docs/develop/api/fluid/en/fluid.html#permalink-30-parallelexecutor 只需要设置CUDA_VISIBLE_DEVICES就可以了, ParallelExecutor会将数据拷贝GPU端. |
@luotao1 我按照您说的方法修改代码:
但是这个 |
place和使用executor时一样,即 |
@luotao1 我按照您说的修改代码:
并把
改成:
但是报 了错误:
其中,
分别是:
我查看了/paddle/fluid/executor.py 的run() 方法,run()的参数与我传入的无异:
请问我这是什么地方传参数有错误? |
您可以参考 https://github.com/chengduoZH/benchmark/blob/add_resnet_50_v2/fluid/ResNet_50/train_resnet.py#L192 怎么使用parallel_executor |
请问run这个问题解决了吗,遇见了同样的问题 |
类似caffe可以通过指定-gpu选项(如下),实现指定gpu运行,paddle如何完成设置呢?
./build/tools/caffe train --solver=examples/testXXX/solver.prototxt # 使用默认的gpu0
./build/tools/caffe train --solver=examples/testXXX/solver.prototxt --gpu 2
./build/tools/caffe train --solver=examples/testXXX/solver.prototxt --gpu 0,1,2
./build/tools/caffe train --solver=examples/testXXX/solver.prototxt --gpu all
The text was updated successfully, but these errors were encountered: