davidADSP / Generative_Deep_Learning_2nd_Edition

The official code repository for the second edition of the O'Reilly book Generative Deep Learning: Teaching Machines to Paint, Write, Compose and Play.
https://www.oreilly.com/library/view/generative-deep-learning/9781098134174/
Apache License 2.0
1.11k stars 418 forks source link

docker issue #5

Closed ShungJhon closed 1 year ago

ShungJhon commented 1 year ago

I've built the docker image successfully. However, when using docker-compose -f docker-compose-gpu.yml up, it returns: Starting generative_deep_learning_2nd_edition_app_1 ... error

ERROR: for generative_deep_learning_2nd_edition_app_1 Cannot start service app: could not select device driver "nvidia" with capabilities: [[gpu]]

ERROR: for app Cannot start service app: could not select device driver "nvidia" with capabilities: [[gpu]]

davidADSP commented 1 year ago

Does you device have a GPU set up? Are you Windows, Mac or Linux?

ShungJhon commented 1 year ago

It's Ubuntu 20.04 and with a GPU with cuda 11.4. @davidADSP

davidADSP commented 1 year ago

Do you have NVIDIA Docker installed? https://github.com/NVIDIA/nvidia-docker

davidADSP commented 1 year ago
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update
sudo apt-get install -y nvidia-docker2
sudo systemctl restart docker

docker run --rm --gpus all nvidia/cuda:11.4-base nvidia-smi

If you see the output from nvidia-smi displaying information about your GPU, then you know the GPU is working correctly.