TensorFlow serving on GPUs using Docker 19.03 needs gpus flag
Please go to Stack Overflow for help and support:
https://stackoverflow.com/questions/tagged/tensorflow-serving
If you open a GitHub issue, here is our policy:
- It must be a bug, a feature request, or a significant problem with documentation (for small docs fixes please send a PR instead).
- The form below must be filled out.
Here's why we have that policy: TensorFlow developers respond to issues. We want to focus on work that benefits the whole community, e.g., fixing bugs and adding features. Support only helps individuals. GitHub also notifies thousands of people when issues are filed. We want them to see you communicating an interesting problem, rather than being redirected to Stack Overflow.
Bug Report
If this is a bug report, please fill out the following form in full:
The issue was previously filed on tensorflow/tensorflow https://github.com/tensorflow/tensorflow/issues/44597
System information
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 18.04 LTS
- TensorFlow Serving installed from (source or binary): Docker Image
Describe the problem
Since Docker 19.03, you need to install nvidia-container-toolkit package and then use the --gpus all flag. The docker command to run the container with GPUs needs --gpus=all parameter so that the GPU devices are visible within the container. The command should instead be (if we want to assign all available GPUs to docker)
sudo docker run -it -p 8500:8500 --gpus all tensorflow/serving:latest-devel-gpu
If you want to assign specific device then change it to --gpus device=0
Exact Steps to Reproduce
- Go to the link here https://www.tensorflow.org/tfx/serving/building_with_docker#running_a_container
- sudo docker run -it -p 8500:8500 tensorflow/serving:latest-devel-gpu
You'll get the following error: W tensorflow/stream_executor/cuda/cuda_driver.cc:312] failed call to cuInit: UNKNOWN ERROR (303) 2020-11-02 21:06:24.739827: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:163] no NVIDIA GPU device is present: /dev/nvidia0 does not exist
Source code / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem.
Can you send a PR to update the documentation? Happy to review it. Thanks!
@netfs, Please review the CL to fix this. Thanks!