2017-03-06 81 views

回答

0

首先,你當然需要配置爲使用CUDA時的./configure

其次,你應該編譯TF使用

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 /型芯/ common_runtime/GPU/gpu_device.cc:965] 實測設備0與屬性:名稱:的GeForce GTX 1070主要:次要6: 1 memoryClockRate(千兆赫): 1.721 pciBusID:0000:01:00.0 totalMemory: 7.92GiB freeMemory:7.76GiB 創建TensorFlow設備(/ device:GPU:0) - 創建TensorFlow設備(/ device:GPU:0) - 創建TensorFlow設備>(設備:0,名稱:GeForce GTX 1070,PCI總線ID:0000:01:00.0,計算能力:6.1)

和c駭入nvidia-smi

+ ---------------------------------- -------------------------------------------------- ---------------------------------------- + |進程:______________________________________________________GPU內存|
| GPU _______ PID ______類型_______進程名稱_______________________用法| | ================================================ ====================== --- | | 0 _________1215________G ________/usr/lib/xorg/Xorg _______________________ 59MiB | | 0 _________ 7341_______ç___ ...荷蘭國際集團/ model_servers/tensorflow_model_server __7653MiB | + ------------------------------------------------ -------------------------------------------------- -------------------------- +

GPU被消耗了很多。