DriveWorks SDK Reference
4.0.0 Release
For Test and Development only

doc/tutorials/recording/dwx_HighThroughputRecording.md
Go to the documentation of this file.
1 # Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
2 
3 @page dwx_recording_devguide_high_throughput_recording High Throughput Recording
4 @tableofcontents
5 
6 This section provides guidance on developing strategies for recording the huge
7 amounts of data that multiple cameras can produce.
8 
9 @section dwx_recording_devguide_high_determining_speed Determining the Required the USB Disk Speed
10 
11 Because of storage limitations with the platform's local file system, sensor
12 data is stored on an external USB 3.0 drive. But the drive must be fast enough
13 to keep up with the amount of data that your sensors generate. For example, four
14 cameras generating RAW data at 30 frames per second can exceed the bandwidth of
15 most SSD USB drives.
16 
17 The required write speed of the drives depends on the number of sensors and the
18 recording format. If you are recording RAW data, calculate the required drive
19 speed as:
20 
21  width * height * 2 * fps = bytes/second
22 RAW recording consumes most of the bandwidth.
23 
24 @section dwx_recording_devguide_high_options Options for Capturing High-Throughput Data
25 
26 The following table provides suggestions for recording more than three cameras generating RAW.
27 
28 | Cameras generating RAW | Framerate | Options |
29 |------------------------|-----------|---------|
30 | 3-4 | 30 | Attach all cameras to a single Xavier and mount a USB on that Xavier. |
31 | 6-8 | 30 | <ul><li>Attach 3-4 cameras to Xavier A and mount a USB on that Xavier.</li><li>Do the same for Xavier B.</li><li>Use PTP or gPTP to synchronize camera timestamps between the Xavier cameras.</li></ul>|
32 | 12 | 30 | Use two NVIDIA DRIVE platforms. For each platform, follow the steps as for 6-8 cameras at 30 FPS. |
33 
34 @section dwx_recording_devguide_high_achieving_max_throughput Achieving the Maximum USB Throughput
35 
36 You should be able to achieve USB3.0-SSD write speeds between 400 and 500-
37 megabytes per second, depending on the brand of the USB3.0 SSD being used. That
38 speed is adequate for three cameras generating RAW data. If you need to store
39 more data than your USB device can handle, consider distributing recording
40 across the different Xavier processors. For more information, see
41 @ref dwx_devguide_rec_distrec in this guide.
42 
43 NVIDIA has tested extensively with Samsung 850 EVO and Samsung 750 EVO SSDs,
44 where the SSDs are formatted with the EXT4 file system. The following are
45 guidelines for ensuring optimal disk speed.
46 
47 The system automatically mounts the USB drive.
48 
49 ### To initialize your USB disk (Linux)
50 
51 1. Enable the CFQ schedule for the USB disk:
52 
53  # echo cfq > /sys/block/sda/queue/scheduler
54  The directory /sys/block/device/queue/iosched contains files that allow the
55  administrator to retrieve and set tunable values related to the I/O scheduler.
56 
57 2. Change the memory limit for the I/O scheduler.
58 
59  # echo 1000 > /sys/module/usbcore/parameters/usbfs_memory_mb
60 3. Confirm you successfully updated the memory limit.
61 
62  # cat /sys/module/usbcore/parameters/usbfs_memory_mb
63 
64 ### To optimize your platform to store recorded data (Linux)
65 
66 1. Locate and edit the following file:
67 
68  /etc/sysctl.conf
69 2. Modify the file to have the following settings. These are persistent changes
70  and are preserved between reboots.
71 ```
72  net.core.rmem_default = 1048576
73  net.core.rmem_max = 10485760
74  net.core.wmem_default = 1048576
75  net.core.wmem_max = 10485760
76  net.core.netdev_max_backlog = 30000
77  net.ipv4.ipfrag_high_thresh = 8388608
78  net.ipv6.conf.all.disable_ipv6 = 1
79  vm.dirty_background_ratio = 5
80  vm.dirty_ratio = 50
81 ```
82 
83 ### To determine the write speed of the mounted jbod disk (Linux)
84 
85 - Enter:
86 
87  # dd if=/dev/zero of=/media/NVidia/folder#/file bs=1G count=10
88  The JBod disk is mounted on:
89 
90  /media/NVidia/