Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Bug in zgetrs() under Windows 10 2004

vssalbert
Beginner
1,629 Views

When running under Windows 10 2004, if the CRT function fmod(x, y) is called with 0 for the x argument prior to calling zgetrs(), zgetrs() returns -nan(ind) for many of the values of the solved for x. The call to fmod() can occur far away and long before.

This is with Visual Studio Professional 2019 versions 16.7.2 and 16.2.3. Attached is code illustrating the problem, when run under Release the output for the vector pB contains several -nan(ind) values. 

zgetrs() returns the expected results if any of the following is true:

- the x argument to fmod() is not 0.

- Debug build is run.

- It is run under Windows 10 1909 or 1903.

- The environment variable MKL_CBWR=COMPATIBLE or MKL_CBWR=SSE2 is set.

 

This was tested using:

- MKL versions 2019 build 4, 2019 build 5, and 2020 build 2.

- Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz 3.40 GHz, 16 GB RAM

- Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz 2.90GHz, 32 GB RAM

- Windows 10 Pro 2004

 

Our production product is experiencing this problem under Windows 10 Pro 2004 with MKL version 2019 build 5. The call to fmod() is occurring much earlier than the call to zgetrs(), and is known to occur in the same thread (it may also happen in separate threads, I have not checked that scenario).

Thanks,

Albert Santos.

Labels (1)
0 Kudos
22 Replies
Gennady_F_Intel
Moderator
1,456 Views

I don't see the problem on my side: win10, command line, MKL version 2020.2

Intel(R) Core(TM) i5-7300U CPU @ 2.60GHz


....MKL_CBWR=COMPATIBLE...

MKL 2020.0.2 Intel(R) 64 architecture

Processor: Intel(R) Streaming SIMD Extensions 2 (Intel(R) SSE2) enabled processors

Info: 0

14.8677 -6.71688

2.89337 -7.12151

2.52554 -5.46729


...MKL_CBWR=SSE2...

MKL 2020.0.2 Intel(R) 64 architecture

Processor: Intel(R) Streaming SIMD Extensions 2 (Intel(R) SSE2) enabled processors

Info: 0

14.8677 -6.71688

2.89337 -7.12151

2.52554 -5.46729


...MKL_CBWR=SSE42...

MKL 2020.0.2 Intel(R) 64 architecture

Processor: Intel(R) Streaming SIMD Extensions 4.2 (Intel(R) SSE4.2) enabled processors

Info: 0

14.8677 -6.71688

2.89337 -7.12151

2.52554 -5.46729


...MKL_CBWR=AVX...

MKL 2020.0.2 Intel(R) 64 architecture

Processor: Intel(R) Advanced Vector Extensions (Intel(R) AVX) enabled processors

Info: 0

14.8677 -6.71688

2.89337 -7.12151

2.52554 -5.46729


...MKL_CBWR=AVX2...

MKL 2020.0.2 Intel(R) 64 architecture

Processor: Intel(R) Advanced Vector Extensions 2 (Intel(R) AVX2) enabled processors

Info: 0

14.8677 -6.71688

2.89337 -7.12151

2.52554 -5.46729



vssalbert
Beginner
1,448 Views

Are you running Windows 10 version 2004? It only started occurring with version 2004. I've also only tried it using Windows 10 Pro, I don't know if the edition affects it.

Gennady_F_Intel
Moderator
1,438 Views

my testing system: Windows 10 Enterprise, version 1809



vss_albert
Beginner
1,417 Views

I get the same results you do in Windows 10 Enterprise, version 1809.

Gennady_F_Intel
Moderator
1,434 Views

the same results were obtained at the Win Server 2012 R2 OS.

I think maybe someone from the community has such OS available and checks the problem.


Gennady_F_Intel
Moderator
1,409 Views

Could you share the output you obtained?


vss_albert
Beginner
1,398 Views

The following are all under Windows 10 Pro version 2004, on an Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz 2.90GHz
32.0 GB RAM:

----

MKL Version String: Intel(R) Math Kernel Library Version 2019.0.5 Product Build 20190808 for Intel(R) 64 architecture applications

Info: 0
-nan(ind) -nan(ind)
-nan(ind) -nan(ind)
-nan(ind) -5.46729

 

----
MKL Version String: Intel(R) Math Kernel Library Version 2020.0.2 Product Build 20200624 for Intel(R) 64 architecture applications

Info: 0
-nan(ind) -nan(ind)
-nan(ind) -nan(ind)
-nan(ind) -5.46729

 

--- If the x = 0.0; line is commented out so fmod(x, 1.) is fmod(10., 1.):
MKL Version String: Intel(R) Math Kernel Library Version 2020.0.2 Product Build 20200624 for Intel(R) 64 architecture applications

Info: 0
14.8677 -6.71688
2.89337 -7.12151
2.52554 -5.46729


--- If MKL_CBWR=SSE2 environment variable is set:
MKL Version String: Intel(R) Math Kernel Library Version 2020.0.2 Product Build 20200624 for Intel(R) 64 architecture applications

Info: 0
14.8677 -6.71688
2.89337 -7.12151
2.52554 -5.46729

 

Gennady_F_Intel
Moderator
1,392 Views

please try to run the exe file from zip file I attached to this reply. the password intel_123_

vss_albert
Beginner
1,377 Views

I get the following:

MKL 2020.0.2 Intel(R) 64 architecture
Processor: Intel(R) Advanced Vector Extensions 2 (Intel(R) AVX2) enabled processors
Info: 0
14.8677 -6.71688
2.89337 -7.12151
2.52554 -5.46729

vss_albert
Beginner
1,355 Views

Note that when I run your test_zgetrs.cpp file as-is I get:

MKL 2020.0.2Intel(R) 64 architecture
Processor: Intel(R) Advanced Vector Extensions 2 (Intel(R) AVX2) enabled processors
Info: 0
14.8677 -6.71688
2.89337 -7.12151
2.52554 -5.46729

 

But if I remove the comment on line 85, the std::cout << "Hello World " << x << std::endl; I get:

 

MKL 2020.0.2Intel(R) 64 architecture
Processor: Intel(R) Advanced Vector Extensions 2 (Intel(R) AVX2) enabled processors
Info: 0
-nan(ind) -nan(ind)
-nan(ind) -nan(ind)
-nan(ind) -5.46729

Hello World! 0

 

I believe what's happening there is the call to fmod() is being optimized away since the result is not needed.

 

pwc
Beginner
1,302 Views

Is there any progress on this bug report? It's been nearly two weeks with no response. We are seeing more customers with this issue when they upgrade to Windows 10 2004.

Gennady_F_Intel
Moderator
1,296 Views

we don't reproduce the problem

with or without comments on line 85, we see the same outputs:


MKL 2020.0.2 Intel(R) 64 architecture

Processor: Intel(R) Advanced Vector Extensions 2 (Intel(R) AVX2) enabled processors

Info: 0

14.8677 -6.71688

2.89337 -7.12151

2.52554 -5.46729


Hello World! -0


Win 10, 64 bit. a sequential version of MKL

Win10, Version 1809 Build 17763.1397


vss_albert
Beginner
1,286 Views

You need to be running Windows 10 Build 2004 (which came out in May, 2020).

Bernard
Black Belt
1,266 Views

If I remember correctly you may enable the the trapping of floating-point exceptions by calling __control87() function. The next step would be a registering your own FP exception (SIGFPE) handler with signal function.

The other option is to break with the help of windbg at the prologue of zgetrs() and observe the content of SIMD registers and in general whole function execution untill QNAN is visible in SIMD registers.

 

Gennady_F_Intel
Moderator
1,283 Views

Yes, it seems the issue happens on this specific OS. The problem is that we still don't use such OS available for testing and validation.



pwc
Beginner
1,274 Views

Can't you simply update one of your machines in your build/test lab or get access to a VM? We can't wait around for Intel to update their internal corporate standard for Win10. If you claim to support Windows, why don't you test on all released versions of Windows?

Gennady_F_Intel
Moderator
1,237 Views

The problem has been checked on Windows 10 version 2004 (OS Build 19041.508)

CPU E5-2697 v2@2.7 GHz


set MKL_VERBOSE=1


#1

//with the line x = 0.0 is commented out 

MKL 2020.0.2Intel(R) 64 architecture

Processor: Intel(R) Advanced Vector Extensions (Intel(R) AVX) enabled processors

MKL_VERBOSE Intel(R) MKL 2020.0 Update 2 Product build 20200624 for Intel(R) 64 architecture Intel(R) Advanced Vector Extensions (Intel(R) AVX) enabled processors, Win 2.70GHz cdecl sequential

MKL_VERBOSE ZGETRS(N,3,1,000001E475CF70C0,3,000001E475D0D600,000001E475D0D500,3,0) 32.13us CNR:OFF Dyn:1 FastMM:1 TID:0 NThr:1

Info: 0

14.8677 -6.71688

2.89337 -7.12151

2.52554 -5.46729


#2

//without the line x = 0.0 

MKL 2020.0.2Intel(R) 64 architecture

Processor: Intel(R) Advanced Vector Extensions (Intel(R) AVX) enabled processors

MKL_VERBOSE Intel(R) MKL 2020.0 Update 2 Product build 20200624 for Intel(R) 64 architecture Intel(R) Advanced Vector Extensions (Intel(R) AVX) enabled processors, Win 2.70GHz cdecl sequential

MKL_VERBOSE ZGETRS(N,3,1,0000014FE28070C0,3,0000014FE281D600,0000014FE281D500,3,0) 19.75us CNR:OFF Dyn:1 FastMM:1 TID:0 NThr:1

Info: 0

14.8677 -6.71688

2.89337 -7.12151

2.52554 -5.46729


The results are the same.


Gennady_F_Intel
Moderator
1,237 Views

The issue is closing and we will no longer respond to this thread. If you require additional assistance from Intel, please start a new thread or submit the ticket to the official Intel Online Service Center.

Any further interaction in this thread will be considered community only. 


vss_albert
Beginner
1,233 Views

Well, his is what I get with MKL_VERBOSE=1:

MKL 2020.0.2Intel(R) 64 architecture
Processor: Intel(R) Advanced Vector Extensions 2 (Intel(R) AVX2) enabled processors
MKL_VERBOSE Intel(R) MKL 2020.0 Update 2 Product build 20200624 for Intel(R) 64 architecture Intel(R) Advanced Vector Extensions 2 (Intel(R) AVX2) enabled processors, Win 3.40GHz cdecl tbb_thread
MKL_VERBOSE ZGETRS(N,3,1,000001E875538F80,3,000001E875539080,000001E8755415C0,3,0) 82.19us CNR:OFF Dyn:1 FastMM:1 TID:0 NThr:4,BLAS:1,FFT:1,VML:1,PARDISO:1
Info: 0
-nan(ind) -nan(ind)
-nan(ind) -nan(ind)
-nan(ind) -5.46729

Hello World! 0

 

 

Bernard
Black Belt
1,019 Views

ZGETRS(N,3,1,000001E875538F80,3,000001E875539080,000001E8755415C0,3,0)

The bold values are a base addresses of argument arrays. It is advised to look at their content with the help of either windbg or (easier) with the help of VS debugger and scan for any QNAN values.

 

 

Reply