clDNN icon indicating copy to clipboard operation
clDNN copied to clipboard

clDNNPlugin R5 cannot be built with clDNN Drop 12.1 without graphics driver installed

Open emptyVoid opened this issue 6 years ago • 3 comments

I'm trying to build OpenVINO 2018 R5 with Drop 12.1 (since Intel's distribution contains an earlier version of clDNN, like something before Drop 11, which features a horrendous memory leak). Due to absence of Intel Graphics on my CPU the graphics driver refuses to install, which result in a clDNNPlugin linking error to OpenCL.lib.

I've traced the issue to clDNN's build script: https://github.com/intel/clDNN/blob/f91d7d83d8f121e4e159776b108e316f2f08bdf5/src/CMakeLists.txt#L234-L239 while it sets OpenCL.lib as a public link library, it does not propagate corresponding link directory to consumers in the same way (I'm not sure what happens to link_directories from the root script, though it is not respected by OpenVINO's scripts, and I don't think it's a good practice to propagate target's dependencies via include_directories, link_directories and similar global commands).

I'm not sure if it's the best place for a fix (moreover I think it would be better to create an import target for OpenCL), though it definitely resolves the link issue:

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6313d50..10c5b88 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -237,6 +237,9 @@ target_link_libraries("${CLDNN_BUILD__PROJ}"
     Boost::system
     cldnn_kernel_selector
   )
+target_link_directories("${CLDNN_BUILD__PROJ}"
+    INTERFACE ${CLDNN__IOCL_ICD_LIBDIRS}
+  )

 if(WIN32)
   target_link_libraries("${CLDNN_BUILD__PROJ}" setupapi)

emptyVoid avatar Jan 23 '19 05:01 emptyVoid

I successfully compile the dldt with clDNN Drop13.1 through change public to private, but memory leak still exits.

MengNan-Li avatar Feb 27 '19 07:02 MengNan-Li

Could be a new one. We've done some long-run tests for 5 different networks with R5 + Drop 12.1 (and R4 + Drop 12 before that) and the memory footprint stayed the same.

emptyVoid avatar Feb 27 '19 08:02 emptyVoid

Thinks. Changing Drop13.1 to Drop12.1 makes the memory stable.

MengNan-Li avatar Feb 28 '19 06:02 MengNan-Li