Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

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

Open
emptyVoid opened this issue Jan 23, 2019 · 3 comments

Comments

@emptyVoid
Copy link

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:

clDNN/src/CMakeLists.txt

Lines 234 to 239 in f91d7d8

target_link_libraries("${CLDNN_BUILD__PROJ}"
OpenCL
Boost::filesystem
Boost::system
cldnn_kernel_selector
)

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 emptyVoid changed the title clDNNPlugin R5 cannot be built with cvDNN Drop 12.1 without graphics driver installed clDNNPlugin R5 cannot be built with clDNN Drop 12.1 without graphics driver installed Jan 23, 2019
@MengNan-Li
Copy link

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

@emptyVoid
Copy link
Author

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.

@MengNan-Li
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants