USB Device Mode Performance Issues on Jetson Orin Nano Developer Kit
Issue Overview
Users of the Nvidia Jetson Orin Nano Developer Kit are experiencing significantly lower-than-expected USB transfer speeds when the device is in USB Device Mode. Specifically:
- The TypeC interface of the Orin Nano Developer Kit is connected to a USB 3.0 port on a PC.
- File transfer testing using the mass_storage example yields speeds of only 38MB/s.
- Users expected speeds closer to USB 3.0’s theoretical maximum of 5Gbps.
- The issue persists even when using custom device mode drivers based on f_loopback.c.
This performance bottleneck severely limits the device’s capability for high-speed data transfer when operating in device mode, which could impact various applications and use cases.
Possible Causes
-
Hardware limitations: The Jetson Orin Nano’s USB controller might not be fully optimized for USB 3.0 speeds in device mode.
-
Software/driver issues: The current USB device mode implementation may have inefficiencies or bugs limiting performance.
-
Testing methodology flaws: The use of loopback devices and filesystem operations might introduce overhead, masking the true USB transfer speed.
-
Storage medium bottleneck: If using SD cards or slower eMMC storage, the read/write speeds of these media could be limiting overall transfer rates.
-
Configuration issues: Suboptimal USB or system settings might be restricting performance.
-
Buffer and caching effects: System memory usage and caching behaviors could be influencing observed speeds, especially on repeated transfers.
Troubleshooting Steps, Solutions & Fixes
-
Verify USB connection and mode:
- Ensure the USB cable is capable of USB 3.0 speeds.
- Check kernel logs to confirm the device is operating in SuperSpeed mode:
dmesg | grep -i "super.*speed"
-
Optimize testing methodology:
- Avoid using loopback devices for testing. Instead, use direct file transfers or memory-to-memory operations.
- Create a large test file directly on the rootfs:
dd if=/dev/zero of=/tmp/testfile bs=1M count=1000
- Use this file for transfer tests instead of creating and mounting image files.
-
Benchmark raw USB performance:
- Use dd and pv to measure raw transfer speeds without filesystem overhead:
dd if=/dev/zero bs=1M count=1000 | pv -p -r -a > /dev/null
- This command will show the maximum write speed to a null device.
- Use dd and pv to measure raw transfer speeds without filesystem overhead:
-
Test with ramdisk:
- Create a ramdisk to eliminate storage medium bottlenecks:
mkdir /mnt/ramdisk mount -t tmpfs -o size=1g tmpfs /mnt/ramdisk
- Perform transfer tests using files on this ramdisk.
- Create a ramdisk to eliminate storage medium bottlenecks:
-
Check and update Jetson Linux (L4T):
- Verify your current L4T version:
head -n 1 /etc/nv_tegra_release
- Update to the latest version if available, as it may include USB performance improvements.
- Verify your current L4T version:
-
Examine USB controller settings:
- Review the output of:
lsusb -t
- Look for the maximum speed reported for your USB controller.
- Review the output of:
-
Investigate custom driver performance:
- If using a custom driver based on f_loopback.c, profile the driver to identify potential bottlenecks.
- Consider using kernel tracing tools like ftrace to analyze USB stack performance.
-
Test with different USB ports and hosts:
- Try connecting to different USB 3.0 ports on the host PC.
- If possible, test with a different host computer to rule out host-specific issues.
-
Monitor system resources:
- Use tools like
top
,htop
, oriotop
to check if CPU, memory, or I/O bottlenecks are affecting performance.
- Use tools like
-
Consult Nvidia documentation:
- Review the latest Jetson Linux Developer Guide for any known issues or optimizations related to USB device mode performance.
If these steps do not resolve the issue, consider reaching out to Nvidia developer support with detailed logs and test results, as this may indicate a more fundamental limitation or bug in the current Jetson Orin Nano USB implementation.