Verify FFmpeg Linux GPU Encoding

This article provides a straightforward guide on how to verify if your Linux GPU is actively hardware-accelerating your FFmpeg encoding tasks. You will learn how to check your command syntax for GPU-specific codecs and use real-time monitoring tools for NVIDIA, AMD, and Intel graphics cards to confirm your hardware is doing the heavy lifting.

Check Your FFmpeg Command

The quickest indicator that FFmpeg is attempting to use your GPU is the command you executed. Standard CPU encoding typically uses libx264 or libx265. If your command is leveraging the GPU, you should see specific hardware-accelerated codecs inside your command string:

While a correct command starts the process, you must use system monitoring tools to confirm the hardware is actually processing the load.

Monitor NVIDIA GPUs

If you are using an NVIDIA graphics card, the proprietary driver includes a powerful command-line utility called nvidia-smi.

Open a new terminal window while your FFmpeg command is running and execute:

nvidia-smi

Look at the output table under the Processes section at the bottom. If FFmpeg is successfully utilizing the GPU, you will see ffmpeg listed by name under the process list, alongside its dedicated VRAM usage. You can also monitor the GPU-Util percentage near the top to see the overall rendering and encoding load.

To watch this update in real-time every second, use:

watch -n 1 nvidia-smi

Monitor AMD and Intel GPUs

For AMD and Intel graphics, Linux offers open-source tools that display GPU engine utilization.

Using nvtop

Despite its name, nvtop (Neat Videocard Top) supports NVIDIA, AMD, and Intel GPUs. It provides a visual, interactive bar chart of your GPU usage in the terminal.

  1. Install it via your package manager (e.g., sudo apt install nvtop).
  2. Launch it by typing nvtop.
  3. Look at the process list at the bottom to verify ffmpeg is active, and check the command’s corresponding device utilization percentage.

Using intel-gpu-top (Intel Only)

If you are using Intel Quick Sync Video (QSV) or Intel graphics via VAAPI, you can use the dedicated Intel tool.

  1. Install the Intel GPU tools package (e.g., sudo apt install intel-gpu-tools).
  2. Run the monitoring tool with root privileges: sudo intel-gpu-top.
  3. Watch the Video/Enhance or Video bar. If FFmpeg is encoding on the GPU, this specific engine metric will spike well above 0%.

Verify via FFmpeg Console Output

When you launch your encoding string, closely read the initial text stream that FFmpeg outputs to the terminal.

If FFmpeg fails to initialize your GPU driver or lacks the proper environment variables, it will print an error message (such as Device creation failed or Driver not found) and either crash immediately or automatically fallback to software CPU encoding. If the stream continues to process frames smoothly without showing hardware initialization errors in the first few lines, your configuration is likely correct.