Python script to print available execution providers and devices:
# pip install openvino
import openvino as ov
core = ov.Core()
for d in core.available_devices:
print(d, "-", core.get_property(d, "FULL_DEVICE_NAME"))
To access iGPU on current machine:
sudo apt install intel-opencl-icd
sudo usermod -a -G render $LOGNAME
Optional tools, helpful for debugging:
sudo apt install htop clinfo intel-gpu-tools
- clinfo - detailed info about devices available
- htop - cpu and mem utilisation
- intel_gpu_top - igpu load
For docker:
FROM python:3.12-slim
# intel-opencl-icd is required
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends intel-opencl-icd && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN pip install --no-cache-dir openvino
COPY main.py .
CMD ["python", "main.py"]
docker-compose.yml
services:
app:
build:
context: .
devices:
- /dev/dri:/dev/dri
User inside docker must be root, otherwise you have to deal with permissions.
Top comments (0)