tobegit3hub / simple_tensorflow_serving

Generic and easy-to-use serving service for machine learning models
https://stfs.readthedocs.io
Apache License 2.0
757 stars 195 forks source link

docker1.7 can support GPU? #54

Closed tradysun closed 3 years ago

tradysun commented 5 years ago

My linux system is centos6.3, which only support docker1.7, and does not support nvidia-docker(need docker>=1.13). How to run simple tensorflow serving with GPU?

tobegit3hub commented 3 years ago

It's not the issue of simple tensorflow serving. But yes, you can run docker container with GPU devices without nvidia-docker. Please refer to the older document of TensorFlow in https://github.com/tensorflow/tensorflow/tree/r1.8/tensorflow/tools/docker .

This may work for docker image for simple tensorflow serving as well.

$ export CUDA_SO=$(\ls /usr/lib/x86_64-linux-gnu/libcuda.* | xargs -I{} echo '-v {}:{}')
$ export DEVICES=$(\ls /dev/nvidia* | xargs -I{} echo '--device {}:{}')
$ docker run -it -p 8888:8888 $CUDA_SO $DEVICES tensorflow/tensorflow:latest-gpu