kcosta42 / VQGAN-CLIP-Docker

Zero-Shot Text-to-Image Generation VQGAN+CLIP Dockerized
MIT License
74 stars 17 forks source link

RuntimeError: Found no NVIDIA driver on your system. #1

Closed josephrocca closed 3 years ago

josephrocca commented 3 years ago

Running make generate gives:

Creating vqgan-clip-docker_generate_run ... done
Traceback (most recent call last):
  File "/opt/conda/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/opt/conda/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/app/scripts/generate.py", line 28, in <module>
    std=[0.26862954, 0.26130258, 0.27577711], device=DEVICE)
  File "/app/core/utils/normalize.py", line 25, in __init__
    self.mean = torch.as_tensor(mean, dtype=dtype, device=device)[None, :, None, None]
  File "/opt/conda/lib/python3.7/site-packages/torch/cuda/__init__.py", line 172, in _lazy_init
    torch._C._cuda_init()
RuntimeError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx
ERROR: 1

I haven't really used docker-compose much, but it seems like the --gpus option needs to be passed?

I solved it by manually creating the docker run command based on the compose file, and adding --gpus all:

docker build -t kcosta42-vqgan-clip .
docker run --gpus all -v $PWD/models:/models -v $PWD/configs:/configs -v $PWD/core:/app/core -v $PWD/scripts:/app/scripts -v $PWD/outputs:/outputs -e DEVICE=cuda -it kcosta42-vqgan-clip python -m scripts.generate -c /configs/docker.json