Skip to main content

Set Up NFS

Use NFS when you need the DevKit to access large datasets or model files stored on an Ubuntu host.

NFS (Network File System) shares files between an Ubuntu host (server) and the Modalix DevKit (client). The DevKit can access host storage without local copies.

note

NFS is useful when the DevKit lacks high-speed, large-capacity storage such as NVMe. This applies to platforms like the MLSoC and the Modalix Early Access Kit (EA), where SD-card-only storage can slow load times.

Use NFS when:

  • Large models or datasets need to be shared across multiple devices.
  • Local storage on the client is limited or unavailable.
  • You prefer centralized storage management for updates.
Step 1. Set Up the NFS Server
  1. Install the NFS kernel server:

    sima-user@sima-user-machine:~$ sudo apt update
    sima-user@sima-user-machine:~$ sudo apt install -y nfs-kernel-server
  2. Create a shared directory:

    Choose a directory to share with the Modalix DevKit:

    sima-user@sima-user-machine:~$ sudo mkdir -p /mnt/nfs_share
    sima-user@sima-user-machine:~$ sudo chmod 777 /mnt/nfs_share
  3. Edit the NFS exports file:

    Open the exports file:

    sima-user@sima-user-machine:~$ sudo nano /etc/exports

    Add the following line at the end, replacing <modalix_ip> with the Modalix DevKit's IP address:

    /mnt/nfs_share <modalix_ip>(rw,sync,no_subtree_check)

    If you want to allow access from any IP in your network (for testing), use:

    /mnt/nfs_share *(rw,sync,no_subtree_check)
  4. Apply the changes and restart the NFS service:

    sima-user@sima-user-machine:~$ sudo exportfs -a
    sima-user@sima-user-machine:~$ sudo systemctl restart nfs-kernel-server
Step 2. Set Up the NFS Client
  1. Create a mount point:

    modalix:~$ sudo mkdir -p /mnt/
  2. Mount the NFS share:

    Replace <server_ip> with the Ubuntu host machine's IP address:

    modalix:~$ sudo mount <server_ip>:/mnt/nfs_share /mnt/
  3. Verify the mount:

    Check if the NFS share is mounted correctly:

    modalix:~$ df -h | grep mnt
Step 3. Making the Mount Persistent

To mount the NFS share automatically at boot, run these steps on Modalix:

  1. Create the mnt.mount file:

    modalix:~$ sudo vi /etc/systemd/system/mnt.mount
  2. Add this content to the file, replacing server_IP with the Ubuntu host IP address:

    [Unit]
    Description=NFS Mount
    After=network-online.target
    Requires=network-online.target

    [Mount]
    What=<server_IP>:/mnt/nfs_share
    Where=/mnt/
    Type=nfs
    Options=defaults,_netdev

    [Install]
    WantedBy=multi-user.target
  3. Save and exit, then test the configuration:

    modalix:~$ sudo systemctl daemon-reload
    modalix:~$ sudo systemctl enable mnt.mount
    modalix:~$ sudo systemctl start mnt.mount