openvino: Unable to get working OpenVINO/ONNX GPU accelleration on Ubuntu 24.04, Intel i7 1355U

OpenVINO Version

onnxruntime-openvino 1.17.1

Operating System

Other (Please specify in description)

Hardware Architecture

x86 (64 bits)

Target Platform

DT Research tablet DT302-RP with Intel i7 1355U , running Ubuntu 24.04 LTS

Build issue description

We are trying to evaluate the possible performance improvement when running AI inference through the OpenVINO framework. Our AI models are ONNX based, and as such the integration between OpenVINO and ONNX need to work.

We have tried using the provided demonstration Docker container, but it is unable to find the GPU.

Installing the OpenVINO framework on the host OS directly, does provide the GPU as an option, but the Python version on Ubuntu 24.04 is too new that there is a PIP package available for the OpenVINO ONNX integration. We have then continued to build the ONNX integration manually, which worked, but the OpenVINO execution provider does not load.

Build script or step-by-step to reproduce

Run the provided docker container:

sentispec-admin@sentispec-DT302RP-dsv-1:~$ docker run -it --rm --device-cgroup-rule='c 189:* rmw' -v /dev/bus/usb:/dev/bus/usb --device /dev/dri:/dev/dri openvino/onnxruntime_ep_ubuntu20:latest
onnxruntimedev@f997be011eee:~$ python3 -c "from openvino import Core; print(Core().available_devices)"
['CPU', 'GNA']
onnxruntimedev@f997be011eee:~$ pip list
Package              Version
-------------------- --------------------
coloredlogs          15.0.1
dbus-python          1.2.16
distro-info          0.23+ubuntu1.1
flatbuffers          23.5.26
humanfriendly        10.0
mpmath               1.3.0
numpy                1.24.4
onnxruntime-openvino 1.17.1
packaging            23.2
pip                  23.3.2
protobuf             4.25.3
PyGObject            3.36.0
python-apt           2.0.1+ubuntu0.20.4.1
setuptools           45.2.0
sympy                1.12
unattended-upgrades  0.1
wheel                0.34.2

[notice] A new release of pip is available: 23.3.2 -> 24.0
[notice] To update, run: python3.8 -m pip install --upgrade pip
onnxruntimedev@f997be011eee:~$

Install OpenVINO manually on host OS:

Follow: https://docs.openvino.ai/2022.3/openvino_docs_install_guides_configurations_for_intel_gpu.html

pip install openvino newest version

root@sentispec-DT302RP-dsv-1:~# source openvino_env/bin/activate (openvino_env) root@sentispec-DT302RP-dsv-1:~# python3 -c "from openvino import Core; print(Core().available_devices)" ['CPU', 'GPU'] (openvino_env) root@sentispec-DT302RP-dsv-1:~#

Build ONNX with OpenVino wheel to manual installation:

https://onnxruntime.ai/docs/build/eps.html#linux-4

pip install /home/sentispec-admin/onnxruntime_openvino-1.19.0-cp312-cp312-linux_x86_64.whl

Try to use it:

