Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ssse3 instruction check #1083

Merged
merged 1 commit into from Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions clab/config.go
Expand Up @@ -415,9 +415,9 @@ func (c *CLab) verifyBridgesExist() error {

func (c *CLab) checkHostRequirements() error {
for _, n := range c.Nodes {
// sse3 instruction set check
if n.Config().HostRequirements.SSE3 && !cpuid.CPU.SSE3() {
return fmt.Errorf("SSE3 CPU instruction set is required by kind '%s' but not available. If containerlab runs in a VM, check if that VM has been launched with full host-cpu support", n.Config().Kind)
// ssse3 instruction set check
if n.Config().HostRequirements.SSSE3 && !cpuid.CPU.SSSE3() {
return fmt.Errorf("SSSE3 CPU instruction set is required by kind '%s' but not available on the host. If containerlab runs in a VM, check if that VM has been launched with full host-cpu support (see https://containerlab.dev/manual/kinds/srl/#ssse3-cpu-set for details)", n.Config().Kind)
}
}

Expand Down
14 changes: 14 additions & 0 deletions docs/manual/kinds/srl.md
Expand Up @@ -314,5 +314,19 @@ Additionally, containerlab will mount the `authorized_keys` file that will have

This will enable passwordless access for the users above if any public key is found in the user's directory.

## Host Requirements

SR Linux is a containerized NOS, therefore it depends on the host's kernel and CPU. It is recommended to run a kernel v4 and newer, though it might also run on the older kernels.

### SSSE3 CPU set

SR Linux XDP - the emulated datapath based on DPDK - requires SSS3E instructions to be available. This instruction set is present on most modern CPUs, but it is missing in the basic emulated CPUs created by hypervisors like QEMU, Proxmox. When this instruction set is not present in the host CPU set, containerlab will abort the lab deployment if it has SR Linux nodes defined.

The easiest way to enable SSSE3 instruction set is to configure the hypervisor to use the `host` CPU type, which exposes all available instructions to the guest. For Proxmox, this can be set in the GUI:

![proxmox](https://gitlab.com/rdodin/pics/-/wikis/uploads/c01dad79d8ab51fba77423f841d40378/image.png){: .img-shadow}

Or it's also possible via the proxmox configuration file `/etc/pve/qemu-server/vmid.conf`.

[^1]: The `authorized_keys` file will be created with the content of all found public keys. This file will be bind-mounted using the respecting paths inside SR Linux to enable password-less access.
[^2]: If running with `sudo`, add `-E` flag to sudo to preserve user' home directory for this feature to work as expected.
5 changes: 5 additions & 0 deletions docs/stylesheets/extra.css
Expand Up @@ -103,4 +103,9 @@
left: 0;
width: 100%;
height: 100%;
}

/* shadow effect for images and divs for video */
.img-shadow {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
4 changes: 2 additions & 2 deletions nodes/srl/srl.go
Expand Up @@ -172,8 +172,8 @@ func (s *srl) Init(cfg *types.NodeConfig, opts ...nodes.NodeOption) error {
topoPath := filepath.Join(s.cfg.LabDir, "topology.yml")
s.cfg.Binds = append(s.cfg.Binds, fmt.Sprint(topoPath, ":/tmp/topology.yml:ro"))

// SSE3 cpu instruction set is required
s.cfg.HostRequirements.SSE3 = true
// SSSE3 cpu instruction set is required
s.cfg.HostRequirements.SSSE3 = true
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion types/types.go
Expand Up @@ -147,7 +147,7 @@ type NodeConfig struct {
}

type HostRequirements struct {
SSE3 bool `json:"sse3,omitempty"` // sse3 cpu instruction
SSSE3 bool `json:"sse3,omitempty"` // ssse3 cpu instruction
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

json attribute left as 'sse3' - on purpose?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope. needs to be fixed

VirtRequired bool `json:"virt-required,omitempty"` // indicates that KVM virtualization is required for this node to run
}

Expand Down