OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1722 Discussions

Intel NEO operation on docker container

milani__peter1
New Contributor I
2,909 Views

I am running some opencl programs inside a docker container. To test the environment I am running clinfo as an entry point for the container. But it is not detecting NEO platforms.

Googling shows that other opencl targets require the docker container to be called with a device argument pointing to /dev/dri:

docker run --device=/dev/dri <image> clinfo

but I am not sure that this is what is require for intel devices.

I can get access to the CPU opencl device after installing the CPU opencl driver.

My Dockerfile is below which is called from a directory with the following structure:

Dockerfile

neo /<neo .deb files and firmware .bin files>

<opencl cpu drivers for intel>

Dockerfile:

FROM ubuntu:16.04

# ROS
RUN apt-get update && apt-get install -y \
    python-rosinstall \
    liblua5.2 \
    libeigen3-dev \
    libsuitesparse-dev \
    liblog4cxx10v5 \
    python-yaml \
    libcairo2 \
    gfortran \
    libhdf5-serial-dev \
    libpcl-dev \
    libpcap0.8 \
    libatlas-base-dev \
    libarpack2 \
    libblas3 \
    libboost-filesystem1.58.0 \
    libboost-iostreams1.58.0 \
    libboost-program-options1.58.0 \
    libboost-python1.58.0 \
    libboost-system1.58.0 \
    libboost-thread1.58.0 \
    libboost-timer1.58.0 \
    libc6 \
    libcairo2 \
    libcholmod3.0.6 \
    libconsole-bridge0.2v5 \
    libgcc1 \
    libgflags2v5 \
    libgfortran3 \
    libgomp1 \
    libgoogle-glog0v5 \
    libhdf5-10 \
    libhdf5-cpp-11 \
    liblapack3 \
    liblog4cxx10v5 \
    liblua5.2-0 \
    libmetis5 \
    libnlopt0 \
    libogre-1.9.0v5 \
    libopenblas-base \
    libpcap0.8 \
    libpcl-common1.7 \
    libprotobuf9v5 \
    libpython2.7 \
    libspqr2.0.2 \
    libstdc++6 \
    libsz2 \
    liburdfdom-world0.4 \
    libwebp5 \
    libyaml-cpp0.5v5 \
    libyaml-0-2 \
    zlib1g \
    cython \
    exfat-fuse \
    python-psutil \
    python-requests \
    libgeotiff2 \
    iputils-ping \
    alien

# Other tooling
RUN apt-get update && apt-get install -y \
    logrotate \
    git \
    vim \
   clinfo \
   dkms \
   ocl-icd-opencl-dev

# OpenCL for CPU and GPU
ARG INTEL_DRIVER=opencl_runtime_16.1.2_x64_rh_6.4.0.37.tgz
ARG INTEL_DRIVER_URL=http://registrationcenter-download.intel.com/akdlm/irc_nas/9019

RUN mkdir -p /tmp/opencl-driver-intel
WORKDIR /tmp/opencl-driver-intel
COPY opencl_runtime_16.1.2_x64_rh_6.4.0.37.tgz .
COPY neo $WORKDIR
RUN mkdir -p /lib/firmware/intel && dpkg -i *.deb && cp *.bin /lib/firmware/intel && rm *.deb && rm *.bin
# SRB 5 uses a zip file; older drivers use .tgz
RUN echo INTEL_DRIVER is $INTEL_DRIVER; \
    
    if echo $INTEL_DRIVER | grep -q "[.]zip$"; then \
        unzip $INTEL_DRIVER; \
        mkdir fakeroot; \
        for f in intel-opencl-*.tar.xz; do tar -C fakeroot -Jxvf $f; done; \
        cp -R fakeroot/* /; \
        ldconfig; \
    else \
        tar -xzf $INTEL_DRIVER; \
        for i in $(basename $INTEL_DRIVER .tgz)/rpm/*.rpm; do alien --to-deb $i; done; \
        dpkg -i *.deb; \
        rm -rf $INTEL_DRIVER $(basename $INTEL_DRIVER .tgz) *.deb; \
        mkdir -p /etc/OpenCL/vendors; \
        echo /opt/intel/*/lib64/libintelocl.so > /etc/OpenCL/vendors/intel.icd; \
    fi; \
rm -rf /tmp/opencl-driver-intel;
0 Kudos
1 Reply
JACEK_D_Intel
Employee
2,909 Views

You can use this github repository as reference. Feel free to ask any additional questions.

0 Kudos
Reply