hello_query_device(ubuntu編)

サンプルを片っ端から実行していくシリーズ。今回はhello_query_deviceのサンプルを実行してみます。実行結果が長いので記事はOS別に記載します。

サンプルは以下のフォルダになります。
openvino\inference_engine\samples\python\hello_query_device

実行の前に

サンプルを実行する前に、READMEファイルを確認しておきましょう。このサンプルはOpenVINOで使用出来るデバイスの情報を取得するものなので凄くシンプルです。

モデル

今回のサンプルはモデルは不要です。

環境

UP Squared AI Edge Computing with Intel ATOM で実行しました。

実行

環境変数の設定をしていない場合は、コマンドラインで以下を実行します。/opt/intel/openvino/bin/setupvars.sh

以下のコマンドでhello_query_deviceを実行します。

cd /opt/intel/openvino/deployment_tools/inference_engine/samples/python/hello_query_device % python3 hello_query_device.py

実行例(NCS2無し)

Available devices:
	Device: CPU
	Metrics:
		AVAILABLE_DEVICES: 
		SUPPORTED_METRICS: AVAILABLE_DEVICES, SUPPORTED_METRICS, FULL_DEVICE_NAME, OPTIMIZATION_CAPABILITIES, SUPPORTED_CONFIG_KEYS, RANGE_FOR_ASYNC_INFER_REQUESTS, RANGE_FOR_STREAMS
		FULL_DEVICE_NAME: Intel(R) Atom(TM) Processor E3950 @ 1.60GHz
		OPTIMIZATION_CAPABILITIES: FP32, INT8, BIN
		SUPPORTED_CONFIG_KEYS: CPU_BIND_THREAD, CPU_THREADS_NUM, CPU_THROUGHPUT_STREAMS, DUMP_EXEC_GRAPH_AS_DOT, DYN_BATCH_ENABLED, DYN_BATCH_LIMIT, EXCLUSIVE_ASYNC_REQUESTS, PERF_COUNT
		RANGE_FOR_ASYNC_INFER_REQUESTS: 1, 1, 1
		RANGE_FOR_STREAMS: 1, 4

	Default values for device configuration keys:
		CPU_BIND_THREAD: YES
		CPU_THREADS_NUM: 0
		CPU_THROUGHPUT_STREAMS: 1
		DUMP_EXEC_GRAPH_AS_DOT: 
		DYN_BATCH_ENABLED: NO
		DYN_BATCH_LIMIT: 0
		EXCLUSIVE_ASYNC_REQUESTS: NO
		PERF_COUNT: NO
	Device: GPU
	Metrics:
		AVAILABLE_DEVICES: 0
		SUPPORTED_METRICS: AVAILABLE_DEVICES, SUPPORTED_METRICS, FULL_DEVICE_NAME, OPTIMIZATION_CAPABILITIES, SUPPORTED_CONFIG_KEYS, RANGE_FOR_ASYNC_INFER_REQUESTS, RANGE_FOR_STREAMS
		FULL_DEVICE_NAME: Intel(R) Gen9 HD Graphics
		OPTIMIZATION_CAPABILITIES: FP32, BIN, FP16, INT8
		SUPPORTED_CONFIG_KEYS: CLDNN_MEM_POOL, CLDNN_NV12_TWO_INPUTS, CLDNN_PLUGIN_PRIORITY, CLDNN_PLUGIN_THROTTLE, DEVICE_ID, DUMP_KERNELS, DYN_BATCH_ENABLED, EXCLUSIVE_ASYNC_REQUESTS, GPU_THROUGHPUT_STREAMS, PERF_COUNT, TUNING_MODE
		RANGE_FOR_ASYNC_INFER_REQUESTS: 1, 2, 1
		RANGE_FOR_STREAMS: 1, 2

	Default values for device configuration keys:
		CLDNN_MEM_POOL: YES
		CLDNN_NV12_TWO_INPUTS: NO
		CLDNN_PLUGIN_PRIORITY: 0
		CLDNN_PLUGIN_THROTTLE: 0
		DEVICE_ID: 
		DUMP_KERNELS: NO
		DYN_BATCH_ENABLED: NO
		EXCLUSIVE_ASYNC_REQUESTS: NO
		GPU_THROUGHPUT_STREAMS: 1
		PERF_COUNT: NO
		TUNING_MODE: TUNING_DISABLED
	Device: HDDL
	Metrics:
		AVAILABLE_DEVICES: 
		SUPPORTED_METRICS: AVAILABLE_DEVICES, SUPPORTED_METRICS, SUPPORTED_CONFIG_KEYS, FULL_DEVICE_NAME, OPTIMIZATION_CAPABILITIES, RANGE_FOR_ASYNC_INFER_REQUESTS, VPU_HDDL_DEVICE_NUM, VPU_HDDL_DEVICE_NAME, VPU_HDDL_DEVICE_THERMAL, VPU_HDDL_DEVICE_ID, VPU_HDDL_DEVICE_SUBCLASS, VPU_HDDL_DEVICE_MEMORY_TOTAL, VPU_HDDL_DEVICE_MEMORY_USED, VPU_HDDL_DEVICE_UTILIZATION, VPU_HDDL_DEVICE_TAG, VPU_HDDL_STREAM_ID
		SUPPORTED_CONFIG_KEYS: PERF_COUNT, VPU_INPUT_NORM, VPU_INPUT_BIAS, VPU_HDDL_GRAPH_TAG, VPU_HDDL_STREAM_ID, VPU_HDDL_DEVICE_TAG, VPU_HDDL_BIND_DEVICE, VPU_HDDL_RUNTIME_PRIORITY, VPU_HDDL_USE_SGAD, VPU_COPY_OPTIMIZATION, LOG_LEVEL, VPU_IGNORE_UNKNOWN_LAYERS, VPU_HW_STAGES_OPTIMIZATION, VPU_NONE_LAYERS, VPU_NUMBER_OF_SHAVES, VPU_NUMBER_OF_CMX_SLICES, VPU_HW_INJECT_STAGES, VPU_HW_POOL_CONV_MERGE, VPU_HW_STAGES_OPTIMIZATION, EXCLUSIVE_ASYNC_REQUESTS
		FULL_DEVICE_NAME: Intel Vision Accelerator Design with Intel Movidius VPUs
		OPTIMIZATION_CAPABILITIES: FP16
