# \#mkl

**URL:** https://discourse.julialang.org/tag/mkl/105.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [How to circumvent Intel's AMD discrimination in MKL from v1.7 onwards?](https://discourse.julialang.org/t/how-to-circumvent-intels-amd-discrimination-in-mkl-from-v1-7-onwards/105075)

<div class="topic-metadata">

**Author:** [@fgerick](https://discourse.julialang.org/u/fgerick)\
**Replies:** 2\
**Last updated:** [May 16, 2025, 3:55pm UTC](https://discourse.julialang.org/t/how-to-circumvent-intels-amd-discrimination-in-mkl-from-v1-7-onwards/105075 "2025-05-16T15:55:32Z")

</div>

Hi everyone, I’ve been ending up having to compute a lot of large dense non-hermitian eigenproblems on an HPC cluster that uses AMD EPYC Milan CPUs. I thought I could use Intel MKL, since it usually does a better job fo…

---

## [How to call blas getrf, getri properly ? i want to create a benchmark inverse matrix using gauss, crout, native julia inv(A) and BLAS direct](https://discourse.julialang.org/t/how-to-call-blas-getrf-getri-properly-i-want-to-create-a-benchmark-inverse-matrix-using-gauss-crout-native-julia-inv-a-and-blas-direct/128771)

<div class="topic-metadata">

**Author:** [@Roberto\_Bagyo](https://discourse.julialang.org/u/Roberto_Bagyo)\
**Replies:** 5\
**Last updated:** [May 7, 2025, 5:38pm UTC](https://discourse.julialang.org/t/how-to-call-blas-getrf-getri-properly-i-want-to-create-a-benchmark-inverse-matrix-using-gauss-crout-native-julia-inv-a-and-blas-direct/128771 "2025-05-07T17:38:06Z")

</div>

hello, i am new here. fortran based but just for fun actually. i tried to convert test\_fpu.f90 from polyhedron benchmark inverse matrix. i heard julia is multihreading and easier to code, then dgemm performance is highe…

---

## [Correct way to set MKL threads at runtime](https://discourse.julialang.org/t/correct-way-to-set-mkl-threads-at-runtime/128470)

<div class="topic-metadata">

**Author:** [@VinceNeede](https://discourse.julialang.org/u/VinceNeede)\
**Replies:** 4\
**Last updated:** [April 28, 2025, 6:50pm UTC](https://discourse.julialang.org/t/correct-way-to-set-mkl-threads-at-runtime/128470 "2025-04-28T18:50:01Z")

</div>

What is the correct way to set MKL threads at runtime? Documentation seems to be misleading, it says to use BLAS.set\_num\_threads(1) to be single threaded, but it does not work. The only way I have found to actually make …

---

## [Reducing app size](https://discourse.julialang.org/t/reducing-app-size/125957)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 1\
**Last updated:** [February 16, 2025, 1:23pm UTC](https://discourse.julialang.org/t/reducing-app-size/125957 "2025-02-16T13:23:34Z")

</div>

I have a package that I want deploy as application in a docker container. I am trying to reduce the size. Current sizes: 1,7G /tmp/testdepot/ 514M /tmp/test The second item is mainly the compiled system image. I…

---

## [Segmentation fault when using ccall to call a BLAS-like extension function from Intel MKL](https://discourse.julialang.org/t/segmentation-fault-when-using-ccall-to-call-a-blas-like-extension-function-from-intel-mkl/123377)

<div class="topic-metadata">

**Author:** [@NatSpring](https://discourse.julialang.org/u/NatSpring)\
**Replies:** 7\
**Last updated:** [December 3, 2024, 9:27am UTC](https://discourse.julialang.org/t/segmentation-fault-when-using-ccall-to-call-a-blas-like-extension-function-from-intel-mkl/123377 "2024-12-03T09:27:02Z")

</div>

I have written many Julia wrapper-functions that call routines from various parts of the Intel oneAPI library via the library’s .so file with ccall. This typically works without issue for BLAS routines, LAPACK routines a…

---

## [Precompilation warning - in which package should it be fixed?](https://discourse.julialang.org/t/precompilation-warning-in-which-package-should-it-be-fixed/118520)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 9\
**Last updated:** [September 3, 2024, 10:36am UTC](https://discourse.julialang.org/t/precompilation-warning-in-which-package-should-it-be-fixed/118520 "2024-09-03T10:36:47Z")

</div>

If I run the following script: #!/bin/bash -eu rm -rf /tmp/testdepot mkdir /tmp/testdepot rm -rf /tmp/test mkdir /tmp/test cd /tmp/test export JULIA\_DEPOT\_PATH=/tmp/testdepot julia --project="." -e "using Pkg; Pkg.add(…

---

## [Fastest way to perform A \* B \* A’](https://discourse.julialang.org/t/fastest-way-to-perform-a-b-a/117386)

<div class="topic-metadata">

**Author:** [@eveningsilverfox](https://discourse.julialang.org/u/eveningsilverfox)\
**Replies:** 9\
**Last updated:** [August 13, 2024, 12:30pm UTC](https://discourse.julialang.org/t/fastest-way-to-perform-a-b-a/117386 "2024-08-13T12:30:08Z")

</div>

Given two dense square matrices with ComplexF64 elements of size approximately 100000X100000, A and B, what is the fastest way to perform R=ABA’, where A’=conj(tr(A)) is the Hermitian conjugate of A?. If it helps: (1) …

---

## [Fastest way to perform A\[a,:\] \* B \* A’\[:,b\] where a and b are vectors of indices](https://discourse.julialang.org/t/fastest-way-to-perform-a-a-b-a-b-where-a-and-b-are-vectors-of-indices/117958)

<div class="topic-metadata">

**Author:** [@eveningsilverfox](https://discourse.julialang.org/u/eveningsilverfox)\
**Replies:** 5\
**Last updated:** [August 8, 2024, 8:37pm UTC](https://discourse.julialang.org/t/fastest-way-to-perform-a-a-b-a-b-where-a-and-b-are-vectors-of-indices/117958 "2024-08-08T20:37:31Z")

</div>

This question is a follow-up to To recap, given two dense square matrices with ComplexF64 elements of size approximately 100000X100000, A and B, what is the fastest way to perform R=ABA’, where A’=conj(tr(A)) is the He…

---

## [Installing MKL on Windows fails](https://discourse.julialang.org/t/installing-mkl-on-windows-fails/114149)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 2\
**Last updated:** [May 12, 2024, 10:33am UTC](https://discourse.julialang.org/t/installing-mkl-on-windows-fails/114149 "2024-05-12T10:33:17Z")

</div>

Installing MKL on a freshly installed Windows 10.0 home fails: C:\\Users\\ufechner\\tmp\>julia --project \_ \_ \_ \_(\_)\_ | Documentation: https://docs.julialang.org (\_) | (\_) (\_) | \_ \_ …

---

## [Acceleration of Intel MKL on AMD Ryzen CPU's](https://discourse.julialang.org/t/acceleration-of-intel-mkl-on-amd-ryzen-cpus/31287)

<div class="topic-metadata">

**Author:** [@RoyiAvital](https://discourse.julialang.org/u/RoyiAvital)\
**Replies:** 34\
**Last updated:** [May 9, 2024, 12:07pm UTC](https://discourse.julialang.org/t/acceleration-of-intel-mkl-on-amd-ryzen-cpus/31287 "2024-05-09T12:07:11Z")

</div>

Some of us use Intel MKL with Julia for improved performance. Intel MKL is composed of few code paths for different features of the CPU (SSE2, SSE4, AVX2, AVX512, etc…). One of the issues of MKL is it discriminate non …

---

## [MKL package wrong results](https://discourse.julialang.org/t/mkl-package-wrong-results/110405)

<div class="topic-metadata">

**Author:** [@Enlil50](https://discourse.julialang.org/u/Enlil50)\
**Replies:** 6\
**Last updated:** [February 19, 2024, 10:26pm UTC](https://discourse.julialang.org/t/mkl-package-wrong-results/110405 "2024-02-19T22:26:22Z")

</div>

I have this program. I post it as it is. If I write: using MKL using MKLSparse It gives me (that’s an iteration of results with a matrix parameter on the first column): 02 | -0.37499999999999944 | 0.0 | -0.1874999999…

---

## [Fastest matrix multiplication](https://discourse.julialang.org/t/fastest-matrix-multiplication/110368)

<div class="topic-metadata">

**Author:** [@eveningsilverfox](https://discourse.julialang.org/u/eveningsilverfox)\
**Replies:** 20\
**Last updated:** [February 19, 2024, 2:51pm UTC](https://discourse.julialang.org/t/fastest-matrix-multiplication/110368 "2024-02-19T14:51:24Z")

</div>

The rate determining step in my code is intermediate-sized matrix multiplications, which I have to do many many (around 10⁸) times. using LinearAlgebra using MKL using BenchmarkTools aa = rand(ComplexF64, 164,164); bb …

---

## [From MKL back to OpenBLAS](https://discourse.julialang.org/t/from-mkl-back-to-openblas/37722)

<div class="topic-metadata">

**Author:** [@martincornejo](https://discourse.julialang.org/u/martincornejo)\
**Replies:** 15\
**Last updated:** [January 17, 2024, 2:04am UTC](https://discourse.julialang.org/t/from-mkl-back-to-openblas/37722 "2024-01-17T02:04:06Z")

</div>

After building MKL on Julia. julia\>\]add https://github.com/JuliaComputing/MKL.jl julia\>\] build MKL Is there a way to set OpenBLAS back?

---

## [How to mitigate bad performance of eigvals from LinearAlgebra](https://discourse.julialang.org/t/how-to-mitigate-bad-performance-of-eigvals-from-linearalgebra/108210)

<div class="topic-metadata">

**Author:** [@Paradox](https://discourse.julialang.org/u/Paradox)\
**Replies:** 3\
**Last updated:** [January 1, 2024, 1:11am UTC](https://discourse.julialang.org/t/how-to-mitigate-bad-performance-of-eigvals-from-linearalgebra/108210 "2024-01-01T01:11:41Z")

</div>

Dear all, I am trying to rewrite my Matlab code that calculates certain band structure to Julia. Unfortunately, I am unable to get close to the performance of Matlab code for some reason that I don’t understand. I will …

---

## [Question About MKL on Slurm Cluster](https://discourse.julialang.org/t/question-about-mkl-on-slurm-cluster/105527)

<div class="topic-metadata">

**Author:** [@TI36XPro](https://discourse.julialang.org/u/TI36XPro)\
**Replies:** 1\
**Last updated:** [October 29, 2023, 5:06am UTC](https://discourse.julialang.org/t/question-about-mkl-on-slurm-cluster/105527 "2023-10-29T05:06:03Z")

</div>

Hello, I am using Julia on an HPC that uses Lmod and Slurm. I wanted to try using MKL for some calculations since I have access to nodes with intel CPUs. I followed the instructions here. At the top of my script the fi…

---

## [Weird matrix multiplication results from MKL](https://discourse.julialang.org/t/weird-matrix-multiplication-results-from-mkl/104623)

<div class="topic-metadata">

**Author:** [@jacques1](https://discourse.julialang.org/u/jacques1)\
**Replies:** 2\
**Last updated:** [October 5, 2023, 6:32pm UTC](https://discourse.julialang.org/t/weird-matrix-multiplication-results-from-mkl/104623 "2023-10-05T18:32:29Z")

</div>

Hi, I’m trying to use a simple OLS solution to an overdetermined linear system using MKL and LinearAlgebra, with coefficient matrix ‘’’ M = \[200000 0 0 (2e5)^2 0; 0 0 0 0 0; 0 0 0 0 0; 0 0 0 0 0; 0 2e5 0 0 (2e5)^2; 0 0…

---

## [Error with MKL artifact when running app built through PackageCompiler.jl](https://discourse.julialang.org/t/error-with-mkl-artifact-when-running-app-built-through-packagecompiler-jl/98847)

<div class="topic-metadata">

**Author:** [@heyx3](https://discourse.julialang.org/u/heyx3)\
**Replies:** 1\
**Last updated:** [May 14, 2023, 9:42pm UTC](https://discourse.julialang.org/t/error-with-mkl-artifact-when-running-app-built-through-packagecompiler-jl/98847 "2023-05-14T21:42:33Z")

</div>

I’m experimenting with building my Julia application into an executable using PackageCompiler.jl. The build process seems to go just fine, but when I run the executable, it tries twice to “download artifact: MKL”, appear…

---

## [MKL Distributed slower！](https://discourse.julialang.org/t/mkl-distributed-slower/97561)

<div class="topic-metadata">

**Author:** [@13299118606](https://discourse.julialang.org/u/13299118606)\
**Replies:** 2\
**Last updated:** [April 17, 2023, 10:21am UTC](https://discourse.julialang.org/t/mkl-distributed-slower/97561 "2023-04-17T10:21:06Z")

</div>

I am using MKL to accelerate svd, using MKL svd will be 5-10 times faster But it is far from enough in parallel: Add the original svd 1.3s using mkl will change to 0.15s Then parallel each time 0.6s If I declare i…

---

## [Multithreaded LAPACK function in a Threads.@threads loop](https://discourse.julialang.org/t/multithreaded-lapack-function-in-a-threads-threads-loop/45205)

<div class="topic-metadata">

**Author:** [@migarstka](https://discourse.julialang.org/u/migarstka)\
**Replies:** 2\
**Last updated:** [September 24, 2022, 6:42am UTC](https://discourse.julialang.org/t/multithreaded-lapack-function-in-a-threads-threads-loop/45205 "2022-09-24T06:42:31Z")

</div>

Hi everyone, Problem I am trying to understand how to optimally set the number of BLAS threads when I am using a multithreaded LAPACK function in a Threads.@threads loop. More specifically I want to compute the eigende…

---

## [How to load ScaLAPACK library from Intel MKL (library inter-dependencies)?](https://discourse.julialang.org/t/how-to-load-scalapack-library-from-intel-mkl-library-inter-dependencies/81239)

<div class="topic-metadata">

**Author:** [@Sideboard](https://discourse.julialang.org/u/Sideboard)\
**Replies:** 4\
**Last updated:** [August 22, 2022, 8:23am UTC](https://discourse.julialang.org/t/how-to-load-scalapack-library-from-intel-mkl-library-inter-dependencies/81239 "2022-08-22T08:23:42Z")

</div>

Hi, I am trying to use ScaLAPACK with @ccall to solve a linear system with QR decomposition. On my laptop it works fine with OpenMPI and directly searching for the default ScaLAPACK library: const libscalapack = Base.L…

---

## [FFTW MKL sub dimensional FFT create plan failed](https://discourse.julialang.org/t/fftw-mkl-sub-dimensional-fft-create-plan-failed/81086)

<div class="topic-metadata">

**Author:** [@Lightup1](https://discourse.julialang.org/u/Lightup1)\
**Replies:** 3\
**Last updated:** [June 25, 2022, 7:23am UTC](https://discourse.julialang.org/t/fftw-mkl-sub-dimensional-fft-create-plan-failed/81086 "2022-06-25T07:23:31Z")

</div>

MKL provider failed for plan sub dimension FFT. test=Array{ComplexF64}(undef, \[\[4,4\];\[4,4\]\]...); p1=plan\_fft(test,\[3,4\]) result1=fft(reshape(\[1:4^4;\],4,4,4,4)) result2=p1\*reshape(\[1:4^4;\],4,4,4,4) result1==result2 #fals…

---

## [Issue when calling the ?gemm\_batch function from MKL](https://discourse.julialang.org/t/issue-when-calling-the-gemm-batch-function-from-mkl/83232)

<div class="topic-metadata">

**Author:** [@EduMolinero](https://discourse.julialang.org/u/EduMolinero)\
**Replies:** 0\
**Last updated:** [June 23, 2022, 11:03am UTC](https://discourse.julialang.org/t/issue-when-calling-the-gemm-batch-function-from-mkl/83232 "2022-06-23T11:03:57Z")

</div>

Hi! I’m trying to implement the ?gemm\_batch functions from the Intel MKL library into Julia. These functions performs matrix-matrix operations with groups of matrices, processing a number of groups at once. Just for te…

---

## [Why does setting JULIA\_EXLCUSIVE=1 make MKL run single-threaded?](https://discourse.julialang.org/t/why-does-setting-julia-exlcusive-1-make-mkl-run-single-threaded/79766)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 0\
**Last updated:** [April 21, 2022, 7:22am UTC](https://discourse.julialang.org/t/why-does-setting-julia-exlcusive-1-make-mkl-run-single-threaded/79766 "2022-04-21T07:22:49Z")

</div>

I am working on a cluster with 28 cores allocated to me. I start Julia using MKL\_DYNAMIC="FALSE" JULIA\_EXCLUSIVE=1 julia although I’m uncertain if this is the right approach. Eventually, I aim to run multiple julia th…

---

## [DifferentialEquations.jl precompilation fails for not finding libopenblas](https://discourse.julialang.org/t/differentialequations-jl-precompilation-fails-for-not-finding-libopenblas/70229)

<div class="topic-metadata">

**Author:** [@dasayan05](https://discourse.julialang.org/u/dasayan05)\
**Replies:** 7\
**Last updated:** [March 18, 2022, 9:09am UTC](https://discourse.julialang.org/t/differentialequations-jl-precompilation-fails-for-not-finding-libopenblas/70229 "2022-03-18T09:09:39Z")

</div>

I am using Julia 1.6.3 on Ubuntu 20.04 built from source with MKL turned on, so BLAS.vendor() says MKL. Now, I was trying to install the DifferentialEquations package simply by \] add DifferentialEquations, which after pr…

---

## [MKL slower than openblas in intel cpu](https://discourse.julialang.org/t/mkl-slower-than-openblas-in-intel-cpu/77169)

<div class="topic-metadata">

**Author:** [@Jae-Mo\_Lihm](https://discourse.julialang.org/u/Jae-Mo_Lihm)\
**Replies:** 7\
**Last updated:** [March 2, 2022, 3:48pm UTC](https://discourse.julialang.org/t/mkl-slower-than-openblas-in-intel-cpu/77169 "2022-03-02T15:48:01Z")

</div>

I found MKL is ~1.5 times slower than openblas for matrix-matrix multiplication (both without multithreading). Since I’m using intel CPU, I expected MKL to be faster. Is there anything obviously wrong in this benchmark?…

---

## [Problem when loading Intel MKL shared library to use with C written shared library](https://discourse.julialang.org/t/problem-when-loading-intel-mkl-shared-library-to-use-with-c-written-shared-library/69323)

<div class="topic-metadata">

**Author:** [@Roman\_Istomin](https://discourse.julialang.org/u/Roman_Istomin)\
**Replies:** 9\
**Last updated:** [October 12, 2021, 3:13pm UTC](https://discourse.julialang.org/t/problem-when-loading-intel-mkl-shared-library-to-use-with-c-written-shared-library/69323 "2021-10-12T15:13:36Z")

</div>

Hi, I have written an optimized C library to do some matrix algebra basically, speeding up some einsum operations. I can compile and use the library from C and C++, it links to Intel MKL and is able to run normally. Thi…

---

## [Julia server keeps crashing in vscode after I added MKL.jl](https://discourse.julialang.org/t/julia-server-keeps-crashing-in-vscode-after-i-added-mkl-jl/68259)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 2\
**Last updated:** [September 16, 2021, 12:52pm UTC](https://discourse.julialang.org/t/julia-server-keeps-crashing-in-vscode-after-i-added-mkl-jl/68259 "2021-09-16T12:52:01Z")

</div>

I keep receiving this error: fatal: error thrown and no exception handler available. InitError(mod=:IntelOpenMP\_jll, error=ErrorException("Artifact "IntelOpenMP" was not installed correctly. Try \`using Pkg; Pkg.instanti…

---

## [Correct way of using MKL.jl on Julia Version 1.7.0](https://discourse.julialang.org/t/correct-way-of-using-mkl-jl-on-julia-version-1-7-0/67780)

<div class="topic-metadata">

**Author:** [@j\_u](https://discourse.julialang.org/u/j_u)\
**Replies:** 4\
**Last updated:** [September 8, 2021, 10:26pm UTC](https://discourse.julialang.org/t/correct-way-of-using-mkl-jl-on-julia-version-1-7-0/67780 "2021-09-08T22:26:53Z")

</div>

What is the correct way of using MKL.jl on Julia Version 1.7.0-beta3.0 (2021-07-07) wrt the number of distributed processes and multithreading? I do reinforcement learning (AlphaZero.jl) training on Intel(R) Xeon(R) Gol…

---

## [ANN: MKLSparse](https://discourse.julialang.org/t/ann-mklsparse/3384)

<div class="topic-metadata">

**Author:** [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Replies:** 8\
**Last updated:** [September 4, 2021, 2:16pm UTC](https://discourse.julialang.org/t/ann-mklsparse/3384 "2021-09-04T14:16:21Z")

</div>

Hello everyone, I recently updated the MKLSparse.jl package for 0.5 and 0.6. The most useful feature of MKLSparse is likely the ability to seamlessly accelerate sparse matrix vector multiplications (which are the main …

---

## [MKLSparse: how to control thread affinity and the number of threads?](https://discourse.julialang.org/t/mklsparse-how-to-control-thread-affinity-and-the-number-of-threads/65601)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 0\
**Last updated:** [July 31, 2021, 2:14pm UTC](https://discourse.julialang.org/t/mklsparse-how-to-control-thread-affinity-and-the-number-of-threads/65601 "2021-07-31T14:14:17Z")

</div>

As far as I understand, currently the go-to way if you need multithreaded Sparse Matrix operations is to interface with MKL using MKLSparse.jl. Now, imagine I have a machine with several NUMA nodes and want to run multi…

[Next page](https://discourse.julialang.org/tag/mkl/105.md?match_all_tags=true&page=1&tags%5B%5D=mkl)
