Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

OMP error #136 cannot create thread

bharath322
Beginner
2,668 Views
Hi all,

I am trying to play multiple h264 videos in the same application using intel IPP 7.0 decoder.
I am able to play the different videos within single application by passing to IPP h264 decoder. But during the videos being played if the memory usage of my CPU goes beyond 1.5 GB(approximately) i usually getthe errors calledOMP : Error #136: cannot create thread, OMP: System error #8 :not enough storage is available to processthis commandin cmd line and crashes theapplication. I have high end CPU which has memory 8GB xeon dualprocessor runs 64 bit windows server 2008.

Anybody's help will be greatly appreciated.

Please help me.

0 Kudos
11 Replies
SergeyKostrov
Valued Contributor II
2,668 Views
Quoting bharath322
...
OMP : Error #136: (1)cannot create thread, OMP: (2)System error #8 :not enough storage is available to processthis commandin cmd line and crashes theapplication...
...

(1) It cannot createstack for a newthread
(2) '8'is a system error code returned by 'GetLastError' Win32 API function

I had a similar 'System Error 8' for a TBB application when256 tasks ( threads )were created and a
system couldn't create a 257th task (thread ). I used a #pragma commentdirective to increase a size of
the stack for the application:

#pragma comment( linker, "/HEAP:1069547520,1069547520" ) // 2GB in total

Best regards,
Sergey
0 Kudos
Ying_H_Intel
Employee
2,668 Views
Right, eitherextend the size ofstack or storage space of application. for example, use sergey's suggsetion
Or try to build 64bit application, which may allowbigger storage.
Or control/reduce the openmpthread number and satic. for example, set envioronment
KMP_STACKSIZE = 1M etc.
OMP_NUM_THREADS=4 etc.
Similiar issues is in
http://software.intel.com/en-us/forums/showthread.php?t=71296

Best Regards,
Ying
0 Kudos
SergeyKostrov
Valued Contributor II
2,668 Views
Three more notes:

- In your casea Virtual Memory size has to be more than 2GB
- There are some issues when #pragma comment ( lib, ... ) directive is used in a DLL
- A Stask size for an applicationcould be alsoincreased through:

Project Settings -> Linker -> Stack Reserve/Commit Size

Best regards,
Sergey
0 Kudos
Sergey_K_Intel
Employee
2,668 Views
Quoting bharath322
Hi all,

I am trying to play multiple h264 videos in the same application using intel IPP 7.0 decoder.
I am able to play the different videos within single application by passing to IPP h264 decoder. But during the videos being played if the memory usage of my CPU goes beyond 1.5 GB(approximately) i usually getthe errors calledOMP : Error #136: cannot create thread, OMP: System error #8 :not enough storage is available to processthis commandin cmd line and crashes theapplication. I have high end CPU which has memory 8GB xeon dualprocessor runs 64 bit windows server 2008.

Anybody's help will be greatly appreciated.

Please help me.

Hi,

Do you mean that your H.264 decoding application takes 1.5 GB of virtual memory? Is it intended behaviour? Or, the memory is consumed by other applications and H.264 just suffers from lack of memory?

Regards,
Sergey

0 Kudos
bharath322
Beginner
2,668 Views

Sergey,

Many thanks for helping me with quick reply's.

I mean the H264 decoding applicationconsumes 1.5 GB or more of physical memory. Iam able to play simulatenously around 20 h264 individual videos in the same application, in this condition my application consumesaround 1.5-1.6GB of physical memory and this condition worksfor me. But when Itry toplay simulatenously around 25 h264 individual videos in the same application, in this condition my application crashesby giving the errori explained firstly and the physical memory goes beyond 1.6GB approximately.
My h264 videofile is ofsize around 30.5MB and the resolutionof the video is 2560 * 1920.


I have tried the following settings in my system

1) setting environment KMP_STACSIZE = 1M/2M/4M etc.

2) setting OMP_NUM_THREADS = 4

3) By setting Project Settings -> Linker -> Stack Reserve/Commit Size also.

Next try i have to do is to build 64 bit application may be that helps i hope so as per your suggestions.
0 Kudos
Sergey_K_Intel
Employee
2,668 Views
Quoting bharath322

Iam able to play simulatenously around 20 h264 individual videos in the same application

.....

My h264 videofile is ofsize around 30.5MB and the resolutionof the video is 2560 * 1920.

You're the champion! )) May be better solution will be to spawn individual processes each to decode individual stream?

Seriously speaking, OpenMP manipulations will probably not help, since H.264 decoder (!) does not use OpenMP. H.264 encoder does, but not decoder. Could you describe the conditions? I am trying to understand where and how OMP gets into the game. Could you, by the way, say how many threads are created in your application in total (using task manager process statistics)?

Regards,
Sergey

0 Kudos
SergeyKostrov
Valued Contributor II
2,668 Views
Quoting bharath322
...in this condition my application consumesaround 1.5-1.6GB of physical memory and this condition
worksfor me. But when Itry toplay simulatenously around 25 h264 individual videos in the same
application, in this condition my application crashesby giving the error...

On a 32-bit Windows platform an application cannot use more that 2GB of memory. There is a possibility
that as soon as 25 or more videos are loaded the application could exceed that limit. In that case all
calls to 'malloc', 'calloc', 'new' or an attempt to create stack for a newthread will fail. Increasing a Virtual
Memory file doesn't help. There are two solutions: a "switch" to a 64-bit Windows platform orto a 32-bit
Windows platform that supports Microsoft's Address Windowing Extensions ( AWE ) technology.
0 Kudos
SergeyKostrov
Valued Contributor II
2,668 Views
One more note regardingMemory Leaks. If there are some in your application that will increase total amount
of allocated memoryover the time.

Best regards,
Sergey
0 Kudos
bharath322
Beginner
2,668 Views
Hi,

When i run 20 videos then totally 83 threads are created as per the statistics from the task manager process.
To switch to 64-bit application, Do i need to build all the audio-video codecs samples in 64-bit compiler?
Thanking you.
Regards,
Bharath
0 Kudos
Sergey_K_Intel
Employee
2,668 Views
Quoting bharath322
Do i need to build all the audio-video codecs samples in 64-bit compiler?

Yes, of course. And use 64-bit IPP libraries.

Good luck,
Sergey

0 Kudos
SergeyKostrov
Valued Contributor II
2,668 Views
Quoting bharath322
...When i run 20 videos then totally 83 threads are created as per the statistics from the task manager process...


OnWindows platforms a relatively small amount of memory is allocated for a stackwhen a new thread is
created and it is 1MB by default.

As soon as the thread is "alive" it could use lots of memory and lots of threads could use too much memory.
This is what you have now and the problem is not related to the number of threads. It is related to an
amount of memory allocated in total.

A "move" to a 64-bit environment is a good step but I don't think that you used all opportunities to
optimize / improveyour 32-bit application.

Best regards,
Sergey

0 Kudos
Reply