I followed the following instructions in order to set up Cuda inside an LXC container.
When I try to execute the sample ./deviceQuery script inside the container following error is returned:
$ ./deviceQuery
./deviceQuery Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
cudaGetDeviceCount returned 38
-> no CUDA-capable device is detected
Result = FAIL
Cuda is recognised and installed inside the container:
$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2015 NVIDIA Corporation
Built on Tue_Aug_11_14:27:32_CDT_2015
Cuda compilation tools, release 7.5, V7.5.17
The nVidia devices are mounted inside the "host and the LXC container:
$ ls -l /dev/nvidia*
crw-rw-rw- 1 root root 195, 0 Dec 20 23:31 /dev/nvidia0
crw-rw-rw- 1 root root 195, 255 Dec 20 23:31 /dev/nvidiactl
crw-rw-rw- 1 root root 246, 0 Dec 20 23:31 /dev/nvidia-uvm
When I run sudo nvidia-smi
inside the container I get the following error:
Failed to initialize NVML: Unknown Error
How execute Cuda scripts inside containers?