clDNNPlugin R5 cannot be built with clDNN Drop 12.1 without graphics driver installed
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)
I successfully compile the dldt with clDNN Drop13.1 through change public to private, but memory leak still exits.
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.
Thinks. Changing Drop13.1 to Drop12.1 makes the memory stable.