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

Running linux container from windows host with GPU support #241

Open
miccio-dk opened this issue Jun 17, 2022 · 3 comments
Open

Running linux container from windows host with GPU support #241

miccio-dk opened this issue Jun 17, 2022 · 3 comments

Comments

@miccio-dk
Copy link

miccio-dk commented Jun 17, 2022

I would like to run a Linux-based container image (currently tried openvino_cgvh_data_dev_2021.4.2) from a Windows host and would like to run inference on GPU.

I tried passing --device /dev/dri which resulted in:

docker: Error response from daemon: error gathering device information while adding custom device "/dev/dri": no such file or directory.

I also tried passing --gpus=all which allowed me to run the container, but as soon as I tried one of the demos with -d GPU I got the following:

###################################################
Run Inference Engine classification sample
Run ./classification_sample_async -d GPU -i /opt/intel/openvino/deployment_tools/demo/car.png -m /root/openvino_models/ir/public/squeezenet1.1/FP16/squeezenet1.1.xml
...
[ INFO ] Device info:
[ ERROR ] Failed to create plugin /opt/intel/openvino/deployment_tools/inference_engine/lib/intel64/libclDNNPlugin.so for device GPU
Please, check your environment
[CLDNN ERROR]. clGetPlatformIDs error -1001
Error on or near line 217; exiting with status 1

Is it possible to map the GPU from windows (host) to linux (container)?
Thanks in advance.

@ryanloney
Copy link

@miccio-dk Please see the instructions here about running iGPU using Windows Subsystem for Linux 2 (WSL2): https://github.com/openvinotoolkit/docker_ci/blob/master/get-started.md#run-a-container

image

@miccio-dk
Copy link
Author

Thanks for the prompt answer, unfortunately adding the arguments mentioned above doesn't seem to help.
Here are my steps:

# start a new container (ubuntu20_dev:2021.4.2 is my image based on the openvino_cgvh_data_dev_2021.4.2 dockerfile)
docker run -itu root:root --rm --device /dev/dxg --volume /usr/lib/wsl:/usr/lib/wsl ubuntu20_dev:2021.4.2
# once inside the container, install sudo
apt-get update && apt-get install -y sudo
# navigate inside demo directory
cd /opt/intel/openvino/deployment_tools/demo
# run demo
./demo_security_barrier_camera.sh -d GPU

This is the output message

###################################################

Run Inference Engine security_barrier_camera demo

Run ./security_barrier_camera_demo -d GPU -d_va GPU -d_lpr GPU -i /opt/intel/openvino_2021.4.752/deployment_tools/demo/car_1.bmp -m /root/openvino_models/ir/intel/vehicle-license-plate-detection-barrier-0106/FP16/vehicle-license-plate-detection-barrier-0106.xml -m_lpr /root/openvino_models/ir/intel/license-plate-recognition-barrier-0001/FP16/license-plate-recognition-barrier-0001.xml -m_va /root/openvino_models/ir/intel/vehicle-attributes-recognition-barrier-0039/FP16/vehicle-attributes-recognition-barrier-0039.xml

[ INFO ] InferenceEngine:       IE version ......... 2021.4
        Build ........... 2
[ INFO ] Files were added: 1
[ INFO ]     /opt/intel/openvino_2021.4.752/deployment_tools/demo/car_1.bmp
[ INFO ] Loading device GPU
[ ERROR ] Failed to create plugin /opt/intel/openvino_2021.4.752/deployment_tools/inference_engine/lib/intel64/libclDNNPlugin.so for device GPU
Please, check your environment
[CLDNN ERROR]. clGetPlatformIDs error -1001

Error on or near line 198; exiting with status 1

This time, when trying to run nvidia-smi inside the container, i get a "command not found error". If I run /usr/lib/wsl/lib/nvidia-smi or if I add the directory to $PATH, i get:

NVIDIA-SMI couldn't find libnvidia-ml.so library in your system. Please make sure that the NVIDIA Display Driver is properly installed and present in your system.
Please also try adding directory that contains libnvidia-ml.so to your system PATH.

Note that /usr/lib/wsl/lib/ contains libnvidia-ml.so.1.

@ryanloney
Copy link

@miccio-dk the GPU support is for Intel GPUs, not Nvidia. OpenVINO support for Nvidia GPU is limited. An open source module is available here: https://github.com/openvinotoolkit/openvino_contrib/tree/releases/2021/4/modules/cuda_plugin

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

2 participants