惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
小众软件
小众软件
博客园 - 叶小钗
宝玉的分享
宝玉的分享
博客园_首页
Hugging Face - Blog
Hugging Face - Blog
人人都是产品经理
人人都是产品经理
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
SegmentFault 最新的问题
B
Blog RSS Feed
Engineering at Meta
Engineering at Meta
N
Netflix TechBlog - Medium
Google DeepMind News
Google DeepMind News
U
Unit 42
F
Fortinet All Blogs
IT之家
IT之家
Y
Y Combinator Blog
Martin Fowler
Martin Fowler
T
The Blog of Author Tim Ferriss
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The GitHub Blog
The GitHub Blog
Stack Overflow Blog
Stack Overflow Blog
Blog — PlanetScale
Blog — PlanetScale
酷 壳 – CoolShell
酷 壳 – CoolShell

Arch Linux Forums

Avidemux crashes without strace / Applications & Desktop Environments how to apply patches with non-linux linends / Newbie Corner Replicating CachyOS on vanilla Arch (or at least getting close) / Arch Discussion What's arch linux GUI package manager ? / Newbie Corner Hibernation failing due to insufficient memory / System Administration profiledef.sh editting question / Installation trying to script kde plasma wallpaper settings / Programming & Scripting Looking for new Audacious package maintainer / Creating & Modifying Packages issues installing arch with LUKS2 encryption / Newbie Corner QEMU PXE booting does not work with OVMF.4m.fd / Applications & Desktop Environments Wired lan regular disconnect / Newbie Corner Need Help setting up ARCH in my G16 G634JZR iwlwifi started failing consistently, trying to determine root cause Windows randomly jumping between monitors after GNOME 50 update No display via DP or HDMI after boot. / Kernel & Hardware how to change acpi platform_profile? / Newbie Corner Linux denied all kernel modules which not loaded right now Use iPhone as Webcam for Arch Linux Video Output Failure on nvidia-580xx-dkms on TTY --> Desktop switch (Page 2) / Kernel & Hardware I was going to rant ..WINE32 Sabotage compliments of Arvind Krishna / Arch Discussion [SOLVED] LUKS drive auto unlocked by TPM when expected not to / Networking, Server, and Protection Hibernate/suspend from X = dark panel; from TTY = works (ASUS G14, hyb (Page 2) / Laptop Issues Headphone jack noise/buzz / Newbie Corner segmentation fault in cc1plus when building CLK / AUR Issues, Discussion & PKGBUILD Requests Console alternative to meld / GNU/Linux Discussion Problem with paru git clone / Newbie Corner XKB questions / Applications & Desktop Environments gnome-keyring-daemon is not working correctly / Applications & Desktop Environments [SOLVED] Steam opens and immediately closes constantly / Newbie Corner Firefox rounded edges on Sway / Applications & Desktop Environments
Hardware acceleration for R7 340 / Kernel & Hardware
V1del · 2026-06-26 · via Arch Linux Forums

#1 Today 12:00:52

Skilowi
Member
Registered: 2025-08-03
Posts: 24
Website

Hardware acceleration for R7 340

Howdy. I wanted to utilize second GPU for encoding for OBS. Here is my setup:
Arch Linux, OBS 32.1.2
MSI Pro B650-P Wifi
Ryzen 7 7500F
2x 16GB Kingston DDR5
GPU1: Nvidia RTX4060
GPU2: AMD R7 340

https://obsproject.com/logs/IIYI4lu71VcFqNYX

Not a single mention of second GPU. Only obs-browser saying "blacklisted driver detected".
I installed AMF (Legacy Driver) (since 300 series is GCN 1.0 and Fuji), the amf-amdgpu-pro as recommended by https://wiki.archlinux.org/title/Hardwa … on#AMD/ATI but even reboots didnt change a thing.
amdgpu_top reports 0% utilization.
Could it be that this OEM GPU is so chopped off features it cannot support hardware encoding?


Moron from Poland necromancing old ThinkPads and Computers.
I also learn Mechatronics.

#2 Today 12:13:28

Skilowi
Member
Registered: 2025-08-03
Posts: 24
Website

Re: Hardware acceleration for R7 340

Here you can enjoy some more info which might be usable:

skilowi@Komputer ~ > lspci -vnnd ::03xx
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation AD107 [GeForce RTX 4060] [10de:2882] (rev a1) (prog-if 00 [VGA controller])
    Subsystem: NVIDIA Corporation Device [10de:1801]
    Flags: bus master, fast devsel, latency 0, IRQ 91, IOMMU group 12
    Memory at f5000000 (32-bit, non-prefetchable) [size=16M]
    Memory at f800000000 (64-bit, prefetchable) [size=8G]
    Memory at fa00000000 (64-bit, prefetchable) [size=32M]
    I/O ports at f000 [size=128]
    Expansion ROM at f6000000 [virtual] [disabled] [size=512K]
    Capabilities: <access denied>
    Kernel driver in use: nvidia
    Kernel modules: nouveau, nvidia_drm, nvidia

05:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Oland [Radeon HD 8570 / R5 430 OEM / R7 240/340/430 / Radeon 520 OEM] [1002:6611] (rev 87) (prog-if 00 [VGA controller])
    Subsystem: PC Partner Limited / Sapphire Technology Device [174b:1352]
    Flags: bus master, fast devsel, latency 0, IRQ 109, IOMMU group 15
    Memory at fb00000000 (64-bit, prefetchable) [size=4G]
    Memory at f6700000 (64-bit, non-prefetchable) [size=256K]
    I/O ports at e000 [size=256]
    Expansion ROM at f6740000 [disabled] [size=128K]
    Capabilities: <access denied>
    Kernel driver in use: amdgpu
    Kernel modules: radeon, amdgpu

After amf-amdgpu-pro installation:

skilowi@Komputer ~ > VK_DRIVER_FILES=/usr/share/vulkan/icd.d/amd_pro_icd64.json ffmpeg -hwaccel auto -vaapi_device /dev/dri/renderD128 -i WK.webm -c:v h264_amf -rc 1 -b:v 8M h264_amf_8M.mp4
ffmpeg version n8.1.2 Copyright (c) 2000-2026 the FFmpeg developers
  built with gcc 16.1.1 (GCC) 20260430
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-frei0r --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-lcms2 --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libdvdnav --enable-libdvdread --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgsm --enable-libharfbuzz --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librsvg --enable-librubberband --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpl --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-vapoursynth --enable-version3 --enable-vulkan --disable-decoder=magicyuv
  libavutil      60. 26.102 / 60. 26.102
  libavcodec     62. 28.102 / 62. 28.102
  libavformat    62. 12.102 / 62. 12.102
  libavdevice    62.  3.102 / 62.  3.102
  libavfilter    11. 14.102 / 11. 14.102
  libswscale      9.  5.102 /  9.  5.102
  libswresample   6.  3.102 /  6.  3.102
Input #0, matroska,webm, from 'WK.webm':
  Metadata:
    COMPATIBLE_BRANDS: iso6av01mp41
    MAJOR_BRAND     : dash
    MINOR_VERSION   : 0
    ENCODER         : Lavf62.12.102
  Duration: 00:01:48.98, start: 0.000000, bitrate: 284 kb/s
  Stream #0:0: Video: av1 (libdav1d) (Main), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 1k tbn (default)
    Metadata:
      HANDLER_NAME    : ISO Media file produced by Google Inc.
      DURATION        : 00:01:48.966000000
  Stream #0:1(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
    Metadata:
      DURATION        : 00:01:48.981000000
Stream mapping:
  Stream #0:0 -> #0:0 (av1 (libdav1d) -> h264 (h264_amf))
  Stream #0:1 -> #0:1 (opus (native) -> aac (native))
