Setup NFS
When working with large datasets or model files, fast and efficient file access is essential for a smooth demo and development experience.
Using NFS (Network File System) enables seamless file sharing between an Ubuntu machine (server) and the Modalix DevKit (client), providing direct access to large storage without requiring local copies.
Note
NFS is particularly 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 relying solely on SD cards can lead to slower load times.
NFS can be especially helpful when:
Large models or datasets need to be shared across multiple devices.
Local storage on the client is limited or unavailable.
Centralized storage management is preferred for simplified updates.
Step 1. Setting Up the NFS Server
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
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
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)
Apply the Changes and Restart NFS Service:
sima-user@sima-user-machine:~$ sudo exportfs -a sima-user@sima-user-machine:~$ sudo systemctl restart nfs-kernel-server
Step 2. Setting Up the NFS Client
Create a Mount Point:
modalix:~$ sudo mkdir -p /mnt/
Mount the NFS Share:
Replace <server_ip> with the Ubuntu machine’s IP address:
modalix:~$ sudo mount <server_ip>:/mnt/nfs_share /mnt/
Verify the Mount:
Check if the NFS share is mounted correctly:
modalix:~$ df -h | grep mnt
Step 3. Making the Mount Persistent
To automatically mount the NFS share at boot, perform the following steps on Modalix:
Create the ``mnt.mount`` file:
modalix:~$ sudo vi /etc/systemd/system/mnt.mount
Add this content to the file, be sure to replace the server_IP to the Ubuntu machine:
[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
Save and exit. Then, test the configuration:
modalix:~$ sudo systemctl daemon-reload modalix:~$ sudo systemctl enable mnt.mount modalix:~$ sudo systemctl start mnt.mount