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 GPU with stack, docker, nvidia-docker #157

Merged
merged 1 commit into from
Oct 22, 2017

Conversation

jcberentsen
Copy link
Contributor

This procedure is a bit convoluted, but possible to get utilisation of GPU this way.

@tensorflow-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@fkm3
Copy link
Contributor

fkm3 commented Oct 19, 2017

Jenkins, test this please.

README.md Outdated
@@ -82,6 +82,17 @@ There is also a demo application:
cd tensorflow-mnist
stack --docker --docker-image=$IMAGE_NAME build --exec Main

If you want to use GPU you can do:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a header like

### Docker GPU Support

so that it easier to scan through the docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing

README.md Outdated

We need stack to use nvidia-docker by using a 'docker' wrapper script.

ln -s `pwd`/tools/nvidia-docker-wrapper.sh <somewhere in your path>/docker
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is worth including a note that this will shadow the normal docker command.

Filed commercialhaskell/stack#3499 to ask for a nicer way to do this.

(Also, interestingly, I stumbled upon a blog in Japanese where someone documented another workaround, but this one seems simpler: https://shigekikarita.github.io/blog/2017/07/08/023.html)

Copy link
Contributor Author

@jcberentsen jcberentsen Oct 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add a note. I have heard rumours that nvidia-docker v2 will be integrated into docker proper. I don't have a source for this. At least a way to invoke it nicely... so we won't even need the nvidia-docker wrapper. Crossing fingers :)

# Support output of Unicode characters.
RUN dpkg-reconfigure locales && \
locale-gen en_US.UTF-8 && \
update-locale LANG=en_US.UTF-8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix the indentation here and above?

Copy link
Contributor Author

@jcberentsen jcberentsen Oct 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do!

I am in the process of testing your upgrade (#161) to 1.3 now, and will update this PR as necessary.

@fkm3
Copy link
Contributor

fkm3 commented Oct 20, 2017

Jenkins, test this please.

@fkm3
Copy link
Contributor

fkm3 commented Oct 20, 2017

The changes LGTM, let me know when you think it is ready to merge. Thanks!

@jcberentsen
Copy link
Contributor Author

I think it is ready to merge now. I got it working with tensorflow-gpu:1.3.0.

@blackgnezdo
Copy link
Contributor

Jenkins, test this please.

@@ -1,6 +1,6 @@
# Prepare the image with:
# docker build -t tensorflow/haskell:v0 docker
FROM tensorflow/tensorflow:1.0.0
FROM tensorflow/tensorflow:1.3.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I missed this when doing the update. Did using the old image cause any problems for you? It seems to work fine for me with 1.0.0 (but we should update it of course).

@fkm3 fkm3 merged commit 5c11ce1 into tensorflow:master Oct 22, 2017
@jcberentsen jcberentsen deleted the dockergpu branch April 8, 2019 07:38
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

Successfully merging this pull request may close these issues.

5 participants