dragonflydb / dragonfly

A modern replacement for Redis and Memcached
https://www.dragonflydb.io/
Other
24.76k stars 892 forks source link

Startup errors with return code 132 #296

Closed Sulunia closed 1 year ago

Sulunia commented 1 year ago

Describe the bug Using docker, I am unable to run dragonfly at all. Platform seemingly fits all requirements, which makes it quite mysterious... :thinking:

To Reproduce I'm currently trying to run it with docker run --network=host --ulimit memlock=-1 docker.dragonflydb.io/dragonflydb/dragonfly --vmodule=main_service=2 --logbuflevel=-1 There is no output, besides a return code 132

Screenshots image

Environment (please complete the following information):

Reproducible Code Snippet

docker run --network=host --ulimit memlock=-1 docker.dragonflydb.io/dragonflydb/dragonfly --vmodule=main_service=2 --logbuflevel=-1

Additional context It's an embedded equipment, running a common x86 platform.

ryanrussell commented 1 year ago

@Sulunia

I just tried your command on a Ubuntu 20.04 and it works fine. When I google error 132, I see stuff about cpu instruction sets.

Can you try this?

sudo cat /proc/cpuinfo | grep avx

Ref: Exit Code 132 on SO

I suspect you have an older cpu model on this box?

romange commented 1 year ago

@ryanrussell is right. Also, try running docker run --network=host --ulimit memlock=-1 docker.dragonflydb.io/dragonflydb/dragonfly --logtostderr does it show anything?

Sulunia commented 1 year ago

@Sulunia I suspect you have an older cpu model on this box?

Oooh, that's a nice catch. Apparently, this CPU lacks AVX instruction set. image

@romange There is no output, even with the command line provided. I suppose it's a "hard error" not having the required instruction set.

Is it possible to keep on using a dockerized dragonfly in this case?

romange commented 1 year ago

I do not think you can use even non-dockerized version of dragonfly on a hardware it does not support. Why do you want to run dragonfly on embedded hardware?

Sulunia commented 1 year ago

Fortunately, there is no specific or special reason to use dragonfly in this case, besides "I like the project and it's great" :smile:

However, I'd recommend mentioning the required AVX support in order for dragonfly to work. Thanks for the help on cracking this case :sunglasses:

romange commented 1 year ago

@Sulunia Pedro, if you like the project, it is possible to still use it with weaker cpus, it just requires recompiling the code for older CPUs :) if you share here your cpuinfo spec, I will open an issue.

Sulunia commented 1 year ago

Oh, that's great! I thought AVX support was a must have set in stone.

Here's the cpuinfo spec:

CPU info
mouseion@mouseion-srv:~$ cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 92
model name      : Intel(R) Atom(TM) Processor E3930 @ 1.30GHz
stepping        : 10
microcode       : 0x28
cpu MHz         : 800.000
cache size      : 1024 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 21
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch cpuid_fault cat_l2 ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust smep erms mpx rdt_a rdseed smap clflushopt intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts md_clear arch_capabilities
vmx flags       : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid unrestricted_guest vapic_reg vid ple shadow_vmcs
bugs            : monitor spectre_v1 spectre_v2 spec_store_bypass
bogomips        : 2572.80
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 92
model name      : Intel(R) Atom(TM) Processor E3930 @ 1.30GHz
stepping        : 10
microcode       : 0x28
cpu MHz         : 1187.429
cache size      : 1024 KB
physical id     : 0
siblings        : 2
core id         : 2
cpu cores       : 2
apicid          : 4
initial apicid  : 4
fpu             : yes
fpu_exception   : yes
cpuid level     : 21
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch cpuid_fault cat_l2 ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust smep erms mpx rdt_a rdseed smap clflushopt intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts md_clear arch_capabilities
vmx flags       : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid unrestricted_guest vapic_reg vid ple shadow_vmcs
bugs            : monitor spectre_v1 spectre_v2 spec_store_bypass
bogomips        : 2572.80
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:
perfectra1n commented 1 month ago

If you're on Proxmox, be sure to set your CPU to host since you're most likely using a newer CPU than Proxmox thinks you are :)

image