[10:05:10.6872][1939]I[ClientManager.cpp:159] client(id:2) registered: clientName=HDDLPluginForQuery socket=2
		RANGE_FOR_ASYNC_INFER_REQUESTS: 4, 2000, 1
		VPU_HDDL_DEVICE_NUM: 1
		VPU_HDDL_DEVICE_NAME: 4.1
		VPU_HDDL_DEVICE_THERMAL: 55.93877029418945
		VPU_HDDL_DEVICE_ID: 228
		VPU_HDDL_DEVICE_SUBCLASS: 0
		VPU_HDDL_DEVICE_MEMORY_TOTAL: 483
		VPU_HDDL_DEVICE_MEMORY_USED: 0
		VPU_HDDL_DEVICE_UTILIZATION: 0.0
		VPU_HDDL_DEVICE_TAG: 
		VPU_HDDL_STREAM_ID: 

	Default values for device configuration keys:
		PERF_COUNT: 
		VPU_INPUT_NORM: 
		VPU_INPUT_BIAS: 
		VPU_HDDL_GRAPH_TAG: 
		VPU_HDDL_STREAM_ID: 
		VPU_HDDL_DEVICE_TAG: 
		VPU_HDDL_BIND_DEVICE: 
		VPU_HDDL_RUNTIME_PRIORITY: 
		VPU_HDDL_USE_SGAD: 
		VPU_COPY_OPTIMIZATION: 
		LOG_LEVEL: 
		VPU_IGNORE_UNKNOWN_LAYERS: 
		VPU_HW_STAGES_OPTIMIZATION: 
		VPU_NONE_LAYERS: 
		VPU_NUMBER_OF_SHAVES: 
		VPU_NUMBER_OF_CMX_SLICES: 
		VPU_HW_INJECT_STAGES: 
		VPU_HW_POOL_CONV_MERGE: 
		VPU_HW_STAGES_OPTIMIZATION: 
		EXCLUSIVE_ASYNC_REQUESTS: 
