diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 3caec9d99..3f4423ebf 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -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 @@ -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 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9f78edd3b..b045659f8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 @@ -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/ @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -435,7 +423,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' @@ -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 diff --git a/.github/workflows/test-install-dependencies.yml b/.github/workflows/test-install-dependencies.yml index 5635a594b..de1769d3b 100644 --- a/.github/workflows/test-install-dependencies.yml +++ b/.github/workflows/test-install-dependencies.yml @@ -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 @@ -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 @@ -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 @@ -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" @@ -79,4 +79,4 @@ - name: Install example requirements run: | python examples/install_requirements.py - + diff --git a/depthai-core b/depthai-core index d6a37a5ba..412bd6031 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit d6a37a5ba8ba2ee187fabc9208b813db5f75d4a7 +Subproject commit 412bd603120ff657b805752874e1b1c4b7f30045 diff --git a/src/DeviceBindings.cpp b/src/DeviceBindings.cpp index 7f94027d1..ac4d10e4a 100644 --- a/src/DeviceBindings.cpp +++ b/src/DeviceBindings.cpp @@ -9,6 +9,7 @@ #include "depthai-shared/device/CrashDump.hpp" // std::chrono bindings +#include #include // py::detail #include @@ -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."); } } diff --git a/src/XLinkBindings.cpp b/src/XLinkBindings.cpp index bb5475fd3..b76ac864f 100644 --- a/src/XLinkBindings.cpp +++ b/src/XLinkBindings.cpp @@ -133,7 +133,7 @@ void XLinkBindings::bind(pybind11::module &m, void *pCallstack) .def(py::init >()) .def(py::init()) .def(py::init()) - .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"))