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

ImportError: Importing numba_dppy failed when numba-dppy is installed from the intel conda channel #742

Closed
ogrisel opened this issue Apr 5, 2022 · 7 comments

Comments

@ogrisel
Copy link

ogrisel commented Apr 5, 2022

I am trying to install numba-dppy in a dedicated conda environment with the following command:

$ conda create -n numba-dppy -c intel numba-dppy
Collecting package metadata (current_repodata.json): done
Solving environment: done
[...]
$ conda activate numba-dppy
(numba-dppy) $ python -c "import numba_dppy"
No device of requested type available. Please check https://software.intel.com/content/www/us/en/develop/articles/intel-oneapi-dpcpp-system-requirements.html -1 (CL_DEVICE_NOT_FOUND)
/home/ogrisel/mambaforge/envs/numba-dppy/lib/python3.9/site-packages/numba_dppy/config.py:57: UserWarning: Please install dpctl 0.8.* or higher.
  warnings.warn(msg, UserWarning)
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/ogrisel/mambaforge/envs/numba-dppy/lib/python3.9/site-packages/numba_dppy/__init__.py", line 528, in <module>
    raise ImportError("Importing numba_dppy failed")
ImportError: Importing numba_dppy failed

but dpctl 0.11.1 was installed in that env, here is the output of the conda list command:

# Name                    Version                   Build  Channel
bzip2                     1.0.8                hb9a14ef_9    intel
ca-certificates           2021.10.26           h06a4308_2    intel
certifi                   2021.10.8        py39h06a4308_0    intel
dpcpp-cpp-rt              2022.0.1             intel_3633    intel
dpcpp_cpp_rt              2022.0.1             intel_3633    intel
dpctl                     0.11.1           py39hbd01409_0    intel
dpnp                      0.9.0            py39h2493cab_0    intel
icc_rt                    2022.0.1             intel_3633    intel
intel-cmplr-lib-rt        2022.0.1             intel_3633    intel
intel-cmplr-lic-rt        2022.0.1             intel_3633    intel
intel-opencl-rt           2022.0.1             intel_3633    intel
intel-openmp              2022.0.1             intel_3633    intel
intelpython               2022.0.0                      0    intel
libffi                    3.3                          14    intel
libgcc-ng                 9.3.0              hdf63c60_101    intel
libllvm11                 11.0.0               h3826bc1_0    intel
libstdcxx-ng              9.3.0              hdf63c60_101    intel
llvm-spirv                11.0.0               h4616538_1    intel
llvmlite                  0.37.0           py39h188ca7a_1    intel
mkl                       2022.0.1              intel_117    intel
mkl-dpcpp                 2022.0.1              intel_117    intel
mkl-service               2.4.0           py39h4119f30_10    intel
mkl_fft                   1.3.1            py39h8344fd8_7    intel
mkl_random                1.2.2            py39h4ac99d2_7    intel
mkl_umath                 0.1.1           py39h03fa629_17    intel
numba                     0.54.1           py39h671cb0e_3    intel
numba-dppy                0.17.2           py39h31cfeb5_0    intel
numpy                     1.21.2           py39hec4e512_7    intel
numpy-base                1.21.2           py39h40791c5_7    intel
openssl                   1.1.1l               h7f8727e_0    intel
packaging                 21.0             py39h1546d3d_4    intel
pip                       21.2.4           py39h06a4308_0    intel
pyparsing                 3.0.4              pyhd3eb1b0_0    intel
python                    3.9.7                h718aa4a_4    intel
setuptools                58.0.4           py39h06a4308_0    intel
six                       1.16.0             pyhd3eb1b0_0    intel
spirv-tools               2020.5               h6bb024c_2    intel
sqlite                    3.36.0               hb9a14ef_3    intel
tbb                       2021.5.0              intel_707    intel
tbb4py                    2021.5.0         py39_intel_707    intel
tk                        8.6.10               h8e2d9d6_3    intel
wheel                     0.37.0             pyhd3eb1b0_1    intel
xz                        5.2.5                h74280d8_2    intel
zlib                      1.2.11.1             h1e99aa7_5    intel

