You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first time you build, the repository submodules need be initialized:
35
+
```
36
+
git submodule update --init --recursive
37
+
38
+
# Tip: You can ask Git to do that automatically:
39
+
git config submodule.recurse true
40
+
```
41
+
42
+
Later submodules also need to be updated.
43
+
44
+
#### Local build with pip
34
45
To build and install using pip:
35
46
```
36
47
python3 -m pip install .
37
48
```
38
49
Add parameter `-v` to see the output of the building process.
39
50
40
-
51
+
#### Wheel with pip
41
52
To build a wheel, execute the following
42
53
```
43
54
python3 -m pip wheel . -w wheelhouse
44
55
```
45
56
57
+
#### Shared library
46
58
To build a shared library from source perform the following:
47
59
48
60
> ℹ️ To speed up build times, use `cmake --build build --parallel [num CPU cores]` (CMake >= 3.12).
49
61
For older versions use: Linux/macOS: `cmake --build build -- -j[num CPU cores]`, MSVC: `cmake --build build -- /MP[num CPU cores]`
50
62
51
63
```
52
-
git submodule update --init --recursive
53
64
cmake -H. -Bbuild
54
65
cmake --build build
55
66
```
56
67
To specify custom Python executable to build for, use `cmake -H. -Bbuild -D PYTHON_EXECUTABLE=/full/path/to/python`.
57
68
69
+
#### Common issues
70
+
71
+
* Many build fails due to missing dependencies. This also happens when submodules are missing or outdated (`git submodule update --recursive`).
72
+
* If libraries and headers are not in standard places, or not on the search paths, CMake reports it cannot find what it needs (e.g. `libusb`). CMake can be hinted at where to look, for exmpale: `CMAKE_LIBRARY_PATH=/opt/local/lib CMAKE_INCLUDE_PATH=/opt/local/include pip install .`
73
+
* Some distribution installers may not get the desired library. For example, an install on a RaspberryPi failed, missing `libusb`, as the default installation with APT led to v0.1.3 at the time, whereas the library here required v1.0.
By default, queues are **blocking** and their size is **30**, so when the device fills up a queue and when the limit is
69
+
reached, any additional messages from the device will be blocked and the library will wait until it can add new messages to the queue.
70
+
It will wait for the host to consume (eg. :code:`queue.get()`) a message before putting a new one into the queue.
71
+
72
+
.. note::
73
+
After the host queue gets filled up, the XLinkOut.input queue on the device will start filling up. If that queue is
74
+
set to blocking, other nodes that are sending messages to it will have to wait as well. This is a usual cause for a
75
+
blocked pipeline, where one of the queues isn't emptied in timely manner and the rest of the pipeline waits for it
76
+
to be empty again.
77
+
78
+
Non-Blocking behaviour
79
+
**********************
80
+
Making the queue non-blocking will change the behavior in the situation described above - instead of waiting, the library will discard
81
+
the oldest message and add the new one to the queue, and then continue its processing loop (so it won't get blocked).
82
+
:code:`maxSize` determines the size of the queue and it also helps to control memory usage.
83
+
84
+
For example, if a message has 5MB of data, and the queue size is 30, this queue can effectively store
85
+
up to 150MB of data in the memory on the host (the messages can also get really big, for instance, a single 4K NV12 encoded frame takes about ~12MB).
86
+
87
+
Some additional information
88
+
***************************
89
+
90
+
- Decreasing the queue size to 1 and setting non-blocking behavior will effectively mean "I only want the latest packet from the queue".
91
+
- Queues are thread-safe - they can be accessed from any thread.
92
+
- Queues are created such that each queue is its own thread which takes care of receiving, serializing/deserializing, and sending the messages forward (same for input/output queues).
93
+
- The :code:`Device` object isn't fully thread-safe. Some RPC calls (eg. :code:`getLogLevel`, :code:`setLogLevel`, :code:`getDdrMemoryUsage`) will get thread-safe once the mutex is set in place (right now there could be races).
0 commit comments