google / caliban

Research workflows made easy, locally and in the Cloud.
https://caliban.readthedocs.io
Apache License 2.0
494 stars 67 forks source link

Make caliban fall back to cpu-only gracefully for local or shell commands #96

Open dfurrer opened 4 years ago

dfurrer commented 4 years ago

Currently if a user runs caliban shell either on a Mac they get this message:

'caliban shell' doesn't support GPU usage on Macs! Please pass --nogpu to use this command.

If they do so on a linux machine without GPU they get:

...
I1029 12:21:05.082031 139972099938112 run.py:335] Running command: docker run --runtime nvidia --ipc host -w /usr/app -u 102880:89939 -v /google/src/cloud/danielfurrer/xcloud/google3/learning/brain/frameworks/xcloud/examples/huggingface:/usr/app -it --entrypoint /bin/bash -v /usr/local/google/home/danielfurrer:/home/danielfurrer 5cc9af84e5cd
docker: Error response from daemon: Unknown runtime specified nvidia.

Would it be reasonable to just detect what runtimes are available and fall back to the behavior of --nogpu (perhaps with a warning)?

sritchie commented 4 years ago

@dfurrer , this is a great suggestion - I've done some work that will make it easy to specify the default for your machine or project in your .calibanconfig.json, but auto-detection with a warning is a great UI suggestion. Let me see what we can do.