Ask Your Question
0

gpu decoder- all CUDA-capable devices are busy or unavailable in function 'allocate'

asked 2019-02-08 06:57:50 -0500

minesh1291 gravatar image

updated 2019-02-08 08:28:39 -0500

Eduardo gravatar image

I'm trying to run an OpenCV sample code presented here: https://github.com/opencv/opencv/blob..., but it gives following error at cv::cudacodec::createVideoReader(fname).

Error:

terminate called after throwing an instance of 'cv::Exception'
  what():  OpenC`enter code here`V(4.0.1) /opt/GPU_READ/opencv-4.0.1/modules/core/src/cuda/gpu_mat.cu:121: error: (-217:Gpu API call) all CUDA-capable devices are busy or unavailable in function 'allocate'

Aborted (core dumped)

Nvidia version : NVIDIA-SMI 390.96

This is a configuration of OpenCV:

cmake -D CMAKE_BUILD_TYPE=RELEASE  -D WITH_FFMPEG=ON -D WITH_CUDA=ON -D WITH_NVCUVID=ON -D ENABLE_FAST_MATH=1 -D CUDA_FAST_MATH=1 -D CMAKE_INSTALL_PREFIX=/usr/local -D INSTALL_PYTHON_EXAMPLES=ON -D INSTALL_C_EXAMPLES=ON -D BUILD_JAVA=OFF -D BUILD_SHARED_LIBS=ON -D BUILD_DOCS=OFF -D OPENCV_EXTRA_MODULES_PATH=/tmp/opencv_contrib-4.0.1/modules -D BUILD_EXAMPLES=ON -D WITH_VFW=ON -DWITH_GSTREAMER=ON -D WITH_OPENGL=ON -DWITH_MSMF=ON -D WITH_QT=ON  .. 


-- General configuration for OpenCV 4.0.1 =====================================

-- Version control: unknown

--   Extra modules:

-- Location (extra): /opt/GPU_READ/opencv_contrib-4.0.1/modules



Version control (extra): unknown

--   Platform:
--     Timestamp:                   2019-02-07T08:07:28Z
--     Host:                        Linux 4.15.0-1032-aws x86_64
--     CMake:                       3.5.1
--     CMake generator:             Unix Makefiles
--     CMake build tool:            /usr/bin/make

-- Configuration: RELEASE

--   CPU/HW features:
--     Baseline:                    SSE SSE2 SSE3
--       requested:                 SSE3
--     Dispatched code generation:  SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX
--       requested:                 SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
--       SSE4_1 (7 files):          + SSSE3 SSE4_1
--       SSE4_2 (2 files):          + SSSE3 SSE4_1 POPCNT SSE4_2
--       FP16 (1 files):            + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
--       AVX (5 files):             + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
--       AVX2 (13 files):           + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2

-- AVX512_SKX (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_SKX

   C/C++:
--     Built as dynamic libs?:      YES
--     C++ Compiler:                /usr/bin/c++  (ver 5.4.0)
C++ flags (Release):         -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
--     C++ flags (Debug):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
--     C Compiler:                  /usr/bin/cc
--     C flags (Release):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
--     C flags (Debug):             -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
--     Linker flags (Release):
--     Linker flags (Debug):
--     ccache:                      NO
--     Precompiled headers:         YES
--     Extra dependencies:          dl m pthread rt /usr/lib/x86_64-linux-gnu/libGLU.so /usr/lib/x86_64-linux-gnu/libGL ...
(more)
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-02-09 13:46:09 -0500

Do any of the CUDA samples run? If not does deviceQuery work?

edit flag offensive delete link more

Comments

Successfully able to run sample code ./1_Utilities/deviceQuery and ./1_Utilities/bandwidthTest

root@c55e19ecd607:~/NVIDIA_CUDA-9.1_Samples# ./1_Utilities/bandwidthTest/bandwidthTest [CUDA Bandwidth Test] - Starting... Running on...

Device 0: Tesla M60 Quick Mode

Host to Device Bandwidth, 1 Device(s) PINNED Memory Transfers Transfer Size (Bytes) Bandwidth(MB/s) 33554432 7780.4

Device to Host Bandwidth, 1 Device(s) PINNED Memory Transfers Transfer Size (Bytes) Bandwidth(MB/s) 33554432 9469.3

Device to Device Bandwidth, 1 Device(s) PINNED Memory Transfers Transfer Size (Bytes) Bandwidth(MB/s) 33554432 117049.8

Result = PASS

NOTE: The CUDA Samples are not meant for performance measurements. Results may vary when GPU Boost is enabled

minesh1291 gravatar imageminesh1291 ( 2019-02-11 00:49:41 -0500 )edit

That's great, what about the other OpenCv CUDA samples?

cudawarped gravatar imagecudawarped ( 2019-02-11 04:37:05 -0500 )edit

I tried to run other examples from 0_Simple , 4_Finance , 6_Advanced, 1_Utilities, 3_Imaging, 5_Simulations, 7_CUDALibraries diectory and it seems fine.

minesh1291 gravatar imageminesh1291 ( 2019-02-11 05:09:55 -0500 )edit

Hi, I mean the OpenCV samples, for example example_gpu_hog.exe. I will try to run the example_gpu_video_reader.exe later to check if it works.

cudawarped gravatar imagecudawarped ( 2019-02-11 07:02:44 -0500 )edit

Yes , able to run opencv/samples/gpu/bgfg_segm.cpp sample code .

minesh1291 gravatar imageminesh1291 ( 2019-02-11 23:48:51 -0500 )edit

Hi , From Gpu smaple code i try opencv/samples/gpu/hog.cpp and iis running without any error. and using nvidia-smi command i verify its accessing gpu memory.

minesh1291 gravatar imageminesh1291 ( 2019-02-13 02:12:20 -0500 )edit

OK it must be that specific routine, unfortunately I don't have a CUDA 9.1 compiled version to check that specific example, nvcuvid is depreciated in CUDA 10.0. Someone here must have a compiled version they could check for you?

cudawarped gravatar imagecudawarped ( 2019-02-13 04:53:19 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-02-08 06:57:50 -0500

Seen: 158 times

Last updated: Feb 09