diff --git a/doc/RUN_IN_DOCKER.md b/doc/RUN_IN_DOCKER.md index 708739851b8e3ec5ca8b5e204a68169ec88041b5..48d1d265665fe40a97c6423a34c1e4d9361c850a 100644 --- a/doc/RUN_IN_DOCKER.md +++ b/doc/RUN_IN_DOCKER.md @@ -1,6 +1,6 @@ # How to run PaddleServing in Docker -([简体中文](./RUN_IN_DOCKER_CN.md)|English) +([简体中文](RUN_IN_DOCKER_CN.md)|English) ## Requirements @@ -137,6 +137,13 @@ pip install paddle-serving-server-gpu ### Test example +When running the GPU Server, you need to set the GPUs used by the prediction service through the `--gpu_ids` option, and the CPU is used by default. An error will be reported when the value of `--gpu_ids` exceeds the environment variable `CUDA_VISIBLE_DEVICES`. The following example specifies to use a GPU with index 0: +```shell +export CUDA_VISIBLE_DEVICES=0,1 +python -m paddle_serving_server_gpu.serve --model uci_housing_model --port 9292 --gpu_ids 0 +``` + + Get the trained Boston house price prediction model by the following command: ```bash @@ -180,4 +187,9 @@ tar -xzf uci_housing.tar.gz print(fetch_map) ``` - + + + +## Attention + +The images provided by this document are all runtime images, which do not support compilation. If you want to compile from source, refer to [COMPILE](COMPILE.md). diff --git a/doc/RUN_IN_DOCKER_CN.md b/doc/RUN_IN_DOCKER_CN.md index 9f2abba176ca89f6d03d9602c2fd1e7d4a78980b..8800b3a30690e03fce739714af1f24a3c8333b7f 100644 --- a/doc/RUN_IN_DOCKER_CN.md +++ b/doc/RUN_IN_DOCKER_CN.md @@ -129,12 +129,13 @@ pip install paddle-serving-server-gpu ### 测试example -GPU版本在运行Server端代码前需要设置`CUDA_VISIBLE_DEVICES`环境变量来指定预测服务使用的GPU,下面的示例为指定索引为0和1两块GPU: - -```bash - export CUDA_VISIBLE_DEVICES=0,1 +在运行GPU版Server时需要通过`--gpu_ids`选项设置预测服务使用的GPU,缺省状态默认使用CPU。当设置的`--gpu_ids`超出环境变量`CUDA_VISIBLE_DEVICES`时会报错。下面的示例为指定使用索引为0的GPU: +```shell +export CUDA_VISIBLE_DEVICES=0,1 +python -m paddle_serving_server_gpu.serve --model uci_housing_model --port 9292 --gpu_ids 0 ``` + 通过下面命令获取训练好的Boston房价预估模型: ```bash @@ -177,3 +178,7 @@ tar -xzf uci_housing.tar.gz fetch_map = client.predict(feed={"x": data}, fetch=["price"]) print(fetch_map) ``` + +## 注意事项 + +该文档提供的镜像均为运行镜像,不支持开发编译。如果想要从源码编译,请查看[如何编译PaddleServing](COMPILE.md)。