Skip to content

Error using cuda in docker container #1771

@devendrachaplot

Description

@devendrachaplot

I used the Dockerfile to build pytorch
docker build -t pytorch .
and ran the image with
nvidia-docker run --rm -ti --ipc=host pytorch

Inside the container, I get an error using cuda:

import torch
x = torch.rand(1).cuda()

THCudaCheck FAIL file=/tmp/pip-b1neh3fv-build/torch/lib/THC/THCGeneral.c line=66 error=30 : unknown error
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/conda/envs/pytorch-py35/lib/python3.5/site-packages/torch/_utils.py", line 65, in _cuda
    return new_type(self.size()).copy_(self, async)
  File "/opt/conda/envs/pytorch-py35/lib/python3.5/site-packages/torch/cuda/__init__.py", line 266, in _lazy_new
    _lazy_init()
  File "/opt/conda/envs/pytorch-py35/lib/python3.5/site-packages/torch/cuda/__init__.py", line 85, in _lazy_init
    torch._C._cuda_init()
RuntimeError: cuda runtime error (30) : unknown error at /tmp/pip-b1neh3fv-build/torch/lib/THC/THCGeneral.c:66

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions