I has this problem than use docker image - and solution was add flag “–ipc=host” for docker run
nvidia-docker run --rm -ti --ipc=host pytorch-cudnnv6
Full doc for docker image - https://github.com/pytorch/pytorch#docker-image 179