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
10 changes: 7 additions & 3 deletions .github/workflows/build-kornia-rs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,18 @@ jobs:
kornia-py/benchmarks
kornia-py/pyproject.toml
tests/data
# test_apriltag_decoder needs the tests/data/apriltag-imgs git
# test_apriltag_decoder and (from 0.2.0) test_estimate_pose read
# tag36_11_00005.png out of the tests/data/apriltag-imgs git
# submodule (a 200+ MB clone of kornia/apriltag-imgs for one PNG),
# which the checkout above doesn't fetch; every other apriltag test
# runs off files already in tests/data.
# runs off files already in tests/data. Deselecting a test a version
# doesn't have is a no-op, so both apply to every version.
CIBW_TEST_COMMAND: >-
cd kornia-py &&
python -c "import kornia_rs.kornia_rs as m; assert m.__file__.endswith('.so'), m.__file__" &&
python -m pytest -v --deselect tests/test_apriltag.py::test_apriltag_decoder
python -m pytest -v
--deselect tests/test_apriltag.py::test_apriltag_decoder
--deselect tests/test_apriltag.py::test_estimate_pose

- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
Expand Down
2 changes: 2 additions & 0 deletions docs/packages/kornia-rs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ versions:
- filename: kornia_rs-0.1.14-cp314-cp314t-manylinux_2_39_riscv64.whl
sha256: 9c83dfff34af0ec96ee59dd22df26edbf8f0136b02747a191923c4cc751ad445
requires-python: '>=3.8'
- version: 0.1.15
- version: 0.2.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ludovic Henry <git@ludovic.dev>
Date: Sun, 6 Sep 2026 00:00:00 +0000
Subject: [PATCH] kornia-io: drop turbojpeg's require-simd default feature

kornia-io's optional `turbojpeg` feature (on by default via kornia-py)
pulls in turbojpeg-sys, which vendors libjpeg-turbo and builds it with
cmake. turbojpeg-sys's own default features include `require-simd`,
which passes `-DREQUIRE_SIMD=ON` to that cmake build.

libjpeg-turbo's simd/CMakeLists.txt only ships SIMD kernels for
x86/x86-64, Arm, MIPS and PowerPC; every other CPU_TYPE (riscv64
included) falls through to:

simd_fail("SIMD extensions not available for this CPU (...)")

and simd_fail() is a hard `message(FATAL_ERROR ...)` when REQUIRE_SIMD
is ON, aborting the cmake configure step. The option's own help text
says the *default* (REQUIRE_SIMD=OFF) is "to fall back to a non-SIMD
build" with just a warning - riscv64 has no SIMD kernels to build
either way, so this only changes a fatal error into a warning plus a
scalar (non-SIMD) libjpeg-turbo build.

Dropping default-features and re-listing `cmake`/`pkg-config` (the two
turbojpeg default features we still want) is a no-op on every currently
supported target: x86/x86-64/Arm/PowerPC all have SIMD kernels bundled,
so simd_fail() is never reached there regardless of REQUIRE_SIMD.

Upstream-Status: To upstream [not filed upstream from this porting session, which does not open issues/PRs on repos other than riseproject-dev/python-wheels; genuinely worth upstreaming since it only relaxes a fatal error into upstream's own documented non-SIMD fallback]

Signed-off-by: Ludovic Henry <git@ludovic.dev>
---
crates/kornia-io/Cargo.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crates/kornia-io/Cargo.toml b/crates/kornia-io/Cargo.toml
index add1a67..6dfb46b 100644
--- a/crates/kornia-io/Cargo.toml
+++ b/crates/kornia-io/Cargo.toml
@@ -40,7 +40,7 @@ png = "0.18"
thiserror = { workspace = true }
tiff = "0.11"
# for fast jpeg encoding/decoding
-turbojpeg = { version = "1.4", optional = true }
+turbojpeg = { version = "1.4", optional = true, default-features = false, features = ["cmake", "pkg-config"] }
zune-jpeg = "0.5"

[dev-dependencies]
--
2.43.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ludovic Henry <git@ludovic.dev>
Date: Sun, 6 Sep 2026 00:00:00 +0000
Subject: [PATCH] kornia-io: drop turbojpeg's require-simd default feature

kornia-io's optional `turbojpeg` feature (on by default via kornia-py)
pulls in turbojpeg-sys, which vendors libjpeg-turbo and builds it with
cmake. turbojpeg-sys's own default features include `require-simd`,
which passes `-DREQUIRE_SIMD=ON` to that cmake build.

libjpeg-turbo's simd/CMakeLists.txt only ships SIMD kernels for
x86/x86-64, Arm, MIPS and PowerPC; every other CPU_TYPE (riscv64
included) falls through to:

simd_fail("SIMD extensions not available for this CPU (...)")

and simd_fail() is a hard `message(FATAL_ERROR ...)` when REQUIRE_SIMD
is ON, aborting the cmake configure step. The option's own help text
says the *default* (REQUIRE_SIMD=OFF) is "to fall back to a non-SIMD
build" with just a warning - riscv64 has no SIMD kernels to build
either way, so this only changes a fatal error into a warning plus a
scalar (non-SIMD) libjpeg-turbo build.

Dropping default-features and re-listing `cmake`/`pkg-config` (the two
turbojpeg default features we still want) is a no-op on every currently
supported target: x86/x86-64/Arm/PowerPC all have SIMD kernels bundled,
so simd_fail() is never reached there regardless of REQUIRE_SIMD.

Upstream-Status: To upstream [not filed upstream from this porting session, which does not open issues/PRs on repos other than riseproject-dev/python-wheels; genuinely worth upstreaming since it only relaxes a fatal error into upstream's own documented non-SIMD fallback]

Signed-off-by: Ludovic Henry <git@ludovic.dev>
---
crates/kornia-io/Cargo.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crates/kornia-io/Cargo.toml b/crates/kornia-io/Cargo.toml
index add1a67..6dfb46b 100644
--- a/crates/kornia-io/Cargo.toml
+++ b/crates/kornia-io/Cargo.toml
@@ -40,7 +40,7 @@ png = "0.18"
thiserror = { workspace = true }
tiff = "0.11"
# for fast jpeg encoding/decoding
-turbojpeg = { version = "1.4", optional = true }
+turbojpeg = { version = "1.4", optional = true, default-features = false, features = ["cmake", "pkg-config"] }
zune-jpeg = "0.5"

[dev-dependencies]
--
2.43.0

Loading