And here is the output of lscpu:

Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   39 bits physical, 48 bits virtual
CPU(s):                          8
On-line CPU(s) list:             0-7
Thread(s) per core:              2
Core(s) per socket:              4
Socket(s):                       1
NUMA node(s):                    1
Vendor ID:                       GenuineIntel
CPU family:                      6
Model:                           140
Model name:                      11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
Stepping:                        1
CPU MHz:                         2800.000
CPU max MHz:                     4700,0000
CPU min MHz:                     400,0000
BogoMIPS:                        5606.40
Virtualization:                  VT-x
L1d cache:                       192 KiB
L1i cache:                       128 KiB
L2 cache:                        5 MiB
L3 cache:                        12 MiB
NUMA node0 CPU(s):               0-7
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Enhanced IBRS, IBPB conditional, RSB filling
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_know
                                 n_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l2 invpcid_single cdp_l2 ssbd ibrs
                                  ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec 
                                 xgetbv1 xsaves split_lock_detect dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid movdiri movdir64b fsrm avx512_vp2
                                 intersect md_clear flush_l1d arch_capabilities

@ogrisel
Copy link
Author

ogrisel commented Apr 5, 2022

This might be related to a similar problem on dpnp: IntelPython/dpnp#1149

@ogrisel ogrisel changed the title ImportError: Importing numba_dppy failed when numba-dppy is installed from the intel channel ImportError: Importing numba_dppy failed when numba-dppy is installed from the intel conda channel Apr 5, 2022
@ogrisel
Copy link
Author

ogrisel commented Apr 5, 2022

Note that I install the Python env from the APT package of oneAPI basetoolkit and configure the environment variables with . /opt/intel/oneapi/setvars.sh, then I can import numba_dppy successfully on this same machine.

However, having to use a mix of 2 package managers to install numba_dppy is preventing to use this library in traditional deployments that only rely on conda (or pip) and therefore harming the potential adoption of this library.

@ogrisel
Copy link
Author

ogrisel commented Apr 21, 2022

I tried again after setting SYCL_ENABLE_HOST_DEVICE=1 (thanks @oleksandr-pavlyk for the hint):

$ SYCL_ENABLE_HOST_DEVICE=1   python -c "import numba_dppy"
/home/ogrisel/mambaforge/envs/dpnp/lib/python3.9/site-packages/numba_dppy/config.py:50: UserWarning: dpctl could not find any non-host SYCL device on the system. A non-host SYCL device is required to use numba_dppy.
  warnings.warn(msg, UserWarning)
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/ogrisel/mambaforge/envs/dpnp/lib/python3.9/site-packages/numba_dppy/__init__.py", line 528, in <module>
    raise ImportError("Importing numba_dppy failed")
ImportError: Importing numba_dppy failed

so at least the error message makes sense now. However I do not understand why the sycl runtime does not find a non-host device on this machine:

lspci | grep Iris
00:02.0 VGA compatible controller: Intel Corporation TigerLake-LP GT2 [Iris Xe Graphics] (rev 01)

do I need to install additional drivers (this is a Ubuntu 21.10 system)?

@ogrisel
Copy link
Author

ogrisel commented Apr 21, 2022

For the latter point, installing additional drivers as explained here https://dgpu-docs.intel.com/installation-guides/ubuntu/ubuntu-focal.html fixed the problem.

Not that I used the focal / 20.04 apt repo on my impish / 21.10 system and it worked.

@ogrisel
Copy link
Author

ogrisel commented Apr 21, 2022

