Repository navigation
Description
Describe the bug
C++ tests and examples hang when executed on Windows using MinGW.
To Reproduce
There's a build (which includes tests and examples) of the recent main branch available for download from https://buildkite.com/julialang/yggdrasil/builds/15678#0193d95c-e190-48eb-b664-f0e384591eb5:
- Direct download: M/MLX/products/MLX.v0.21.2.x86_64-w64-mingw32-cxx11.tar.gz
Other builds (without examples and tests) are available from https://github.com/JuliaBinaryWrappers/MLX_jll.jl/releases
Dependencies:
- With https://julialang-s3.julialang.org/bin/winnt/x64/1.11/julia-1.11.2-win64.zip one gets
libblastrampoline, andlibopenblasetc.
tutorial.exe, distributed.exe etc. hangs, and other executables segfault:
~/Downloads/mlx/julia-1.11.2/bin$ ls -la ../../bin/
total 16724
drwx------+ 1 Administrator None 0 Dec 18 19:25 .
drwxr-xr-x+ 1 Administrator None 0 Dec 18 19:20 ..
-rwx------+ 1 Administrator None 134288 Jan 1 1970 distributed.exe
-rwx------+ 1 Administrator None 13080004 Jan 1 1970 libmlx.dll
-rwx------+ 1 Administrator None 177271 Jan 1 1970 linear_regression.exe
-rwx------+ 1 Administrator None 177768 Jan 1 1970 logistic_regression.exe
-rwx------+ 1 Administrator None 133560 Jan 1 1970 metal_capture.exe
-rwx------+ 1 Administrator None 3219625 Jan 1 1970 tests.exe
-rwx------+ 1 Administrator None 180219 Jan 1 1970 tutorial.exe
~/Downloads/mlx/julia-1.11.2/bin $ ../../bin/tests.exe
[doctest] doctest version is "2.4.11"
[doctest] run with "--help" for options
Segmentation fault
~/Downloads/mlx/julia-1.11.2/bin $ ../../bin/tutorial.exe
array([[1, 1],
[1, 1]], dtype=float32)
# HANG
~/Downloads/mlx/julia-1.11.2/bin $ ../../bin/linear_regression.exe
Segmentation fault
~/Downloads/mlx/julia-1.11.2/bin $ ../../bin/logistic_regression.exe
Segmentation fault
~/Downloads/mlx/julia-1.11.2/bin $ ../../bin/metal_capture.exe
terminate called after throwing an instance of 'std::invalid_argument'
what(): [new_stream] Cannot make gpu stream without gpu backend.
# HANG
~/Downloads/mlx/julia-1.11.2/bin $ ../../bin/distributed.exe
No communication backend found
# HANG
Expected behavior
Tests to pass, examples to terminate.
Desktop (please complete the following information):
- OS Version: Windows 2019
- Version git main @ 070bd43
Additional context
N/A
Activity
awni commentedon Dec 18, 2024
If you're able to figure out where it's hanging or segfaulting.. we might be able to point you in the right direction for debugging / fixing.
stemann commentedon Feb 1, 2025
The segfaults was due to user error - the MLX libraries built for Julia (except for the macOS ones) are linked to libblastrampoline rather than OpenBLAS; libblastrampoline must be initialised properly, e.g. by setting the env. var.
LBT_DEFAULT_LIBSto the path tolibopenblas, e.g.,LBT_DEFAULT_LIBS=libopenblas.dll, cf. https://github.com/JuliaLinearAlgebra/libblastrampoline/tree/v5.4.0?tab=readme-ov-file#basic-usageE.g. using libopenblas from the MinGW set-up in #1806
The MLX v0.21 binaries for Julia on Windows continue to hang though...
The issue with running gcc on the MinGW system (
Invalid argument collect2.exe: error: ld returned 1 exit status) is remedied by the jit_compiler build_command fix in #1806.stemann commentedon Feb 1, 2025
Closing this as the hangs does not seem to be an MLX-proper issue, but rather an issue with the binaries built for Julia on Windows.