[10:05:10.7184][1939]I[ClientManager.cpp:189] client(id:2) unregistered: clientName=HDDLPluginForQuery socket=2

実行例(NCS2 1本)

Available devices:
	Device: CPU
	Metrics:
		AVAILABLE_DEVICES: 
		SUPPORTED_METRICS: AVAILABLE_DEVICES, SUPPORTED_METRICS, FULL_DEVICE_NAME, OPTIMIZATION_CAPABILITIES, SUPPORTED_CONFIG_KEYS, RANGE_FOR_ASYNC_INFER_REQUESTS, RANGE_FOR_STREAMS
		FULL_DEVICE_NAME: Intel(R) Atom(TM) Processor E3950 @ 1.60GHz
		OPTIMIZATION_CAPABILITIES: FP32, INT8, BIN
		SUPPORTED_CONFIG_KEYS: CPU_BIND_THREAD, CPU_THREADS_NUM, CPU_THROUGHPUT_STREAMS, DUMP_EXEC_GRAPH_AS_DOT, DYN_BATCH_ENABLED, DYN_BATCH_LIMIT, EXCLUSIVE_ASYNC_REQUESTS, PERF_COUNT
		RANGE_FOR_ASYNC_INFER_REQUESTS: 1, 1, 1
		RANGE_FOR_STREAMS: 1, 4

	Default values for device configuration keys:
		CPU_BIND_THREAD: YES
		CPU_THREADS_NUM: 0
		CPU_THROUGHPUT_STREAMS: 1
		DUMP_EXEC_GRAPH_AS_DOT: 
		DYN_BATCH_ENABLED: NO
		DYN_BATCH_LIMIT: 0
		EXCLUSIVE_ASYNC_REQUESTS: NO
		PERF_COUNT: NO
	Device: GPU
	Metrics:
		AVAILABLE_DEVICES: 0
		SUPPORTED_METRICS: AVAILABLE_DEVICES, SUPPORTED_METRICS, FULL_DEVICE_NAME, OPTIMIZATION_CAPABILITIES, SUPPORTED_CONFIG_KEYS, RANGE_FOR_ASYNC_INFER_REQUESTS, RANGE_FOR_STREAMS
		FULL_DEVICE_NAME: Intel(R) Gen9 HD Graphics
		OPTIMIZATION_CAPABILITIES: FP32, BIN, FP16, INT8
		SUPPORTED_CONFIG_KEYS: CLDNN_MEM_POOL, CLDNN_NV12_TWO_INPUTS, CLDNN_PLUGIN_PRIORITY, CLDNN_PLUGIN_THROTTLE, DEVICE_ID, DUMP_KERNELS, DYN_BATCH_ENABLED, EXCLUSIVE_ASYNC_REQUESTS, GPU_THROUGHPUT_STREAMS, PERF_COUNT, TUNING_MODE
		RANGE_FOR_ASYNC_INFER_REQUESTS: 1, 2, 1
		RANGE_FOR_STREAMS: 1, 2

	Default values for device configuration keys:
		CLDNN_MEM_POOL: YES
		CLDNN_NV12_TWO_INPUTS: NO
		CLDNN_PLUGIN_PRIORITY: 0
		CLDNN_PLUGIN_THROTTLE: 0
		DEVICE_ID: 
		DUMP_KERNELS: NO
		DYN_BATCH_ENABLED: NO
		EXCLUSIVE_ASYNC_REQUESTS: NO
		GPU_THROUGHPUT_STREAMS: 1
		PERF_COUNT: NO
		TUNING_MODE: TUNING_DISABLED
	Device: HDDL
	Metrics:
		AVAILABLE_DEVICES: 
		SUPPORTED_METRICS: AVAILABLE_DEVICES, SUPPORTED_METRICS, SUPPORTED_CONFIG_KEYS, FULL_DEVICE_NAME, OPTIMIZATION_CAPABILITIES, RANGE_FOR_ASYNC_INFER_REQUESTS, VPU_HDDL_DEVICE_NUM, VPU_HDDL_DEVICE_NAME, VPU_HDDL_DEVICE_THERMAL, VPU_HDDL_DEVICE_ID, VPU_HDDL_DEVICE_SUBCLASS, VPU_HDDL_DEVICE_MEMORY_TOTAL, VPU_HDDL_DEVICE_MEMORY_USED, VPU_HDDL_DEVICE_UTILIZATION, VPU_HDDL_DEVICE_TAG, VPU_HDDL_STREAM_ID
		SUPPORTED_CONFIG_KEYS: PERF_COUNT, VPU_INPUT_NORM, VPU_INPUT_BIAS, VPU_HDDL_GRAPH_TAG, VPU_HDDL_STREAM_ID, VPU_HDDL_DEVICE_TAG, VPU_HDDL_BIND_DEVICE, VPU_HDDL_RUNTIME_PRIORITY, VPU_HDDL_USE_SGAD, VPU_COPY_OPTIMIZATION, LOG_LEVEL, VPU_IGNORE_UNKNOWN_LAYERS, VPU_HW_STAGES_OPTIMIZATION, VPU_NONE_LAYERS, VPU_NUMBER_OF_SHAVES, VPU_NUMBER_OF_CMX_SLICES, VPU_HW_INJECT_STAGES, VPU_HW_POOL_CONV_MERGE, VPU_HW_STAGES_OPTIMIZATION, EXCLUSIVE_ASYNC_REQUESTS
		FULL_DEVICE_NAME: Intel Vision Accelerator Design with Intel Movidius VPUs
		OPTIMIZATION_CAPABILITIES: FP16
