Archived
diag: name the build's media capability; docs(GUIDE): the ffmpeg row
An AUTO probe that misses leaves one STATUS line in the configure log, and the engine boots green and 500s every media request; the startup report -- the part of a log to paste into an issue -- said nothing about the capability that decides it. mm::decoder_version() names it (the libavformat version, or "absent (built without libav*)"), reported on the startup report and /diagnostics (hardware.host.media), and GUIDE 1.1 lists the five -dev packages, the RAD_WITH_FFMPEG tri-state and the symptom.
This commit is contained in:
1 parent
0bb00a836d
commit
1720ed3f4a
6 files changed
+23
No files matched your search
@@ -109,6 +109,7 @@ struct HostFacts {
|
|||||||
std::string io_uring; /* available | refused (why) | unknown */
|
std::string io_uring; /* available | refused (why) | unknown */
|
||||||
std::string cpu_governor, cpu_epp, cpu_driver;
|
std::string cpu_governor, cpu_epp, cpu_driver;
|
||||||
std::string runtime; /* the device runtime's version, "" for none */
|
std::string runtime; /* the device runtime's version, "" for none */
|
||||||
|
std::string media; /* "libavformat <v>" / "absent (built without libav*)" */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Facts {
|
struct Facts {
|
||||||
|
|||||||
@@ -89,6 +89,8 @@ std::string host_lines(const HostFacts& h, const RunFacts& r) {
|
|||||||
o += fmt(" runtime %s | backend %s\n",
|
o += fmt(" runtime %s | backend %s\n",
|
||||||
h.runtime.empty() ? "no device runtime" : h.runtime.c_str(),
|
h.runtime.empty() ? "no device runtime" : h.runtime.c_str(),
|
||||||
r.host_backend ? "host (CPU)" : "device");
|
r.host_backend ? "host (CPU)" : "device");
|
||||||
|
if (!h.media.empty())
|
||||||
|
o += fmt(" media decoders %s\n", h.media.c_str());
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,6 +226,7 @@ std::string to_json(const std::vector<ConfigRow>& config, const std::vector<Deci
|
|||||||
host["cpu_epp"] = h.cpu_epp;
|
host["cpu_epp"] = h.cpu_epp;
|
||||||
host["cpu_driver"] = h.cpu_driver;
|
host["cpu_driver"] = h.cpu_driver;
|
||||||
host["runtime"] = h.runtime;
|
host["runtime"] = h.runtime;
|
||||||
|
host["media"] = h.media;
|
||||||
J cards = J::array();
|
J cards = J::array();
|
||||||
for (const CardFacts& c : f.cards) {
|
for (const CardFacts& c : f.cards) {
|
||||||
J e;
|
J e;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
#include "engine_priv.h"
|
#include "engine_priv.h"
|
||||||
#include "device/device.h"
|
#include "device/device.h"
|
||||||
|
#include "mm/media.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
@@ -37,6 +38,7 @@ diag::Facts Engine::hardware_facts(bool serving) const {
|
|||||||
if (r->device == id.device) mine.push_back(id.bdf);
|
if (r->device == id.device) mine.push_back(id.bdf);
|
||||||
diag::Facts f = diag::collect("", serving ? &mine : nullptr);
|
diag::Facts f = diag::collect("", serving ? &mine : nullptr);
|
||||||
f.host.runtime = runtime_version_;
|
f.host.runtime = runtime_version_;
|
||||||
|
f.host.media = mm::decoder_version();
|
||||||
if (probed_) {
|
if (probed_) {
|
||||||
f.host.memlock_soft = memlock_soft_;
|
f.host.memlock_soft = memlock_soft_;
|
||||||
f.host.io_uring = io_uring_;
|
f.host.io_uring = io_uring_;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#include "rad_internal.h"
|
#include "rad_internal.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cstdio>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
#ifdef RAD_HAVE_FFMPEG
|
#ifdef RAD_HAVE_FFMPEG
|
||||||
@@ -26,6 +27,8 @@ namespace mm {
|
|||||||
|
|
||||||
bool decoder_available() { return false; }
|
bool decoder_available() { return false; }
|
||||||
|
|
||||||
|
std::string decoder_version() { return "absent (built without libav*)"; }
|
||||||
|
|
||||||
static int no_decoder(std::string* why) {
|
static int no_decoder(std::string* why) {
|
||||||
if (why) *why = "this build has no media decoder: it was configured without libavformat / "
|
if (why) *why = "this build has no media decoder: it was configured without libavformat / "
|
||||||
"libavcodec / libswscale (RAD_WITH_FFMPEG)";
|
"libavcodec / libswscale (RAD_WITH_FFMPEG)";
|
||||||
@@ -57,6 +60,14 @@ int decode_audio(const uint8_t*, size_t, int32_t, int64_t, std::vector<float>*,
|
|||||||
|
|
||||||
bool decoder_available() { return true; }
|
bool decoder_available() { return true; }
|
||||||
|
|
||||||
|
std::string decoder_version() {
|
||||||
|
const unsigned v = avformat_version();
|
||||||
|
char b[48];
|
||||||
|
std::snprintf(b, sizeof(b), "libavformat %u.%u.%u", AV_VERSION_MAJOR(v), AV_VERSION_MINOR(v),
|
||||||
|
AV_VERSION_MICRO(v));
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
/* The only demuxers a request may reach. A format that can name another file (a playlist, a
|
/* The only demuxers a request may reach. A format that can name another file (a playlist, a
|
||||||
|
|||||||
@@ -36,6 +36,11 @@ struct FrameRGBA {
|
|||||||
/* Whether this build has a decoder. */
|
/* Whether this build has a decoder. */
|
||||||
bool decoder_available();
|
bool decoder_available();
|
||||||
|
|
||||||
|
/* "libavformat <version>" when the decoder is built in, "absent (built without libav*)"
|
||||||
|
* when it is not: one string for the startup report and /diagnostics, so a media 500 can be
|
||||||
|
* read off the report instead of bisected. */
|
||||||
|
std::string decoder_version();
|
||||||
|
|
||||||
/* The first frame of an image (or of anything with a video stream). Refuses a source over
|
/* The first frame of an image (or of anything with a video stream). Refuses a source over
|
||||||
* `max_pixels`, which bounds what a request can make the server allocate before any resize. */
|
* `max_pixels`, which bounds what a request can make the server allocate before any resize. */
|
||||||
int decode_image(const uint8_t* data, size_t n, int64_t max_pixels, Frame* out, std::string* why);
|
int decode_image(const uint8_t* data, size_t n, int64_t max_pixels, Frame* out, std::string* why);
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ driver. [`DOCKER.md`](DOCKER.md) covers it, with compose files per model.
|
|||||||
| Optional | ROCm with `hipcc`, for AMD device kernels; without it you get the host backend. Set `ROCM_PATH` if ROCm is not at `/opt/rocm` |
|
| Optional | ROCm with `hipcc`, for AMD device kernels; without it you get the host backend. Set `ROCM_PATH` if ROCm is not at `/opt/rocm` |
|
||||||
| With a card | Resizable BAR on (Above 4G Decoding and Resizable BAR in the firmware setup). The host writes every dispatch's arguments into VRAM there. On a card whose BAR is smaller than its VRAM they stay in pinned host memory and every dispatch reads them over the link: on R9700s, Qwen3.8-27B fp8 decode steps take 0.4-1.8% longer at `--tp 1` and 2 than with the arguments in VRAM. Peer access needs the large BAR too, so at `--tp 2` and above such a card takes the collectives through host memory (§4.7) |
|
| With a card | Resizable BAR on (Above 4G Decoding and Resizable BAR in the firmware setup). The host writes every dispatch's arguments into VRAM there. On a card whose BAR is smaller than its VRAM they stay in pinned host memory and every dispatch reads them over the link: on R9700s, Qwen3.8-27B fp8 decode steps take 0.4-1.8% longer at `--tp 1` and 2 than with the arguments in VRAM. Peer access needs the large BAR too, so at `--tp 2` and above such a card takes the collectives through host memory (§4.7) |
|
||||||
| Optional | OpenMP, used by the host kernel libraries if present |
|
| Optional | OpenMP, used by the host kernel libraries if present |
|
||||||
|
| Optional | `libavformat-dev libavcodec-dev libavutil-dev libswscale-dev libswresample-dev` (ffmpeg 6+), for image, video and audio input. The probe is `RAD_WITH_FFMPEG` (`ON` fatal, `OFF` off, default `AUTO`): built without them the engine boots normal, serves text, and refuses every image/video/audio part with HTTP 500 — the configure log is the only warning (`radiance: no libavformat ...`). `GET /diagnostics` shows `media decoders` |
|
||||||
| Optional | `clang++` (or ROCm's), for `tests/r4d_emu` when the C++ compiler is g++; CMake 3.25+ for `CMakePresets.json` |
|
| Optional | `clang++` (or ROCm's), for `tests/r4d_emu` when the C++ compiler is g++; CMake 3.25+ for `CMakePresets.json` |
|
||||||
| Shell harnesses | `curl` and `jq` |
|
| Shell harnesses | `curl` and `jq` |
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user