So to summarize:

  • the existing exception message is misleading because it mentions a dpctl dependency that is already fine
  • it should probably at least tell the user how to enable the CPU backend by setting the SYCL_ENABLE_HOST_DEVICE=1 or do it automatically if no other device is available
  • it should probably point the user to some documentation page to install drivers for GPU devices (either the existing page at https://dgpu-docs.intel.com/installation-guides/index.html but this only covers Intel GPU devices or new page with pointers to the documentation for various vendors that expected to be supported by numba-dpex if numba-dpex is extended to support hardware from other vendors compatible with SYCL).

Also the documentation at:

https://intelpython.github.io/numba-dpex/latest/user_guides/getting_started.html

should be updated to explicitly mention installing the GPU drivers with a link to https://dgpu-docs.intel.com/installation-guides/index.html.

@ogrisel
Copy link
Author

ogrisel commented May 9, 2022

After a system update, I now get the following:

$ python -c "import numba_dppy"
Abort was called at 39 line in file:
/opt/src/l0_gpu_driver/shared/source/gmm_helper/client_context/gmm_client_context.cpp
Aborted (core dumped)

This is similar to the dpctl problem reported with more details:

IntelPython/dpnp#1149 (comment)

Here is a conda list of the numba-dppy env:

bzip2                     1.0.8                hb9a14ef_9    intel
ca-certificates           2022.3.18            h06a4308_0    intel
certifi                   2021.10.8        py39h06a4308_2    intel
dpcpp-cpp-rt              2022.1.0             intel_3768    intel
dpcpp_cpp_rt              2022.1.0             intel_3768    intel
dpctl                     0.12.0           py39h6461980_0    intel
dpnp                      0.10.0           py39hafff6e5_0    intel
icc_rt                    2022.1.0             intel_3768    intel
intel-cmplr-lib-rt        2022.1.0             intel_3768    intel
intel-cmplr-lic-rt        2022.1.0             intel_3768    intel
intel-opencl-rt           2022.1.0             intel_3768    intel
intel-openmp              2022.1.0             intel_3768    intel
intelpython               2022.1.0                      0    intel
libffi                    3.3                          14    intel
libgcc-ng                 9.3.0              hdf63c60_101    intel
libllvm11                 11.0.0               h3826bc1_1    intel
libstdcxx-ng              9.3.0              hdf63c60_101    intel
llvm-spirv                11.0.0               h4616538_1    intel
llvmlite                  0.38.0           py39hb51dc5a_0    intel
mkl                       2022.1.0              intel_223    intel
mkl-dpcpp                 2022.1.0              intel_223    intel
mkl-service               2.4.0           py39h7987b76_11    intel
mkl_fft                   1.3.1           py39h542d01b_16    intel
mkl_random                1.2.2           py39hdd7f59e_16    intel
mkl_umath                 0.1.1           py39h3242e30_26    intel
ncurses                   6.3                  h7f8727e_2    intel
numba                     0.55.1           py39hefe1858_1    intel
numba-dppy                0.18.0           py39h87db2bc_0    intel
numpy                     1.21.4          py39ha3f613e_16    intel
numpy-base                1.21.4          py39h1b56c09_16    intel
openssl                   1.1.1n               h7f8727e_0    intel
packaging                 21.3               pyhd3eb1b0_0    intel
pip                       21.2.4           py39h06a4308_0    intel
pyparsing                 3.0.4              pyhd3eb1b0_0    intel
python                    3.9.10               h3b4beac_2    intel
readline                  8.1.2                h7f8727e_1    intel
setuptools                58.0.4           py39h06a4308_0    intel
six                       1.16.0             pyhd3eb1b0_1    intel
spirv-tools               2020.5               h6bb024c_2    intel
sqlite                    3.38.0               hc218d9a_0    intel
tbb                       2021.6.0              intel_835    intel
tbb4py                    2021.6.0         py39_intel_835    intel
tk                        8.6.10               h8e2d9d6_3    intel
wheel                     0.37.1             pyhd3eb1b0_0    intel
xz                        5.2.5                h74280d8_2    intel
zlib                      1.2.11.1             h1e99aa7_5    intel

@ogrisel
Copy link
Author

ogrisel commented Sep 21, 2022

Apparently the misleading ImportError exception is no longer raised in numba-dpex (see: #776 (comment) for instance).

I opened #777 to document the remaining usability improvements to help the user find out why no SYCL device is found by numba-dpex.

@ogrisel ogrisel closed this as completed Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant