{"id":9832,"library":"intel-opencl-rt","title":"Intel oneAPI OpenCL Runtime","description":"The `intel-opencl-rt` PyPI package provides the Intel® oneAPI OpenCL* Runtime library. This is not a Python library with direct importable modules but rather a runtime provider, installing shared libraries (.so, .dll) that other Python OpenCL binding libraries (e.g., `pyopencl`) can then utilize to access Intel GPUs or CPUs with integrated graphics for general-purpose computing. It is part of the broader Intel oneAPI ecosystem and is updated periodically, often in sync with major oneAPI releases.","status":"active","version":"2025.3.3","language":"python","source_language":"en","source_url":"https://www.intel.com/content/www/us/en/developer/tools/oneapi/opencl-runtime.html","tags":["OpenCL","Intel","GPU","CPU","compute","oneAPI","runtime"],"install":[{"cmd":"pip install intel-opencl-rt","lang":"bash","label":"Install the runtime"}],"dependencies":[],"imports":[{"note":"The `intel-opencl-rt` package provides shared libraries (.so/.dll) that are discovered by other OpenCL binding libraries (like `pyopencl`) at runtime. It does not expose Python symbols for direct import.","wrong":"from intel_opencl_rt import OpenCLDevice","symbol":"Intel OpenCL Runtime","correct":"This package is a runtime, not a Python module to be imported directly."}],"quickstart":{"code":"import pyopencl as cl\nimport numpy\n\n# This code assumes intel-opencl-rt has installed the necessary drivers/runtime.\n# pyopencl will automatically find and use the available OpenCL platform.\n\ntry:\n    platform = cl.get_platforms()[0] # Get the first OpenCL platform\n    devices = platform.get_devices() # Get devices for the platform\n    \n    # Filter for Intel devices if desired, or use the first available.\n    intel_devices = [d for d in devices if 'Intel' in d.vendor]\n    device_to_use = intel_devices[0] if intel_devices else devices[0]\n\n    ctx = cl.Context([device_to_use])\n    queue = cl.CommandQueue(ctx)\n\n    a = numpy.random.rand(50000).astype(numpy.float32)\n    b = numpy.random.rand(50000).astype(numpy.float32)\n\n    mf = cl.mem_flags\n    a_buf = cl.Buffer(ctx, mf.READ_ONLY | mf.COPY_HOST_PTR, hostbuf=a)\n    b_buf = cl.Buffer(ctx, mf.READ_ONLY | mf.COPY_HOST_PTR, hostbuf=b)\n    dest_buf = cl.Buffer(ctx, mf.WRITE_ONLY, a.nbytes)\n\n    prg = cl.Program(ctx, \"__kernel void sum(__global const float *a, __global const float *b, __global float *c) { int gid = get_global_id(0); c[gid] = a[gid] + b[gid]; }\").build()\n\n    prg.sum(queue, a.shape, None, a_buf, b_buf, dest_buf)\n    c = numpy.empty_like(a)\n    cl.enqueue_copy(queue, c, dest_buf).wait()\n\n    print(f\"OpenCL platform: {platform.name}\")\n    print(f\"OpenCL device: {device_to_use.name}\")\n    print(f\"Result calculated via OpenCL: {c[:5]}...\")\n    print(f\"Expected result: {(a+b)[:5]}...\")\n    assert numpy.allclose(c, a + b)\n    print(\"OpenCL computation successful!\")\n\nexcept cl.LogicError as e:\n    print(f\"Failed to initialize OpenCL: {e}\")\n    print(\"Please ensure OpenCL drivers are installed and a compatible device is present.\")\nexcept IndexError:\n    print(\"No OpenCL platforms or devices found. Ensure Intel OpenCL runtime is correctly installed and compatible hardware is available.\")\n\n","lang":"python","description":"This quickstart demonstrates how to use `pyopencl` to perform a simple vector addition, leveraging the OpenCL runtime provided by `intel-opencl-rt`. You will first need to install `pyopencl` (e.g., `pip install pyopencl`). The `intel-opencl-rt` package installs the backend necessary for `pyopencl` to find and utilize Intel OpenCL devices."},"warnings":[{"fix":"Instead of trying to import, install the package and then use a Python OpenCL binding library like `pyopencl` or `pylibopencl`. These libraries will automatically detect the installed OpenCL runtime.","message":"This package is not a Python library for direct import. It installs a system runtime (shared libraries) that other OpenCL Python bindings (like `pyopencl`) discover and use. You will not `import intel_opencl_rt` in your Python code.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure your system has a supported Intel CPU with integrated graphics or an Intel discrete GPU. Verify that necessary system-level drivers are installed and up-to-date, typically via Intel's driver support assistant or by installing the full oneAPI Base Toolkit.","message":"The `intel-opencl-rt` package provides the *runtime*, but requires compatible Intel hardware (e.g., an Intel integrated GPU or discrete GPU) and potentially system-level drivers to function correctly and provide hardware acceleration.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Prefer installing the oneAPI Base Toolkit for a comprehensive and managed installation. Only use `pip install intel-opencl-rt` if you specifically need just the OpenCL runtime in a Python environment and do not have a full oneAPI installation, or if you encounter issues with system-wide installations.","message":"If you have already installed the Intel oneAPI Base Toolkit, installing `intel-opencl-rt` via pip might be redundant or could potentially lead to version conflicts if the pip package's runtime files conflict with the system-wide oneAPI installation.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'access':51 'bind':43 'broader':69 'comput':63,88 'cpu':87 'cpus':55 'direct':26 'dll':38 'e.g':45 'ecosystem':72 'general':61 'general-purpos':60 'gpu':86 'gpus':53 'graphic':58 'import':27 'instal':34 'integr':57 'intel':1,7,14,52,70,85 'intel-opencl-rt':6 'librari':18,24,36,44 'major':81 'modul':28 'often':77 'oneapi':2,15,71,82,89 'opencl':3,8,16,42,84 'packag':11 'part':66 'period':76 'provid':12,33 'purpos':62 'pyopencl':46 'pypi':10 'python':23,41 'rather':30 'releas':83 'rt':9 'runtim':4,17,32,90 'share':35 'sync':79 'updat':75 'util':49","created_at":"2026-04-17T01:20:57.394444+00:00","updated_at":"2026-04-17T01:20:57.394444+00:00","problems":{"verify_error":"no import statement found"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2026.0.0","cli_name":"","cli_version":null,"type":"library","homepage":"https://community.intel.com/t5/OpenCL-for-CPU/bd-p/opencl","github":null,"docs":null,"changelog":null,"pypi":"https://pypi.org/project/intel-opencl-rt/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"skip","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-05","install_tag":null}}