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

ippsConv_32f memory problem

Sasha_G_
Beginner
834 Views

Hi,

I've encountered a strange problem using ippsConv_32f function. It happens once in a while and isn't reproducible all the time.

This function gets 2 pointers to inputs (sizes M and N) and one pointer for output (size N+M-1). 

Even though the inputs are perfectly fine, the function crushes due to a memory problem.

I found that what solves the problem is allocating more space for the first input (N+A instead of N).

I tried putting different values in the extra A places in the first input array and saw that the result isn't effected by these values (as it should be).

So it seems that the function doesn't actually use the extra values but it uses the extra allocated space.

Most of the times the function runs fine, this problem happens only in one case from time to time.

Is it something known? If so, what is the general way to deal with this?

 

Thank you very much,

Sasha.

 

 

0 Kudos
3 Replies
Ying_H_Intel
Employee
834 Views

Dear Sasha, 

Could you provide us some basic information, like  OS, CPU type & IPP version, IPP library. for example, to use the ippsGetLibVersion to get them

void libinfo(void) {
const IppLibraryVersion*
lib = ippsGetLibVersion();
printf(“%s %s %d.%d.%d.%d\n”,
lib->Name, lib->Version,
lib->major,
lib->minor, lib->majorBuild, lib->build);
}
Output:
ippsv8_1.lib 7.0 build 205.68

Regarding the function ippsConv_32f,   does it return ippStsMemAllocErr, which Indicates an error when there is not enough memory for internal buffers? 

 

On the other hand, the function was deprecated in latest IPP 9.0 update 1 version (which of community version can be get fromhttps://software.intel.com/sites/campaigns/nest/).  You may try the new function  ippsConvolve_32f, as the ipp manual example: 

Description
The ippsAutoCorr function is deprecated. For information about the functions that you should use instead,
see the table below.
Deprecated Function Use Instead
ippsConv_32f ippsConvolve_32f
ippsConv_64f ippsConvolve_64f
ippsConv_16s_Sfs ippsConvert_16s32f and
ippsConvolve_32f
 

IppStatus ConvolveExample (void) {

IppStatus status;
const int src1Len = 5, src2Len = 2, dstLen = src1Len+src2Len-1;
Ipp32f pSrc1[src1Len] = {-2.f,0.f,1.f,-1.f,3.f}, pSrc2[src2Len]={0.f,1.f}, pDst[dstLen];
IppEnum funCfg = (IppEnum)(ippAlgAuto);
int bufSize = 0;
Ipp8u *pBuffer;
status = ippsConvolveGetBufferSize(src1Len, src2Len, ipp32f, funCfg, &bufSize);
if ( status != ippStsNoErr )
return status;
pBuffer = ippsMalloc_8u( bufSize );
status = ippsConvolve_32f(pSrc1, src1Len, pSrc2, src2Len, pDst, funCfg, pBuffer);
printf_32f("pDst", pDst, dstLen);
ippsFree( pBuffer );
return status;
}

Best Regards,

Ying H.

Intel IPP Support 

0 Kudos
Sasha_G_
Beginner
834 Views

Hi Yinh H.

Thank you for your reply.

We're working in windows 7, my CPU is: Intel(R) Xeron(R) CPU E5-2630, but this crash happens in at least 2 other computers.

ipp version:  ippsw7_l.lib 7.0 build 205.40 7.0.205.1041

The function doesn't return any status, it just crashes.

I know that this function is deprecated, but we're working with ipp 7 in our application and cannot upgrade now to the next version.

I would also like to emphasize that this crash happens on and off in a specific place in our application and I couldn't reproduce this crash in a clean project.

Was there any known issue with this function before it was deprecated?

If so, is there some kind of a workaround? 

Thank you very much for your help,

Sasha.

 

 

0 Kudos
Ying_H_Intel
Employee
834 Views

Hi Sasha,

I checked the bug list in IPP 7.0 and later

https://software.intel.com/en-us/articles/intel-ipp-70-library-bug-fixes/

DPD200259470 Bug in IppiConvValid_32f_C1R for x64 bit code

https://software.intel.com/en-us/intel-ipp-80-library-release-notes

Only found one

ippsConv_32f produced wrong result on AVX related to ippsConv_32f, but it is about AVX code, was fixed in IPP 8.0

Description of Codes Associated with Processor-Specific Libraries
 IA-32 Intel® architecture  Intel® 64 architecture

Description

px

mx

Generic code optimized for processors with Intel® Streaming SIMD Extensions (Intel® SSE)

w7

 

Optimized for processors with Intel SSE2

 

m7

Optimized for processors with Intel SSE3

v8

u8

Optimized for processors with Supplemental Streaming SIMD Extensions 3 (SSSE3), including the Intel® Atom™ processor

p8

y8

Optimized for processors with Intel SSE4.1

g9

e9

Optimized for processors with Intel® Advanced Vector Extensions (Intel® AVX) and Intel® Advanced Encryption Standard New Instructions (Intel® AES-NI)

h9

l9

Optimized for processors with Intel AVX2

On the other hand, Intel(R) Xeron(R) CPU E5-2630 should support AVX, so by default,  ippsw7_l.lib 7.0 build 205.40 7.0.205.1041 is not expected.

so I can't validate if it is IPP bug. But you mentioned this crash happens on and off in a specific place in our application.  it seems related to environment also. 

About the workaround, as early ippsConv use internal memory, so the issue mainly related to memory, you may workaround it by add more memory as you mentioned first time.

or try latest IPP version.  ( It may be complicated and not supported,  you can create a your own static library (only including one conv function) based on latest IPP version, then use other from 7.0.

Best Regards,

Ying

0 Kudos
Reply