Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

docker file gpu added #27

Merged
merged 2 commits into from
Mar 29, 2020
Merged

Conversation

muaz-urwa
Copy link

No description provided.

@muaz-urwa muaz-urwa mentioned this pull request Mar 28, 2020
@andrewjong
Copy link
Owner

Nice!! Many thanks @muaz-urwa. I'll verify it on my machine later today, and update the README to mention this.

@muaz-urwa
Copy link
Author

Sure. Let me know if you face any issues.
Few pointers:

  1. This is the docker command I used:
    docker run -it -v ${PWD}/checkpoints:/app/SwapNet/checkpoints -v ${PWD}/data:/app/SwapNet/data -v ${PWD}/results:/app/SwapNet/results --gpus all swapnet

So I am mounting the data, model and results folders.

  1. After running the docker:
    a) cd into Swapnet
    b) source activate swapnet
  1. Inference command:
    python inference.py --checkpoint checkpoints/deep_fashion
    --dataroot data/deep_fashion
    --shuffle_data True

  2. If you face issues with roialign, and the error says that it was not compiled with GPU support. Then GPU was not available while building the image. In this case few checks at the end of dockerfile (last three commands) will have incorrect output. See comments in docker file. If this happens set your default docker runtime to nvida following instructions here.

@andrewjong
Copy link
Owner

andrewjong commented Mar 29, 2020

For me it crashes on /bin/sh: 1: nvidia-smi: not found. I think nvidia-smi may not be able to run during the image build; do you have knowledge on this @muaz-urwa ? Perhaps we can move checking nvidia-smi to post-installation instructions.

@andrewjong andrewjong changed the base branch from master to feat/docker March 29, 2020 18:25
@andrewjong
Copy link
Owner

I updated this PR to merge into this repo's feat/docker branch, as I want to make some edits. Thanks for your hard work Urwa, this will be merged into master soon.

@andrewjong andrewjong merged commit c779df3 into andrewjong:feat/docker Mar 29, 2020
@muaz-urwa
Copy link
Author

Okay. In that case try this:
Only way to have gpu acess during build is to set default docker runtime as nvidia. We need gpu access during build to compile roi library with gpu support.

Find the file: /etc/docker/daemon.json
and add "default-runtime": "nvidia" as shown below.

my /etc/docker/daemon.json
{
"runtimes": {
"nvidia": {
"path": "nvidia-container-runtime",
"runtimeArgs": []
}
},
"default-runtime": "nvidia"
}

@andrewjong
Copy link
Owner

andrewjong commented Mar 29, 2020

Alternatively, I can host this docker image on Dockerhub. Then people don't need a GPU to build and can just pull the image.

Great suggestion for building with GPU though.

@muaz-urwa
Copy link
Author

Also you will need to install nvidia-docker to acess gpu devices from containers. Here is their repo : link

I kept these checks in docker file to make sure that gpus were accesible during build, otherwise roi align would crash later on.

Yes, hosting seems to be a good idea.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants