Skip to content

Access violation on 64-bit Windows when using LAPACKE_dgesv #214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
asansottera opened this issue Apr 21, 2013 · 8 comments
Closed

Access violation on 64-bit Windows when using LAPACKE_dgesv #214

asansottera opened this issue Apr 21, 2013 · 8 comments
Assignees
Labels

Comments

@asansottera
Copy link

Dear xianyi,
first, I would like to thank you for your useful work on OpenBLAS. Unfortunately, I encountered an issue on 64-bit Windows 8.
When calling LAPACKE_dgesv from a C++ program compiled with Visual Studio 2012, I encounter the following error:
"Unhandled exception at 0x000000006CCAD850 (libopenblas.dll) in TestOpenBLAS.exe: 0xC0000005: Access violation writing location 0x00000000C55F4000."
When I compile the same program with g++, no access violation occurs, however, I noticed that some computations after the call yield an incorrect result, probably suggesting a corrupted stack.
On Linux, the same code runs cleanly under valgrind. Moreover, sgemm and dgemm and seem to work fine on both Linux and Windows.
If you have the to investigate this issue, I will send you the source code.

PS The issue occurs with both OpenBLAS 0.2.6 and the develop branch.

@xianyi
Copy link
Collaborator

xianyi commented Apr 22, 2013

Hi @beagle2011

Thank you for the feedback.

Please upload the test code to gist.github.com or send me email traits.zhang at gmail.com

Xianyi

@asansottera
Copy link
Author

Hi @xianyi,
I uploaded the source code here: https://gist.github.com/beagle2011/5432922
My machine is a Core i7 3930k, hence a sandybridge, but the error also occurs on my Laptop, which is a westemere. Please let me know if you need any further information.

@xianyi
Copy link
Collaborator

xianyi commented Apr 23, 2013

@beagle2011 ,
Thank you. I will debug this error.

Xianyi

@asansottera
Copy link
Author

Thanks @xianyi. On a side note, I just run the DGESV benchmark on Linux (1 right-hand side, varying n), and it turns out OpenBLAS is outperforming the latest version of MKL by a significant margin on my system, especially from n >= 2048. Congrats! There is also a small advantage at small matrix sizes (not visible from the plot), which is I suppose might be due to dynamic dispatching in MKL versus static dispatching in OpenBLAS.
dgesv

@xianyi
Copy link
Collaborator

xianyi commented May 4, 2013

Hi @beagle2011 ,

Did you try the single thread OpenBLAS in VS 2012?

For example, export OPENBLAS_NUM_THREADS=1

Xianyi

@asansottera
Copy link
Author

Hi @xianyi,
I just tried with the single-threaded OpenBLAS (compiled with USE_THREAD=0) in VS 2012 and it made no difference:
Unhandled exception at 0x000000006CCAD5B0 (libopenblas.dll) in TestOpenBLAS.exe: 0xC0000005: Access violation writing location 0x00000000433C4000.

@xianyi
Copy link
Collaborator

xianyi commented Jul 10, 2013

Hi @beagle2011 ,

How many CPU cores on your windows box?

Xianyi

xianyi added a commit that referenced this issue Jul 10, 2013
I used a smaller threshold since the stack size is 1MB on windows.
@asansottera
Copy link
Author

Hi @xianyi,
my desktop has 6 Sandy Bridge cores but the error also occurred on my dual-core Westmere laptop.
I will try your fix soon.

Thanks

@wernsaar wernsaar closed this as completed Jun 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants