Skip to content
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

how to use multiple gpus for testing #2616

Closed
zhuolinumd opened this issue Jun 17, 2015 · 4 comments
Closed

how to use multiple gpus for testing #2616

zhuolinumd opened this issue Jun 17, 2015 · 4 comments

Comments

@zhuolinumd
Copy link

Currently I have a machine with multiple GPUs, when I try to run the python scripts (warpper for Caffe) in parallel for feature extraction (feed-foward process), all scripts use the GPU0. What can I do if I want my python script can select the avaliable GPU dynamically? I don't want to manually specify gpu device id in the script. Thank you

@lukeyeager
Copy link
Contributor

👍

Except that I would be happy to set the GPU manually. I just want some control.

@longjon
Copy link
Contributor

longjon commented Jun 19, 2015

Closing as I can't discern a reasonable issue or feature request here; caffe supports GPU selection in Python with caffe.set_device, and GPU selection is always possible for CUDA applications by using CUDA_VISIBLE_DEVICES. Determining available devices seems outside the scope of Caffe. We might be able to provide that as a convenience, but as far as I know there's no robust way to obtain such information.

In general, please ask usage questions on the caffe-users list. Thanks!

@longjon longjon closed this as completed Jun 19, 2015
@lukeyeager
Copy link
Contributor

caffe supports GPU selection in Python with caffe.set_device

That's all I need, thanks!

@mrgransky
Copy link

Having 4 GPUs and Setting

caffe.set_device([0,1,2,3])
caffe.set_mode_gpu()

in TEST phase, gives me this error:

Traceback (most recent call last):
  File "nordland_dl.py", line 23, in <module>
    caffe.set_device([0,1,2,3])
Boost.Python.ArgumentError: Python argument types in
    caffe._caffe.set_device(list)
did not match C++ signature:
    set_device(int)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants