在docker中创建一个tensorflow-serving:latest-gpu容器时,报出如下BUG:
tensorflow_model_server: error while loading shared libraries: libcuda.so.1:
cannot open shared object file: No such file or directory
解决方法1:
安装nvidia-docker,教程见:https://github.com/NVIDIA/nvidia-docker
创建容器时,添加参数:–runtime=nvidia
问题解决!
安装nvidia-docker过程中可能遇到如下题:/opt/anaconda3/envs/py36/lib/liblzma.so.5: version `XZ_5.1.2alpha’ not found (required by /lib64/librpmio.so.3)
解决方法:
下载liblzma.so.5.2.2文件(https://github.com/u-root/midori/tree/master/lib/x86_64-linux-gnu)复制到/opt/anaconda3/envs/py36/lib目录下
执行软连接:sudo ln -s -f liblzma.so.5.2.2 liblzma.so.5
问题解决,继续执行安装过程。
解决方法2:
重新拉取镜像:docker pull tensorflow/serving:latest-devel-gpu
创建容器:docker run -it tensorflow/serving:lates