Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/docker-hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
with:
args: /bin/sh -c "rm -rf /github/workspace/.* || rm -rf /github/workspace/*"
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- name: Login to DockerHub
Expand All @@ -46,7 +46,7 @@ jobs:
run: echo "LUXONIS_IMAGE_TAG=${GITHUB_REF#refs/*/}-${{ matrix.arch }}" >> $GITHUB_ENV

- name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v4
with:
push: true
file: ci/Dockerfile
Expand Down
91 changes: 40 additions & 51 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Cache .hunter folder
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.hunter
key: hunter-ubuntu-latest
- name: List .hunter cache directory
run: ls -a -l ~/.hunter/_Base/ || true
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up Python
Expand All @@ -55,7 +55,7 @@ jobs:
- name: Build target 'pybind11_mkdoc'
run: cmake --build build --target pybind11_mkdoc --parallel 4
- name: Upload docstring artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: docstrings
path: docstrings/
Expand All @@ -79,22 +79,22 @@ jobs:
cmake-version: '3.29.x'
- name: Cache .hunter folder
if: matrix.os != 'windows-latest'
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.hunter/
key: hunter-pytest-${{ matrix.os }}
- name: Cache .hunter folder
if: matrix.os == 'windows-latest'
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: C:/.hunter/
key: hunter-pytest-${{ matrix.os }}

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: 'docstrings'
path: docstrings
Expand Down Expand Up @@ -136,20 +136,16 @@ jobs:
needs: build-docstrings
strategy:
matrix:
rpi-os: [rpi-buster, rpi-bullseye, rpi-bookworm]
rpi-os: [rpi-bullseye, rpi-bookworm]
runs-on: ${{ matrix.rpi-os }}
env:
# workaround required for cache@v3, https://github.com/actions/cache/issues/1428
# to be removed when upgrading the manylinux image
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
steps:
- name: Print home directory
run: echo Home directory inside container $HOME
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: 'docstrings'
path: docstrings
Expand All @@ -169,9 +165,9 @@ jobs:
mkdir -p wheelhouse/audited/
for whl in wheelhouse/preaudited/*linux_armv6l*.whl; do cp "$whl" wheelhouse/audited/$(basename $whl); done
- name: Archive wheel artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: audited-wheels
name: audited-wheels-${{ matrix.rpi-os }}
path: wheelhouse/audited/
- name: Deploy wheels to artifactory (if not a release)
if: startsWith(github.ref, 'refs/tags/v') != true
Expand All @@ -193,15 +189,15 @@ jobs:
fail-fast: false
steps:
- name: Cache .hunter folder
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: C:/.hunter
key: hunter-msvc
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: 'docstrings'
path: docstrings
Expand All @@ -227,9 +223,9 @@ jobs:
- name: Building wheels
run: python -m pip wheel . -w ./wheelhouse/audited/ --verbose
- name: Archive wheel artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: audited-wheels
name: audited-wheels-windows-${{ matrix.python-version }}-${{ matrix.python-architecture }}
path: wheelhouse/audited/
- name: Deploy wheels to artifactory (if not a release)
if: startsWith(github.ref, 'refs/tags/v') != true
Expand All @@ -249,7 +245,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Cache .hunter folder
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.hunter
key: hunter-macos-latest
Expand All @@ -258,11 +254,11 @@ jobs:
ls -a -l ~/.hunter/_Base/ || true
echo "PATH=$PATH"

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: 'docstrings'
path: docstrings
Expand All @@ -288,9 +284,9 @@ jobs:
- name: Auditing wheels
run: ci/repair-whl-macos.sh `pwd`/wheelhouse/* `pwd`/wheelhouse/audited
- name: Archive wheel artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: audited-wheels
name: audited-wheels-macos-${{ matrix.python-version }}-${{ matrix.os }}
path: wheelhouse/audited/
- name: Deploy wheels to artifactory (if not a release)
if: startsWith(github.ref, 'refs/tags/v') != true
Expand All @@ -304,21 +300,17 @@ jobs:
build-linux-x86_64:
needs: build-docstrings
runs-on: ubuntu-latest
env:
# workaround required for cache@v3, https://github.com/actions/cache/issues/1428
# to be removed when upgrading the manylinux image
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
container:
image: quay.io/pypa/manylinux2014_x86_64:latest
image: quay.io/pypa/manylinux_2_28_x86_64:latest
env:
PLAT: manylinux2014_x86_64
PLAT: manylinux_2_28_x86_64
steps:
- name: Cache .hunter folder
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.hunter
key: hunter-x86_64
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Installing libusb1-devel dependency
Expand All @@ -330,7 +322,7 @@ jobs:
- name: Create folder structure
run: mkdir -p wheelhouse/audited/

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: 'docstrings'
path: docstrings
Expand All @@ -356,9 +348,9 @@ jobs:
- name: Audit wheels
run: for whl in wheelhouse/*.whl; do auditwheel repair "$whl" --plat $PLAT -w wheelhouse/audited/; done
- name: Archive wheel artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: audited-wheels
name: audited-wheels-linux-x86_64
path: wheelhouse/audited/
- name: Deploy wheels to artifactory (if not a release)
if: startsWith(github.ref, 'refs/tags/v') != true
Expand All @@ -372,19 +364,15 @@ jobs:
build-linux-arm64:
needs: build-docstrings
runs-on: [self-hosted, linux, ARM64]
env:
# workaround required for cache@v3, https://github.com/actions/cache/issues/1428
# to be removed when upgrading the manylinux image
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
container:
image: quay.io/pypa/manylinux2014_aarch64:latest
image: quay.io/pypa/manylinux_2_28_aarch64:latest
env:
PLAT: manylinux2014_aarch64
PLAT: manylinux_2_28_aarch64
# Mount local hunter cache directory, instead of transfering to Github and back
volumes:
- /.hunter:/github/home/.hunter
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Installing libusb1-devel dependency
Expand All @@ -396,7 +384,7 @@ jobs:
- name: Create folder structure
run: mkdir -p wheelhouse/audited/

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: 'docstrings'
path: docstrings
Expand All @@ -417,9 +405,9 @@ jobs:
- name: Auditing wheels
run: for whl in wheelhouse/*.whl; do auditwheel repair "$whl" --plat $PLAT -w wheelhouse/audited/; done
- name: Archive wheel artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: audited-wheels
name: audited-wheels-linux-arm64
path: wheelhouse/audited/
- name: Deploy wheels to artifactory (if not a release)
if: startsWith(github.ref, 'refs/tags/v') != true
Expand All @@ -435,7 +423,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'recursive'

Expand Down Expand Up @@ -470,12 +458,13 @@ jobs:
needs: [release]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: audited-wheels
pattern: audited-wheels*
merge-multiple: true
path: wheelhouse/audited/
- name: List files
run: ls -lah
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test-install-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
container:
image: ${{ matrix.container_image }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install sudo
if: startsWith(matrix.container_image, 'fedora') == true
run: yum update -y && yum install -y sudo
Expand All @@ -38,7 +38,7 @@
sudo apt-get install -y python3-venv
python3 -m venv .env
. .env/bin/activate
pip install --upgrade pip
pip install --upgrade pip
python3 examples/install_requirements.py
shell: bash
- name: Install example requirements
Expand All @@ -51,7 +51,7 @@
os: ["macos-12", "macos-13", "macos-14"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sed '/udevadm control --reload-rules && sudo udevadm trigger/d' docs/install_dependencies.sh > tmp_script.sh
Expand All @@ -60,13 +60,13 @@
run: |
python3 -m venv .env
. .env/bin/activate
pip install --upgrade pip
pip install --upgrade pip
python3 examples/install_requirements.py
shell: bash
test_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.10"
Expand All @@ -79,4 +79,4 @@
- name: Install example requirements
run: |
python examples/install_requirements.py

2 changes: 1 addition & 1 deletion depthai-core
11 changes: 9 additions & 2 deletions src/DeviceBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "depthai-shared/device/CrashDump.hpp"

// std::chrono bindings
#include <XLink/XLinkPublicDefines.h>
#include <pybind11/chrono.h>
// py::detail
#include <pybind11/detail/common.h>
Expand Down Expand Up @@ -41,8 +42,14 @@ static auto deviceSearchHelper(Args&&... args){
auto numConnected = DEVICE::getAllAvailableDevices().size();
if(numConnected > 0) {
throw std::runtime_error("No available devices (" + std::to_string(numConnected) + " connected, but in use)");
} else {
throw std::runtime_error("No available devices");
}
auto numDevicesAnyPlatform = dai::XLinkConnection::getAllConnectedDevices(X_LINK_ANY_STATE, false, X_LINK_ANY_PLATFORM).size();
auto numDevicesRVC2 = dai::XLinkConnection::getAllConnectedDevices(
X_LINK_ANY_STATE, false, X_LINK_MYRIAD_X)
.size();
auto nonRVC2Devices = numDevicesAnyPlatform - numDevicesRVC2;
if(nonRVC2Devices > 0) {
throw std::runtime_error("No available RVC2 devices found, but found " + std::to_string(nonRVC2Devices) + " non RVC2 device[s]. To use RVC4 devices, please update DepthAI to version v3.x or newer.");
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/XLinkBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void XLinkBindings::bind(pybind11::module &m, void *pCallstack)
.def(py::init<const DeviceInfo &, std::vector<std::uint8_t> >())
.def(py::init<const DeviceInfo &, std::string>())
.def(py::init<const DeviceInfo &>())
.def_static("getAllConnectedDevices", &XLinkConnection::getAllConnectedDevices, py::arg("state") = X_LINK_ANY_STATE, py::arg("skipInvalidDevices") = true)
.def_static("getAllConnectedDevices", &XLinkConnection::getAllConnectedDevices, py::arg("state") = X_LINK_ANY_STATE, py::arg("skipInvalidDevices") = true, py::arg("platform") = X_LINK_MYRIAD_X)
.def_static("getFirstDevice", &XLinkConnection::getFirstDevice, py::arg("state") = X_LINK_ANY_STATE, py::arg("skipInvalidDevice") = true)
.def_static("getDeviceByMxId", &XLinkConnection::getDeviceByMxId, py::arg("mxId"), py::arg("state") = X_LINK_ANY_STATE, py::arg("skipInvalidDevice") = true)
.def_static("bootBootloader", &XLinkConnection::bootBootloader, py::arg("devInfo"))
Expand Down
Loading