(openvino_env) root@sentispec-DT302RP-dsv-1:~# python3
Python 3.12.3 (main, Apr 10 2024, 05:33:47) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import onnxruntime as ort
>>> session = ort.InferenceSession("/path/to/model", providers=["OpenVINOExecutionProvider"])
/root/openvino_env/lib/python3.12/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py:69: UserWarning: Specified provider 'OpenVINOExecutionProvider' is not in available provider names.Available providers: 'AzureExecutionProvider, CPUExecutionProvider'
  warnings.warn(

Happy to provide any details, decided to keep it as short as possible for now. I am aware ubuntu 24.04 is not currently officially supported but was thinking that it is planned e.g. also regarding this: https://github.com/openvinotoolkit/openvino/pull/23905

Relevant log output

No response

Issue submission checklist

  • I’m reporting an issue. It’s not a question.
  • I checked the problem with the documentation, FAQ, open issues, Stack Overflow, etc., and have not found a solution.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (3 by maintainers)

Most upvoted comments

happy to report that it works now with the updated docker images:

sentispec-admin@sentispec-DT302RP-dhl-1:~$ docker run -it --rm --device-cgroup-rule='c 189:* rmw' -v /dev/bus/usb:/dev/bus/usb --device /dev/dri:/dev/dri --group-add=$(stat -c "%g" /dev/dri/render*) openvino/onnxruntime_ep_ubuntu20:latest
groups: cannot find name for group ID 992
onnxruntimedev@90aa102516fa:~$ python3 -c "from openvino import Core; print(Core().available_devices)"
['CPU', 'GPU']

when testing above, i forgot the additional --group-add which makes it work on the onnx docker image release a couple of months ago.

@khhsenti also based on the System Requirements for environment it lists Python 3.8 to Python 3.11 as a requirement. I see that on the details you are using Python 3.12.3 as it is the default version on Ubuntu 24.04. If not already done so, is it possible to try using Python 3.11 if you are building ONNX with OpenVINO?

Note I am able to access the GPU within Docker on a Meteor Lake system (Core Ultra 7 155H running Ubuntu 24.04 natively on host) using the openvino/ubuntu22_runtime image. This Docker image has driver 23.13.26032.30, whereas openvino/onnxruntime_ep_ubuntu20 has 22.43.24595 which is a bit old (released almost 2 years ago on Dec 2022). So the issue may also be due the fact this image contains an outdated graphics driver.

FYI I’ve tried the steps below and this working for me, hope it does for you as well.

# run docker image
$ docker run -it --rm --device-cgroup-rule='c 189:* rmw' -v /dev/bus/usb:/dev/bus/usb --device /dev/dri:/dev/dri --group-add=$(stat -c "%g" /dev/dri/render*) -v docker_val/:/docker_val openvino/ubuntu22_runtime:latest

# set the following environment variables as per https://github.com/intel/compute-runtime/issues/720:
$ export NEOReadDebugKeys=1
$ export OverrideGpuAddressSpace=48

# run hello_query_device.py
$ source setupvars.sh
$ python3 samples/python/hello_query_device/hello_query_device.py
[ INFO ] Available devices:
[ INFO ] CPU :
[ INFO ]        SUPPORTED_PROPERTIES:
[ INFO ]                AVAILABLE_DEVICES:
[ INFO ]                RANGE_FOR_ASYNC_INFER_REQUESTS: 1, 1, 1
[ INFO ]                RANGE_FOR_STREAMS: 1, 22
[ INFO ]                EXECUTION_DEVICES: CPU
[ INFO ]                FULL_DEVICE_NAME: Intel(R) Core(TM) Ultra 7 155H
[ INFO ]                OPTIMIZATION_CAPABILITIES: FP32, INT8, BIN, EXPORT_IMPORT
[ INFO ]                DEVICE_TYPE: Type.INTEGRATED
[ INFO ]                DEVICE_ARCHITECTURE: intel64
[ INFO ]                NUM_STREAMS: 1
[ INFO ]                INFERENCE_NUM_THREADS: 0
[ INFO ]                PERF_COUNT: False
[ INFO ]                INFERENCE_PRECISION_HINT: <Type: 'float32'>
[ INFO ]                PERFORMANCE_HINT: PerformanceMode.LATENCY
[ INFO ]                EXECUTION_MODE_HINT: ExecutionMode.PERFORMANCE
[ INFO ]                PERFORMANCE_HINT_NUM_REQUESTS: 0
[ INFO ]                ENABLE_CPU_PINNING: True
[ INFO ]                SCHEDULING_CORE_TYPE: SchedulingCoreType.ANY_CORE
[ INFO ]                MODEL_DISTRIBUTION_POLICY: set()
[ INFO ]                ENABLE_HYPER_THREADING: True
[ INFO ]                DEVICE_ID:
[ INFO ]                CPU_DENORMALS_OPTIMIZATION: False
[ INFO ]                LOG_LEVEL: Level.NO
[ INFO ]                CPU_SPARSE_WEIGHTS_DECOMPRESSION_RATE: 1.0
[ INFO ]                DYNAMIC_QUANTIZATION_GROUP_SIZE: 32
[ INFO ]                KV_CACHE_PRECISION: <Type: 'float16'>
[ INFO ]                AFFINITY: Affinity.HYBRID_AWARE
[ INFO ]
[ INFO ] GPU :
[ INFO ]        SUPPORTED_PROPERTIES:
[ INFO ]                AVAILABLE_DEVICES: 0
[ INFO ]                RANGE_FOR_ASYNC_INFER_REQUESTS: 1, 2, 1
[ INFO ]                RANGE_FOR_STREAMS: 1, 2
[ INFO ]                OPTIMAL_BATCH_SIZE: 1
[ INFO ]                MAX_BATCH_SIZE: 1
[ INFO ]                DEVICE_ARCHITECTURE: GPU: vendor=0x8086 arch=v12.70.0
[ INFO ]                FULL_DEVICE_NAME: Intel(R) Graphics [0x7d55] (iGPU)
[ INFO ]                DEVICE_UUID: 8680557d080000000002000000000000
[ INFO ]                DEVICE_LUID: 409a0000499a0000
[ INFO ]                DEVICE_TYPE: Type.INTEGRATED
[ INFO ]                DEVICE_GOPS: {<Type: 'float16'>: 9216.0, <Type: 'float32'>: 4608.0, <Type: 'int8_t'>: 18432.0, <Type: 'uint8_t'>: 18432.0}
[ INFO ]                OPTIMIZATION_CAPABILITIES: FP32, BIN, FP16, INT8, EXPORT_IMPORT
[ INFO ]                GPU_DEVICE_TOTAL_MEM_SIZE: 26662154240
[ INFO ]                GPU_UARCH_VERSION: 12.70.0
[ INFO ]                GPU_EXECUTION_UNITS_COUNT: 128
[ INFO ]                GPU_MEMORY_STATISTICS: {}
[ INFO ]                PERF_COUNT: False
[ INFO ]                MODEL_PRIORITY: Priority.MEDIUM
[ INFO ]                GPU_HOST_TASK_PRIORITY: Priority.MEDIUM
[ INFO ]                GPU_QUEUE_PRIORITY: Priority.MEDIUM
[ INFO ]                GPU_QUEUE_THROTTLE: Priority.MEDIUM
[ INFO ]                GPU_ENABLE_SDPA_OPTIMIZATION: True
[ INFO ]                GPU_ENABLE_LOOP_UNROLLING: True
[ INFO ]                GPU_DISABLE_WINOGRAD_CONVOLUTION: False
[ INFO ]                CACHE_DIR:
[ INFO ]                CACHE_MODE: CacheMode.OPTIMIZE_SPEED
[ INFO ]                PERFORMANCE_HINT: PerformanceMode.LATENCY
[ INFO ]                EXECUTION_MODE_HINT: ExecutionMode.PERFORMANCE
[ INFO ]                COMPILATION_NUM_THREADS: 22
[ INFO ]                NUM_STREAMS: 1
[ INFO ]                PERFORMANCE_HINT_NUM_REQUESTS: 0
[ INFO ]                INFERENCE_PRECISION_HINT: <Type: 'float16'>
[ INFO ]                ENABLE_CPU_PINNING: False
[ INFO ]                DEVICE_ID: 0
[ INFO ]                DYNAMIC_QUANTIZATION_GROUP_SIZE: 0
# to check driver version
$ export gfx_version=$(dpkg-query --showformat='${Version}' --show intel-opencl-icd) && echo $gfx_version
22.43.24595.35+i538~20.04

@khhsenti I just setup my own docker from base 24.04 image, added their installs and got gpu acceleration successfully.