openebs / mayastor

Dynamically provision Stateful Persistent Replicated Cluster-wide Fabric Volumes & Filesystems for Kubernetes that is provisioned from an optimized NVME SPDK backend data storage stack.
Apache License 2.0
755 stars 109 forks source link

Be more explicit when we are running a CPUs older then 10 years #21

Closed gila closed 4 years ago

gila commented 5 years ago

Describe the bug Due to the instructions needed by DPDK, we only support icore7 and upwards. When we receive SIGILL kubectl logs is silent about it (as we crash hard) During startup, it would be nice if we were to detect this and crash more friendly in away.

To Reproduce start mayastor on non supported CPU

Expected behavior Nice log message describing the problem right now we need to look at exit code from k8s

jonathan-teh commented 4 years ago

I don't get a SIGILL, tested in KVM with CPU model Penryn (one generation before Nehalem which introduced SSE 4.2):

[nix-shell:~/work/Mayastor]$ target/release/mayastor
[2020-01-23T17:02:40.319929931Z INFO main.rs:40] Starting Mayastor version ffb30c1
[2020-01-23T17:02:40.319967740Z INFO main.rs:41] free_pages: 512 nr_pages: 512
[2020-01-23T17:02:40.319985398Z INFO env.rs:394] EAL arguments ["mayastor", "-c 0x1", "--no-shconf", "-m 0", "--base-virtaddr=0x200000000000", "--file-prefix=mayastor_pid8448", "--log-level=lib.eal:4", "--log-level=lib.cryptodev:0", "--log-level=user1:6", "--match-allocations"]
ERROR: This system does not support "SSE4_2".
Please check that RTE_MACHINE is set correctly.
EAL: FATAL: unsupported cpu type.
EAL: unsupported cpu type.
thread 'main' panicked at 'Failed to init EAL', mayastor/src/environment/env.rs:403:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
gila commented 4 years ago

Hi, @jonathan-teh Are you sure about it being added before that? According to this https://en.wikipedia.org/wiki/SSE4#SSE4.2 the first CPU to get this was Nehalem?

Can you check if your CPU actually has this flag? cat /proc/cpuinfo | grep sse4.2 should give us some insight, if it does, then the arguments to KVM might not be correct?

jonathan-teh commented 4 years ago

What I meant was Nehalem introduced SSE 4.2 and I set KVM (or rather libvirt via virt-manager) to the CPU generation before that, which is Penryn. I simply get the error shown earlier and an exit code of 101, instead of a SIGILL. The host CPU does have SSE 4.2 and if I set it to "copy host CPU configuration", mayastor does indeed start normally.

proegssilb commented 4 years ago

I've got a CPU without SSE 4.2, if that's the instruction set DPDK needs (couldn't find the docs). It's running Proxmox, but that shouldn't be an issue. Let me see what I can recreate on that machine.

gila commented 4 years ago

@proegssilb we have updated our docs and wanted to check if there anything left for this issue based on your findings.

proegssilb commented 4 years ago

I've yet to succeed in getting the code running as described. Go ahead and close this out if it's not a huge concern.