Press [q] to stop, [?] for help
0126-05-26 14:11:09 789C06C0 [AMFDeviceVulkanImpl]   Error: ../../../../../runtime/src/core/DeviceVulkanImpl.cpp(854):Assertion failed:Init() failed to vkCreateInstance, Error=-9
0126-05-26 14:11:09 789C06C0 [AMFDeviceVulkanImpl]   Error: ../../../../../runtime/src/core/DeviceVulkanImpl.cpp(672):AMF_ERROR 1 : AMF_FAIL: CreateInstance() failed
0126-05-26 14:11:09 789C06C0 [AMFContextImpl]   Error: ../../../../../runtime/src/core/ContextImpl.cpp(1072):AMF_ERROR 1 : AMF_FAIL: pDeviceVulkan->Init(pVulkanDevice)
[AMF @ 0x7fc364005340] AMF failed to initialise on the given Vulkan device: 1.
[h264_amf @ 0x55d97384abc0] Failed to create  hardware device context (AMF) : Function not implemented
[vost#0:0/h264_amf @ 0x55d9738c9240] [enc:h264_amf @ 0x55d9738ec780] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
[vf#0:0 @ 0x55d9738d6440] Error sending frames to consumers: Function not implemented
[vf#0:0 @ 0x55d9738d6440] Task finished with error code: -38 (Function not implemented)
[vf#0:0 @ 0x55d9738d6440] Terminating thread with return code -38 (Function not implemented)
[vost#0:0/h264_amf @ 0x55d9738c9240] [enc:h264_amf @ 0x55d9738ec780] Could not open encoder before EOF
[vost#0:0/h264_amf @ 0x55d9738c9240] Task finished with error code: -22 (Invalid argument)
[vost#0:0/h264_amf @ 0x55d9738c9240] Terminating thread with return code -22 (Invalid argument)
[out#0/mp4 @ 0x55d97384d140] Nothing was written into output file, because at least one of its streams received no packets.
frame=    0 fps=0.0 q=0.0 Lsize=       0KiB time=N/A bitrate=N/A speed=N/A elapsed=0:00:00.04   
[aac @ 0x55d9738ca980] Qavg: 183.562
Conversion failed!

After I put new GPU in my BIOS cleared. Are there any settings which I should have set to make it work better?


Moron from Poland necromancing old ThinkPads and Computers.
I also learn Mechatronics.

#3 Today 12:43:04

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,137

Re: Hardware acceleration for R7 340

Hint: try higher listed options first.

VA-API on Radeon HD 2000 and newer GPUs via mesa.

The r7 340 is much newer then the HD 2000 .

remove the legacy amf-amdgpu-pro stuff and post the output of vainfo (comes with libva-utils) .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

#4 Today 13:12:39

Skilowi
Member
Registered: 2025-08-03
Posts: 24
Website

Re: Hardware acceleration for R7 340

I -Rns'ed the amf-amdgpu-pro.

skilowi@Komputer ~ > vainfo
Trying display: wayland
Trying display: x11
vainfo: VA-API version: 1.23 (libva 2.23.0)
vainfo: Driver version: VA-API NVDEC driver [direct backend]
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :    VAEntrypointVLD
      VAProfileMPEG2Main              :    VAEntrypointVLD
      VAProfileVC1Simple              :    VAEntrypointVLD
      VAProfileVC1Main                :    VAEntrypointVLD
      VAProfileVC1Advanced            :    VAEntrypointVLD
      VAProfileH264Main               :    VAEntrypointVLD
      VAProfileH264High               :    VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:    VAEntrypointVLD
      VAProfileJPEGBaseline           :    VAEntrypointVLD
      VAProfileHEVCMain               :    VAEntrypointVLD
      VAProfileVP8Version0_3          :    VAEntrypointVLD
      VAProfileVP9Profile0            :    VAEntrypointVLD
      VAProfileAV1Profile0            :    VAEntrypointVLD
      VAProfileHEVCMain10             :    VAEntrypointVLD
      VAProfileHEVCMain12             :    VAEntrypointVLD
      VAProfileVP9Profile2            :    VAEntrypointVLD
      VAProfileHEVCMain444            :    VAEntrypointVLD
      VAProfileHEVCMain444_10         :    VAEntrypointVLD
      VAProfileHEVCMain444_12         :    VAEntrypointVLD

I think it's showing for my RTX.
running vainfo -a returns ~40kB text file and I don't know what should I pass in --device flag to point it toward my R7.


Moron from Poland necromancing old ThinkPads and Computers.
I also learn Mechatronics.

#5 Today 14:17:23

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,253

Re: Hardware acceleration for R7 340

Please use [ code ] and not [ quote ] for outputs.

Did you export an environment variable forcing VAAPI to the nvidia driver?

https://wiki.archlinux.org/title/Hardwa … ing_VA-API