[10:23:02.9122][1916]I[ClientManager.cpp:159] client(id:3) registered: clientName=HDDLPluginForQuery socket=2
		RANGE_FOR_ASYNC_INFER_REQUESTS: 8, 2000, 1
		VPU_HDDL_DEVICE_NUM: 2
		VPU_HDDL_DEVICE_NAME: 2.4.1, 4.1
		VPU_HDDL_DEVICE_THERMAL: 53.33384704589844, 56.36977767944336
		VPU_HDDL_DEVICE_ID: 3, 228
		VPU_HDDL_DEVICE_SUBCLASS: 0, 0
		VPU_HDDL_DEVICE_MEMORY_TOTAL: 483, 483
		VPU_HDDL_DEVICE_MEMORY_USED: 0, 0
		VPU_HDDL_DEVICE_UTILIZATION: 0.0, 0.0
		VPU_HDDL_DEVICE_TAG: , 
		VPU_HDDL_STREAM_ID: , 

	Default values for device configuration keys:
		PERF_COUNT: 
		VPU_INPUT_NORM: 
		VPU_INPUT_BIAS: 
		VPU_HDDL_GRAPH_TAG: 
		VPU_HDDL_STREAM_ID: 
		VPU_HDDL_DEVICE_TAG: 
		VPU_HDDL_BIND_DEVICE: 
		VPU_HDDL_RUNTIME_PRIORITY: 
		VPU_HDDL_USE_SGAD: 
		VPU_COPY_OPTIMIZATION: 
		LOG_LEVEL: 
		VPU_IGNORE_UNKNOWN_LAYERS: 
		VPU_HW_STAGES_OPTIMIZATION: 
		VPU_NONE_LAYERS: 
		VPU_NUMBER_OF_SHAVES: 
		VPU_NUMBER_OF_CMX_SLICES: 
		VPU_HW_INJECT_STAGES: 
		VPU_HW_POOL_CONV_MERGE: 
		VPU_HW_STAGES_OPTIMIZATION: 
		EXCLUSIVE_ASYNC_REQUESTS: 
[10:23:02.9443][1916]I[ClientManager.cpp:189] client(id:3) unregistered: clientName=HDDLPluginForQuery socket=2

実行例(NCS2 2本)

Available devices:
	Device: CPU
	Metrics:
		AVAILABLE_DEVICES: 
		SUPPORTED_METRICS: AVAILABLE_DEVICES, SUPPORTED_METRICS, FULL_DEVICE_NAME, OPTIMIZATION_CAPABILITIES, SUPPORTED_CONFIG_KEYS, RANGE_FOR_ASYNC_INFER_REQUESTS, RANGE_FOR_STREAMS
		FULL_DEVICE_NAME: Intel(R) Atom(TM) Processor E3950 @ 1.60GHz
		OPTIMIZATION_CAPABILITIES: FP32, INT8, BIN
		SUPPORTED_CONFIG_KEYS: CPU_BIND_THREAD, CPU_THREADS_NUM, CPU_THROUGHPUT_STREAMS, DUMP_EXEC_GRAPH_AS_DOT, DYN_BATCH_ENABLED, DYN_BATCH_LIMIT, EXCLUSIVE_ASYNC_REQUESTS, PERF_COUNT
		RANGE_FOR_ASYNC_INFER_REQUESTS: 1, 1, 1
		RANGE_FOR_STREAMS: 1, 4

	Default values for device configuration keys:
		CPU_BIND_THREAD: YES
		CPU_THREADS_NUM: 0
		CPU_THROUGHPUT_STREAMS: 1
		DUMP_EXEC_GRAPH_AS_DOT: 
		DYN_BATCH_ENABLED: NO
		DYN_BATCH_LIMIT: 0
		EXCLUSIVE_ASYNC_REQUESTS: NO
		PERF_COUNT: NO
	Device: GPU
	Metrics:
		AVAILABLE_DEVICES: 0
		SUPPORTED_METRICS: AVAILABLE_DEVICES, SUPPORTED_METRICS, FULL_DEVICE_NAME, OPTIMIZATION_CAPABILITIES, SUPPORTED_CONFIG_KEYS, RANGE_FOR_ASYNC_INFER_REQUESTS, RANGE_FOR_STREAMS
		FULL_DEVICE_NAME: Intel(R) Gen9 HD Graphics
		OPTIMIZATION_CAPABILITIES: FP32, BIN, FP16, INT8
		SUPPORTED_CONFIG_KEYS: CLDNN_MEM_POOL, CLDNN_NV12_TWO_INPUTS, CLDNN_PLUGIN_PRIORITY, CLDNN_PLUGIN_THROTTLE, DEVICE_ID, DUMP_KERNELS, DYN_BATCH_ENABLED, EXCLUSIVE_ASYNC_REQUESTS, GPU_THROUGHPUT_STREAMS, PERF_COUNT, TUNING_MODE
		RANGE_FOR_ASYNC_INFER_REQUESTS: 1, 2, 1
		RANGE_FOR_STREAMS: 1, 2

	Default values for device configuration keys:
		CLDNN_MEM_POOL: YES
		CLDNN_NV12_TWO_INPUTS: NO
		CLDNN_PLUGIN_PRIORITY: 0
		CLDNN_PLUGIN_THROTTLE: 0
		DEVICE_ID: 
		DUMP_KERNELS: NO
		DYN_BATCH_ENABLED: NO
		EXCLUSIVE_ASYNC_REQUESTS: NO
		GPU_THROUGHPUT_STREAMS: 1
		PERF_COUNT: NO
		TUNING_MODE: TUNING_DISABLED
	Device: HDDL
	Metrics:
		AVAILABLE_DEVICES: 
		SUPPORTED_METRICS: AVAILABLE_DEVICES, SUPPORTED_METRICS, SUPPORTED_CONFIG_KEYS, FULL_DEVICE_NAME, OPTIMIZATION_CAPABILITIES, RANGE_FOR_ASYNC_INFER_REQUESTS, VPU_HDDL_DEVICE_NUM, VPU_HDDL_DEVICE_NAME, VPU_HDDL_DEVICE_THERMAL, VPU_HDDL_DEVICE_ID, VPU_HDDL_DEVICE_SUBCLASS, VPU_HDDL_DEVICE_MEMORY_TOTAL, VPU_HDDL_DEVICE_MEMORY_USED, VPU_HDDL_DEVICE_UTILIZATION, VPU_HDDL_DEVICE_TAG, VPU_HDDL_STREAM_ID
		SUPPORTED_CONFIG_KEYS: PERF_COUNT, VPU_INPUT_NORM, VPU_INPUT_BIAS, VPU_HDDL_GRAPH_TAG, VPU_HDDL_STREAM_ID, VPU_HDDL_DEVICE_TAG, VPU_HDDL_BIND_DEVICE, VPU_HDDL_RUNTIME_PRIORITY, VPU_HDDL_USE_SGAD, VPU_COPY_OPTIMIZATION, LOG_LEVEL, VPU_IGNORE_UNKNOWN_LAYERS, VPU_HW_STAGES_OPTIMIZATION, VPU_NONE_LAYERS, VPU_NUMBER_OF_SHAVES, VPU_NUMBER_OF_CMX_SLICES, VPU_HW_INJECT_STAGES, VPU_HW_POOL_CONV_MERGE, VPU_HW_STAGES_OPTIMIZATION, EXCLUSIVE_ASYNC_REQUESTS
		FULL_DEVICE_NAME: Intel Vision Accelerator Design with Intel Movidius VPUs
		OPTIMIZATION_CAPABILITIES: FP16
