【问题标题】:How to verify Tensorflow Serving is using GPUs on a GPU instance?如何验证 Tensorflow Serving 是否在 GPU 实例上使用 GPU?
【发布时间】:2017-03-06 16:31:51
【问题描述】:

在运行 Tensorflow Serving 时,如何验证它使用 GPU 进行服务? 在 ./configure 期间配置 Tensorflow 以使用 GPU。

尝试在运行推理时监控 nvidia-smi,它显示未找到正在运行的进程。

【问题讨论】:

    标签: tensorflow tensorflow-serving


    【解决方案1】:

    首先,在./configure的时候当然需要配置使用cuda

    其次,你应该编译 tf serving 使用

    bazel build -c opt --config=cuda tensorflow/...

    和

    bazel build -c opt --config=cuda --spawn_strategy=standalone //tensorflow_serving/model_servers:tensorflow_model_server

    最后,如果使用 GPU 服务,您可以在服务模型时看到信息:

    我 外部/org_tensorflow/tensorflow/core/common_runtime/gpu/gpu_device.cc:965] 找到具有属性的设备 0:名称:GeForce GTX 1070 主要:6 次要: 1 memoryClockRate(GHz): 1.721 pciBusID: 0000:01:00.0 totalMemory: 7.92GiB 免费内存:7.76GiB 我外部/org_tensorflow/tensorflow/core/common_runtime/gpu/gpu_device.cc:1055] 创建 TensorFlow 设备 (/device:GPU:0) -> (设备: 0, 名称: GeForce GTX 1070, pci bus id: 0000:01:00.0, 计算能力: 6.1)

    同时检查nvidia-smi

    +--------------------------------------------- -------------------------------------------------- ----------------------------+ |进程:______________________________________________________GPU 内存 |
    | GPU _______ PID ______ 类型 _______ 进程名称 _____________ 用法 | |=================================================== ======================---| | 0 _________1215________G ________/usr/lib/xorg/Xorg_______________________59MiB | | 0 _________ 7341_______ C ___ ...ing/model_servers/tensorflow_model_server __7653MiB | +-------------------------------------------------- -------------------------------------------------- -------------------------------------+

    GPU 消耗很大。

    【讨论】:

    猜你喜欢
    • 2017-07-20
    • 1970-01-01
    • 2020-07-09
    • 1970-01-01
    • 2017-10-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多