Skip to content

v47-io/enc-dec-hwscan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7c47395 · Nov 2, 2024

History

46 Commits
Oct 21, 2024
Aug 25, 2024
Aug 25, 2024
Aug 25, 2024
Aug 25, 2024
Aug 25, 2024
Aug 25, 2024
Oct 11, 2024
Nov 2, 2024
Aug 10, 2024
Aug 9, 2024
Aug 9, 2024
Aug 14, 2024
Aug 25, 2024
Aug 10, 2024
Aug 23, 2024
Aug 9, 2024
Aug 9, 2024
Aug 23, 2024

Repository files navigation

Encode/Decode Hardware Scan

A library illustrating the use of Kotlin, Rust, Java 22's Foreign Function and Memory API, Quarkus, and GraalVM Native Image to provide a focused development experience when targeting a singular platform (x86_64 Linux).

Using Java 22 makes it possible to provide a simple native interface without the usual JNI cruft. This results in a native library that can be used outside the confines of this project like any other shared library.

Currently implemented are support for CUDA >= 5.0 and NvEnc >= 7.0 to retrieve information about NVIDIA encoding/decoding hardware, and VA-API for any other supported GPUs (Intel, AMD, ...). This means that all consumer NVIDIA cards starting with the GeForce 700 series are supported.

Usage

Start integration-test and access localhost:8080/devices to retrieve the list of detected hardware and its capabilities.

Example output:

{
  "devices": [
    {
      "driver": "Nvidia",
      "ordinal": 0,
      "path": null,
      "name": "NVIDIA GeForce RTX 3090",
      "codecs": {
        "Mpeg1": {
          "codec": "Mpeg1",
          "decodingSpecs": [
            {
              "chroma": "Yuv420",
              "colorDepth": "Bit8",
              "maxWidth": 4080,
              "maxHeight": 4080
            }
          ],
          "encodingSpecs": []
        },
        "Mpeg2": {
          "codec": "Mpeg2",
          "decodingSpecs": [
            {
              "chroma": "Yuv420",
              "colorDepth": "Bit8",
              ...

Development

Prerequisites

  • Linux (no Windows or macos)
  • Mandrel or Liberica NIK 24.r22 (JDK 22, for native-image)
  • Jextract
  • Clang
  • Rust 2021 Edition
  • cuda.h in /usr/include (get it from Cuda Toolkit)
  • VA-API:
    • Debian like: libva-dev
    • RHEL like: libva-devel

Building

./gradlew build

Native Image:

./gradlew build \
  -Dquarkus.package.jar.enabled=false \
  -Dquarkus.native.enabled=true

The final result is a native executable that can be run on any machine provided the required libc version is available.

About

Detect the encoding and decoding capabilities of your hardware

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published