-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Hello, I am attempting to create a debian package (.deb) of oneDNN built with the DPC++ compiler. I am able to build oneDNN and am now attempting to build and run the examples distributed with this repo. I am targeting GPU-only SYCL devices, as Intel's OpenCL CPU implementation is not packaged in Debian or Ubuntu.
I have picked a few examples from the 3.9.1 release that seem relevant. In both cases I am able to build the examples and link with the SYCL-enabled libdnn, but both examples fail with different (but potentially related?) errors. I was hoping you might be able to shed some light.
Building oneDNN
I built the library with the following options:
-DCMAKE_CXX_COMPILER=clang++-dpcpp \
-DCMAKE_C_COMPILER=clang-dpcpp \
-DCMAKE_AR=/usr/lib/llvm-dpcpp-21/bin/llvm-ar \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DDNNL_EXPERIMENTAL_SPARSE=ON \
-DDNNL_EXPERIMENTAL_UKERNEL=${BUILD_UKERNEL} \
-DONEDNN_BUILD_TESTS=OFF \
-DONEDNN_BUILD_EXAMPLES=OFF \
-DONEDNN_BUILD_DOC=OFF \
-DONEDNN_ARCH_OPT_FLAGS="" \
-DONEDNN_CPU_RUNTIME=SYCL \
-DONEDNN_GPU_RUNTIME=SYCL \
-DDNNL_LIBRARY_NAME=dnnl-sycl
Note that clang++-dpcpp is the name of the C++ version of DPC++ that we are submitting to the Ubuntu archive (but it is not yet there). Also note I'm using dnnl-sycl for the library name to distinguish from the existing libdnnl (built with the GCC toolchain) in Debian and Ubuntu.
gpu_opencl_interop.cpp
$ clang++-dpcpp -DCL_TARGET_OPENCL_VERSION=300 -fsycl -fsycl-targets=spir64 -ldnnl-sycl -ltbb -lOpenCL gpu_opencl_interop.cpp -o gpu_opencl_interop
$ ldd ./gpu_opencl_interop
linux-vdso.so.1 (0x00007263d9787000)
libdnnl-sycl.so.3.6 => /lib/x86_64-linux-gnu/libdnnl-sycl.so.3.6 (0x00007263d4400000)
libtbb.so.12 => /lib/x86_64-linux-gnu/libtbb.so.12 (0x00007263d9722000)
libOpenCL.so.1 => /lib/x86_64-linux-gnu/libOpenCL.so.1 (0x00007263d970b000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007263d4000000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007263d95fe000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007263d43d3000)
libsycl.so.8 => /lib/x86_64-linux-gnu/libsycl.so.8 (0x00007263d3a00000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007263d3600000)
/lib64/ld-linux-x86-64.so.2 (0x00007263d9789000)
libur_loader.so.0 => /lib/x86_64-linux-gnu/libur_loader.so.0 (0x00007263d2400000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007263d43b3000)
$ ./gpu_opencl_interop
oneDNN error caught:
Status: invalid_arguments
Message: could not get an OpenCL context from an engine
Example failed on GPU.
Note according to sycl-ls (see section below) I have a opencl:gpu device. I have tried filtering devices with export SYCL_DEVICE_FILTER=gpu, export ONEAPI_DEVICE_SELECTOR=opencl:gpu, and export DNNL_CPU_RUNTIME=NONE at runtime without any change.
sycl_interop_buffer.cpp
$ clang++-dpcpp -DCL_TARGET_OPENCL_VERSION=300 -fsycl -fsycl-targets=spir64 -ldnnl-sycl -ltbb -lOpenCL sycl_interop_buffer.cpp -o sycl_interop_buffer
$ ldd ./sycl_interop_buffer
linux-vdso.so.1 (0x000071ad0c514000)
libdnnl-sycl.so.3.6 => /lib/x86_64-linux-gnu/libdnnl-sycl.so.3.6 (0x000071ad07200000)
libtbb.so.12 => /lib/x86_64-linux-gnu/libtbb.so.12 (0x000071ad0c4af000)
libOpenCL.so.1 => /lib/x86_64-linux-gnu/libOpenCL.so.1 (0x000071ad0c498000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x000071ad06e00000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x000071ad070f3000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x000071ad0c469000)
libsycl.so.8 => /lib/x86_64-linux-gnu/libsycl.so.8 (0x000071ad06800000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x000071ad06400000)
/lib64/ld-linux-x86-64.so.2 (0x000071ad0c516000)
libur_loader.so.0 => /lib/x86_64-linux-gnu/libur_loader.so.0 (0x000071ad05200000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x000071ad0c449000)
$ ./sycl_interop_buffer
onednn_verbose,v1,info,oneDNN v3.9.1 (commit N/A)
onednn_verbose,v1,info,cpu,runtime:DPC++,nthr:22
onednn_verbose,v1,info,cpu,isa:Intel AVX2 with Intel DL Boost
onednn_verbose,v1,info,gpu,runtime:DPC++
onednn_verbose,v1,info,cpu,engine,sycl cpu device count:0 - no devices available.
onednn_verbose,v1,info,gpu,engine,sycl gpu device count:1
onednn_verbose,v1,info,gpu,engine,0,backend:OpenCL,name:Intel(R) Arc(TM) Graphics,driver_version:25.31.34666,binary_kernels:enabled
onednn_verbose,v1,info,graph,backend,0:dnnl_backend
onednn_verbose,v1,primitive,info,template:operation,engine,primitive,implementation,prop_kind,memory_descriptors,attributes,auxiliary,problem_desc,exec_time
onednn_verbose,v1,graph,info,template:operation,engine,partition_id,partition_kind,op_names,data_formats,logical_tensors,fpmath_mode,implementation,backend,exec_time
onednn_verbose,v1,common,error,runtime,DPC++ cpu devices queried but not found,src/common/engine.cpp:102
oneDNN error caught:
Status: invalid_arguments
Message: could not create an engine
Example failed on CPU.
I also tried device filtering like in the previous example without any luck.
Host system
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 25.10
Release: 25.10
Codename: questing
$ sycl-ls
[level_zero:gpu][level_zero:0] Intel(R) oneAPI Unified Runtime over Level-Zero, Intel(R) Arc(TM) Graphics 12.71.4 [1.6.34666]
[opencl:gpu][opencl:0] Intel(R) OpenCL Graphics, Intel(R) Arc(TM) Graphics OpenCL 3.0 NEO [25.31.034666]
$ lspci -nn | grep -i graphics
00:02.0 VGA compatible controller [0300]: Intel Corporation Meteor Lake-P [Intel Arc Graphics] [8086:7d55] (rev 08)
$ lscpu | grep "Model name"
Model name: Intel(R) Core(TM) Ultra 7 155H
$ apt list --installed | grep -E 'ocl|intel|libze|dpcpp'
clang-dpcpp-21/questing,now 6.2.0-0ubuntu1~25.10~ppa2 amd64 [installed]
dpcpp-sycl-runtime-libs/questing,now 6.2.0-0ubuntu1~25.10~ppa2 amd64 [installed,automatic]
intel-microcode/questing-updates,questing-security,questing-security,now 3.20250812.0ubuntu0.25.10.1 amd64 [installed,automatic]
intel-opencl-icd-legacy/questing,now 24.35.30872.32-2 amd64 [installed,automatic]
intel-opencl-icd/questing,now 25.31.34666.3-1ubuntu1 amd64 [installed,automatic]
libclang-dpcpp-common-21-dev/questing,now 6.2.0-0ubuntu1~25.10~ppa2 amd64 [installed]
libclang-dpcpp21/questing,now 6.2.0-0ubuntu1~25.10~ppa2 amd64 [installed,automatic]
libdrm-intel1/questing-updates,now 2.4.125-1ubuntu0.1 amd64 [installed,automatic]
libze-intel-gpu-legacy1-1/questing,now 24.35.30872.32-2 amd64 [installed,automatic]
libze-intel-gpu1/questing,now 25.31.34666.3-1ubuntu1 amd64 [installed,automatic]
libze1/questing,now 1.24.1-2 amd64 [installed,automatic]
llvm-dpcpp/questing,now 6.2.0-0ubuntu1~25.10~ppa2 amd64 [installed,automatic]
ocl-icd-libopencl1/questing,now 2.3.3-1 amd64 [installed,automatic]
ocl-icd-opencl-dev/questing,now 2.3.3-1 amd64 [installed]