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

Severe (157): program exception - access violation when using Fortran & MKL

landstrom__eric
Beginner
1,273 Views

Hi everyone!

I tried installing and running a simple Fortran dot multiplication example to test something, and everything seemed to have gone well with regards to installing Visual Studio 2019 Community and Intel Parallel Studio 2020, and integrating them via the installer. Fortran code runs on the system but when I attempt to use MKL-functions (such as sdot in the code at the bottom of the post) it gives me the following error:

forrtl: severe (157): Program Exception - access violation
Image              PC        Routine            Line        Source
mkl_avx2.dll       7A62D5CA  Unknown               Unknown  Unknown
mkl_core.dll       784955AE  Unknown               Unknown  Unknown
Console2.exe       004813E9  Unknown               Unknown  Unknown
Console2.exe       0048310F  Unknown               Unknown  Unknown
Console2.exe       004860A3  Unknown               Unknown  Unknown
Console2.exe       00485F77  Unknown               Unknown  Unknown
Console2.exe       00485E1D  Unknown               Unknown  Unknown
Console2.exe       00486108  Unknown               Unknown  Unknown
KERNEL32.DLL       75996359  Unknown               Unknown  Unknown
ntdll.dll          77B97B74  Unknown               Unknown  Unknown
ntdll.dll          77B97B44  Unknown               Unknown  Unknown

 

Intel MKL is activated under Project > Configuration Properties > Libraries as Sequential (/Qmkl:sequential) so I presume that it knows where the files are, and that I simply that the permission to access them on my own computer? Is there anything I can do to fix this?

Thank you for your time. :)

The code I'm trying follows if it is of any use to you.

 

    program Console1


    integer :: n,incA,incB
    real :: resd,ress,i
    real, dimension(10) :: A,B

    resd=0
    n = 10
    do i = 1,n
        A(i) = i
        B(i) = i
    end do
    
    

    ress = sdot(n,A,incA,B,incB)
    
    print*,ress

    end program Console1

0 Kudos
1 Solution
mecej4
Honored Contributor III
1,273 Views

You have left incA, incB uninitialized. You probably want them to be set equal to 1 before the call. If they happen to be zero, because of various causes, imagine what will happen.

View solution in original post

0 Kudos
4 Replies
Gennady_F_Intel
Moderator
1,273 Views

Eric, at first glance everything looks correct. The example you use successfully built and ran from the command line. wrt VS - probably there is some problem with integration of parallel studio with VS2019. Could you try to link with MKL manually? Please refer to this article shows some details: https://software.intel.com/en-us/articles/intel-math-kernel-library-intel-mkl-compiling-and-linking-with-microsoft-visual-cc#

0 Kudos
mecej4
Honored Contributor III
1,274 Views

You have left incA, incB uninitialized. You probably want them to be set equal to 1 before the call. If they happen to be zero, because of various causes, imagine what will happen.

0 Kudos
landstrom__eric
Beginner
1,273 Views

mecej4 wrote:

You have left incA, incB uninitialized. You probably want them to be set equal to 1 before the call. If they happen to be zero, because of various causes, imagine what will happen.



I feel amazingly stupid for not noticing it, but I guess that's why you have to ask for help sometimes so that others can notice what you don't. It worked now, massive thanks!

0 Kudos
mecej4
Honored Contributor III
1,273 Views

Happens! Been there, done that.

0 Kudos
Reply