.. _Setup_PCIe_Mode: PCIe Mode ######### .. tabs:: .. tab:: Prerequisites .. include:: blocks/pcie_only_on_mlsoc.rst .. include:: blocks/install_sima_cli.rst Before you begin: * Make sure the host machine's operating system is Ubuntu version 22.04 LTS or higher. * Configure your host machine’s UEFI/BIOS settings for optimal performance and proper driver functionality. - On Intel-based machines, enable SRIOV, IOMMU, and VT-D. - On AMD-based machines, disable AMD-V and enable IOMMU. .. tab:: Hardware Preparation .. image:: ../media/pcie-dip-switch.png :alt: SiMa.ai MLSoC DevKit PCIe Dipswitch :align: center :width: 40% #. On the DevKit, there are four dip switches as shown above. Make sure switch #1 is in ``OFF`` position. #. Make sure the Run/Program switch is ON. #. Power off the host machine, insert the DevKit into the PCIe slot, and power on the host machine. For a detailed view of the DevKit interfaces, switches and connectors, refer to the :ref:`SiMa.ai DevKit Interface `. .. note:: In rare cases, if you do not need the driver to be automatically loaded when the host machine reboots, create (or edit if already exists) ``/etc/modprobe.d/blacklist.conf`` and add the line blacklist ``sima_mla_drv``. Once done, run ``update-initramfs`` and reboot the host machine. After reboot the drivers can be loaded manually using ``insmod`` or ``modeprobe``. .. tab:: Driver Installation Run the following command on the Linux host to install the driver. .. code-block:: console sima-user@sima-user-machine:~$ sima-cli install hostdriver -v 1.7.0 ... ... ... Component | Status | Details -------------------------------------------------------------------------------------------------------------------- Gstreamer | PASS | ✅ GStreamer plugin 'pciehost' is installed. Kernel Module | PASS | ✅ Kernel module 'sima_mla_drv' is installed. PCIe Device | PASS | ✅ PCIe device (1f06:abcd) detected and bound to 'sima_mla_drv'. ✅ Installation complete. .. note:: Please be advised that your MLSoC DevKit may be operating with outdated firmware out of the box. To ensure optimal performance and compatibility, we recommend updating the DevKit in standalone mode first to the matching firmware version as the host driver. For detailed instructions on updating your MLSoC DevKit in standalone mode, see :ref:`here `. After the system is setup, then you can use ``sima-cli`` to update the DevKit using virtual IP address. .. tab:: Virtual Network .. note:: The Virtual Network feature is available in firmware version ``1.5`` and later. To use this feature, make sure your DevKit is :ref:`updated` to the latest firmware version. When connected to a host system via PCI Express (PCIe), the SiMa.ai DevKit establishes a virtual ethernet interface. This interface enables direct network communication between the host and the DevKit over high-speed PCIe bus. The Virtual Network feature is primarily designed for debugging purposes, allowing users to: - **Secure Shell (SSH)**: Access the DevKit's command-line interface remotely for troubleshooting and system management. - **Secure Copy Protocol (SCP)**: Transfer files between the host and the DevKit securely, facilitating the movement of logs, configurations, and other necessary files during the development and debugging process. This feature also allows users to: - **Update firmware**: Manually update firmware using the ``scp`` and ``ssh`` utilities, when following the File Copy Method. - **Assign static IP Address (Ethernet over PCIe)**: Manually configure static IP address for your host machine/MLSoC device. By default, 10.0.card num.1 address is assigned to the host machine and 10.0.card num.2 is assigned to the MLSoC device. However, for stable and consistent networking, you must disable the default IP address being assigned to the host interface by passing the module parameter ``default_ip=false`` when loading the module. If the module is already loaded remove and then reload it with the ``default_ip=false`` parameter, as shown below. .. code-block:: console sudo modprobe -r sima_mla_drv sudo modprobe sima_mla_drv default_ip=false When loading the module manually, use the command below. This allows you to manually assign a static IP address to the host machine interface and in turn to the MLSoC device. .. code-block:: console sudo insmod sima_mla_drv.ko default_ip=false This also requires the host machine to have ``ifconfig`` utility installed. .. code-block:: console ifconfig 20.1.2.1 Once an IP address is assigned to the host interface, IP + 1 will be assigned to SoC interface automatically. For example, if ``20.1.2.1`` is assigned to the host machine, the MLSoC IP will be ``20.1.2.2``. When the interfaces are created, the host interface will have a MAC address in the format ``cardnum:S:I:m:A:0`` and the SoC interface will have a MAC address of ``cardnum:S:I:m:A:1``. The IP addresses are assigned upon creation as ``host:10.0.cardnum.1`` and ``soc:10.0.cardnum.2``. This also requires the host machine to have ``ifconfig`` utility installed. 1. ``ifconfig`` output on the host machine: .. code-block:: console enp2s0: flags=4163 mtu 65536 inet 10.0.0.1 netmask 255.255.255.0 broadcast 10.0.0.255 inet6 fe80::253:49ff:fe4d:4130 prefixlen 64 scopeid 0x20 ether 00:53:49:4d:41:30 txqueuelen 1000 (Ethernet) RX packets 14107 bytes 4460994 (4.4 MB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 818 bytes 74840 (74.8 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 2. ``ifconfig`` output on the SiMa.ai DevKit: .. code-block:: console eth2: flags=4163 mtu 65536 inet 10.0.0.2 netmask 255.255.255.0 broadcast 10.0.0.255 inet6 fe80::253:49ff:fe4d:4131 prefixlen 64 scopeid 0x20 ether 00:53:49:4d:41:31 txqueuelen 1000 (Ethernet) RX packets 818 bytes 74840 (73.0 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 14109 bytes 4461636 (4.2 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 3. SSH from host to device; use default user name ``sima`` and password ``edgeai`` to connect. .. code-block:: console sima-user@sima-user-machine:~$ ssh sima@10.0.0.2 The authenticity of host '10.0.0.2 (10.0.0.2)' can't be established. ED25519 key fingerprint is SHA256:ulxwiRM+cCQNJ90R5Qn5eV+9hqvkVNo0eWQ9pY3l8E0. This key is not known by any other names Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added '10.0.0.2' (ED25519) to the list of known hosts.. sima@10.0.0.2's password: sima@davinci:~#