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

Multi GPU Support #18

Closed
rusty1s opened this issue Aug 21, 2018 · 4 comments
Closed

Multi GPU Support #18

rusty1s opened this issue Aug 21, 2018 · 4 comments

Comments

@rusty1s
Copy link

rusty1s commented Aug 21, 2018

Hi,

do CUDA extensions currently support MultiGPUs? Putting all tensors onto device torch.device('cuda:1') in benchmark.py either yields

RuntimeError: cuda runtime error (77) : an illegal memory access was encountered at /.../pytorch/aten/src/THC/generic/THCTensorCopy.cpp:70

when trying to print out the resulting tensors (e.g. print(new_h)) or prints out only zeros (e.g. print(new_h.cpu().tolist())).

@goldsborough
Copy link
Contributor

Support for different GPU devices should be totally fine. Are you sure that torch.cuda.device_count() is greater than one in your case? Can you also post all the information about PyTorch from the issue template? There may be an issue with your PyTorch version that causes this.

@rusty1s
Copy link
Author

rusty1s commented Aug 22, 2018

torch.cuda.device_count() prints out 2.

  • OS: Ubuntu 16.04
  • PyTorch version: 0.4.1
  • How you installed PyTorch (conda, pip, source): conda
  • Python version: 3.6.5
  • CUDA/cuDNN version: 8.0/6.0
  • GPU models and configuration: 1080Ti
  • GCC version (if compiling from source): 5.4

@rusty1s
Copy link
Author

rusty1s commented Mar 6, 2019

Update: Sorry, you were right! I didn't know I needed to set the device via setCudaDevice for kernels to work properly. It all works fine now :)

@rusty1s rusty1s closed this as completed Mar 6, 2019
@ClementPinard
Copy link
Contributor

For people having trouble with multi gpu support, see https://discuss.pytorch.org/t/c-cuda-extension-with-multiple-gpus/91241

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

3 participants