Only 1 BLAS thread in 1.9-beta2

When I start up Julia 1.9-beta2 on my 8-core Windows machine, BLAS.get_num_threads() returns 1 (whether or not I start with the -t8 option. Is this intended behavior or a bug?

PS D:\peter\Documents> julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.9.0-beta2 (2022-12-29)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using LinearAlgebra

julia> BLAS.get_num_threads()
1

julia> versioninfo()
Julia Version 1.9.0-beta2
Commit 7daffeecb8 (2022-12-29 07:45 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
  Threads: 1 on 8 virtual cores
Environment:
  JULIA_EDITOR = runemacs.exe
1 Like

This will be fixed in 1.9-beta3: Bad default number of BLAS threads on 1.9? · Issue #48062 · JuliaLang/julia · GitHub

4 Likes

While you wait, put this in your startup.jl file.

BLAS.set_num_threads(8)
1 Like