Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is GPU disabled in default build? #823

Closed
blueberry opened this issue Aug 25, 2020 · 2 comments
Closed

Why is GPU disabled in default build? #823

blueberry opened this issue Aug 25, 2020 · 2 comments
Assignees
Labels

Comments

@blueberry
Copy link

I'm using DNNL from JVM through a wrapper library. Everything works fine, but, since the wrapper library has to ship pre-built binaries, GPU is not supported, since the binaries follow the default DNNL build, where GPU engine is disabled.

Now, the obvious solution is to "enable everything" in the the DNNL build that ships with the wrapper library. Is that safe?

For example, would the CPU engine continue to work on the system that would execute the end application if there is no OpenCL driver present, assuming that the user does not try to work with a GPU engine, nor try to execute anything on it?

Or, put more simply, is there a reason not to enable GPU engine by default (in DNNL, but more specifically in wrapper libraries)?

@vpirogov
Copy link
Member

vpirogov commented Aug 25, 2020

Hi @blueberry,

When you build oneDNN with OpenCL runtime the library will be dependent on OpenCL Installable Client Driver (libOpenCL.so):

$ ldd libdnnl.so.1
        linux-vdso.so.1 (0x00007ffe3a532000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fedfe459000)
        libOpenCL.so.1 => /lib/x86_64-linux-gnu/libOpenCL.so.1 (0x00007fedfe24e000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fedfe248000)
        libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fedfe067000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fedfdf18000)
        libgomp.so.1 => /lib/x86_64-linux-gnu/libgomp.so.1 (0x00007fedfded6000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fedfdeb9000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fedfdcc7000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fee00732000)

So if ICD is not available in the system the application will fail. It does not matter whether Intel OpenCL Runtime is actually available or not, what matters is the loader. I believe ICD is available on most systems out of the box. Other than that CPU engine should work as expected.

@vpirogov vpirogov self-assigned this Aug 25, 2020
@blueberry
Copy link
Author

Thanks!

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

No branches or pull requests

2 participants