-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Description
Hi,
since a few days we are struggling with an "illegal instruction error" we don't understand in the DFTK.jl package. Here are the details of what happens:
- output of
versioninfo()
Julia Version 1.8.0
Commit 5544a0fab7 (2022-08-17 13:38 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: 8 × Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
Threads: 1 on 8 virtual cores
- minimal working example
using Brillouin
using Bravais
using DFTK
using Unitful
using UnitfulAtomic
using StaticArrays
a = 10.26 # Silicon lattice constant in Bohr
lattice = a / 2 * [[0 1 1.];
[1 0 1.];
[1 1 0.]]
Si = ElementPsp(:Si, psp=load_psp("hgh/lda/Si-q4"))
atoms = [Si, Si]
positions = [ones(3)/8, -ones(3)/8]
model = model_LDA(lattice, atoms, positions)
kcoords, klabels, kpath = DFTK.high_symmetry_kpath(model; kline_density=40u"bohr") # this line causes the illegal instruction
- stacktrace of the error
Unreachable reached at 0x7f53e7225b24
signal (4): Illegal instruction
in expression starting at REPL[13]:1
#high_symmetry_kpath#701 at /home/kemling/.julia/packages/DFTK/iIhO4/src/postprocess/band_structure.jl:48
high_symmetry_kpath##kw at /home/kemling/.julia/packages/DFTK/iIhO4/src/postprocess/band_structure.jl:16
unknown function (ip: 0x7f53e722617a)
unknown function (ip: 0x7f54797cb1cc)
unknown function (ip: 0x7f54797caa87)
unknown function (ip: 0x7f54797cb8fb)
unknown function (ip: 0x7f54797cc76e)
unknown function (ip: 0x7f54797eae63)
unknown function (ip: 0x7f54797eb976)
unknown function (ip: 0x7f54797eb976)
ijl_toplevel_eval_in at /usr/bin/../lib/julia/libjulia-internal.so.1 (unknown line)
unknown function (ip: 0x7f546035ff44)
unknown function (ip: 0x7f54603604b4)
unknown function (ip: 0x7f54603606fc)
unknown function (ip: 0x7f54603947e9)
unknown function (ip: 0x7f5460394dc3)
unknown function (ip: 0x7f5460394ddf)
unknown function (ip: 0x7f5460a8b6a9)
unknown function (ip: 0x7f5460a8b74b)
jl_f__call_latest at /usr/bin/../lib/julia/libjulia-internal.so.1 (unknown line)
unknown function (ip: 0x7f5460ae1586)
unknown function (ip: 0x7f5460aeb7d7)
unknown function (ip: 0x7f5460aec478)
unknown function (ip: 0x7f5460aec5a8)
unknown function (ip: 0x7f54798156ef)
jl_repl_entrypoint at /usr/bin/../lib/julia/libjulia-internal.so.1 (unknown line)
main at julia (unknown line)
unknown function (ip: 0x7f5479d802cf)
__libc_start_main at /usr/bin/../lib/libc.so.6 (unknown line)
_start at julia (unknown line)
Allocations: 68617344 (Pool: 68588115; Big: 29229); GC: 54
[1] 572598 illegal hardware instruction (core dumped) julia
-
the bug happens in this
high_symmetry_kpathfunction from DFTK. What I don't understand is that if I copy-paste inline exactly the content of this function (see this gist for the code to run), everything works fine. -
the stacktrace let us think in a first time that this came from Brillouin.jl but this was discussed with the devs : Illegal instruction error thchr/Brillouin.jl#21 and we ended up with the conclusion that it was rather a Julia bug.
-
the same behavior is observed with the nightly version of julia, whose
versioninfo()output is
Julia Version 1.9.0-DEV.1428
Commit 15f8fadb5b6 (2022-09-22 11:10 UTC)
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 8 × Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
Threads: 1 on 8 virtual cores
Any insight on the origin of such a bug ? Thanks in advance for your help :-)