[10:24:02.3869][1916]I[ClientManager.cpp:159] client(id:4) registered: clientName=HDDLPluginForQuery socket=2
		RANGE_FOR_ASYNC_INFER_REQUESTS: 12, 2000, 1
		VPU_HDDL_DEVICE_NUM: 3
		VPU_HDDL_DEVICE_NAME: 2.4.1, 4.1, 2.4.3
		VPU_HDDL_DEVICE_THERMAL: 53.988128662109375, 56.15438461303711, 37.24032211303711
		VPU_HDDL_DEVICE_ID: 3, 228, 0
		VPU_HDDL_DEVICE_SUBCLASS: 0, 0, 0
		VPU_HDDL_DEVICE_MEMORY_TOTAL: 483, 483, 483
		VPU_HDDL_DEVICE_MEMORY_USED: 0, 0, 0
		VPU_HDDL_DEVICE_UTILIZATION: 0.0, 0.0, 0.0
		VPU_HDDL_DEVICE_TAG: , , 
		VPU_HDDL_STREAM_ID: , , 

	Default values for device configuration keys:
		PERF_COUNT: 
		VPU_INPUT_NORM: 
		VPU_INPUT_BIAS: 
		VPU_HDDL_GRAPH_TAG: 
		VPU_HDDL_STREAM_ID: 
		VPU_HDDL_DEVICE_TAG: 
		VPU_HDDL_BIND_DEVICE: 
		VPU_HDDL_RUNTIME_PRIORITY: 
		VPU_HDDL_USE_SGAD: 
		VPU_COPY_OPTIMIZATION: 
		LOG_LEVEL: 
		VPU_IGNORE_UNKNOWN_LAYERS: 
		VPU_HW_STAGES_OPTIMIZATION: 
		VPU_NONE_LAYERS: 
		VPU_NUMBER_OF_SHAVES: 
		VPU_NUMBER_OF_CMX_SLICES: 
		VPU_HW_INJECT_STAGES: 
		VPU_HW_POOL_CONV_MERGE: 
		VPU_HW_STAGES_OPTIMIZATION: 
		EXCLUSIVE_ASYNC_REQUESTS: 
[10:24:02.4262][1916]I[ClientManager.cpp:189] client(id:4) unregistered: clientName=HDDLPluginForQuery socket=2

VPU_HDDL_DEVICE_NUM: の箇所がNCS2の本数分だけ増えていることを確認しました。実行時に何らかのエラーが出る場合は、OpenVINOのサイトでLinuxのセットアップ関連を確認してください。

その他

NCS2を2本利用した時に、電力低下のメッセージが表示されました。セルフパワーのUSBハブの出番です。未だお持ちでない方はぜひ購入ください。USB3.0対応の方が良いですね。NCS2も試してみてくださいね。