-
Notifications
You must be signed in to change notification settings - Fork 198
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
Conversation
Can one of the admins verify this patch? |
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: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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 :)
docker/gpu/Dockerfile
Outdated
# Support output of Unicode characters. | ||
RUN dpkg-reconfigure locales && \ | ||
locale-gen en_US.UTF-8 && \ | ||
update-locale LANG=en_US.UTF-8 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
4ad30ba
to
9765220
Compare
Jenkins, test this please. |
The changes LGTM, let me know when you think it is ready to merge. Thanks! |
9765220
to
5c28a58
Compare
I think it is ready to merge now. I got it working with tensorflow-gpu:1.3.0. |
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 |
There was a problem hiding this comment.
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).
This procedure is a bit convoluted, but possible to get utilisation of GPU this way.