Closed eqfae closed 2 months ago
Mpv vaapi support works fine for me. Did you install the drivers? See https://wiki.nixos.org/wiki/Accelerated_Video_Playback.
You can also use https://github.com/NixOS/nixos-hardware if you want to simplify your hardware config. The intel-based profiles will automatically install vaapi drivers.
Mpv vaapi support works fine for me. Did you install the drivers? See https://wiki.nixos.org/wiki/Accelerated_Video_Playback.
You can also use https://github.com/NixOS/nixos-hardware if you want to simplify your hardware config. The intel-based profiles will automatically install vaapi drivers.
{ pkgs, ... }:
{
# nixpkgs.config.packageOverrides = pkgs: {
# intel-vaapi-driver = pkgs.intel-vaapi-driver.override { enableHybridCodec = true; };
# };
# https://nixos.wiki/wiki/AMD_GPU
# https://github.com/NixOS/nixos-hardware/blob/master/common/gpu/amd/default.nix
services.xserver.enable = true;
services.xserver.videoDrivers = [ "modesetting" ];
hardware.amdgpu.initrd.enable = true;
# Enable OpenGL
hardware.graphics = {
enable = true;
enable32Bit = true;
extraPackages = with pkgs; [
mesa
];
extraPackages32 = with pkgs.pkgsi686Linux; [
mesa
];
};
}
...
packages = with pkgs; [
mpv
firefox-esr
#lx-music-desktop
#vscode
#lutris
#wineWowPackages.staging
#winetricks
#proton-ge-bin
#protontricks
_64gram
#obsidian
#obs-studio
];
vo=gpu
gpu-api=d3d11
hwdec=vaapi
gpu-context=wayland
or
gpu-context=wayland
or
vo=gpu
# gpu-api=d3d11
# hwdec=vaapi
gpu-context=wayland
Playing with sound but no video
In win vk mode I can only use -copy as well, although I haven't tried it in a long time, but to run on non-copy you should need to "gpu-context=wayland" work
gpu-context=x11vk gpu-context=x11 The former remains -copy and the latter falls back to waylandvk.
Mpv vaapi support works fine for me. Did you install the drivers? See https://wiki.nixos.org/wiki/Accelerated_Video_Playback.
You can also use https://github.com/NixOS/nixos-hardware if you want to simplify your hardware config. The intel-based profiles will automatically install vaapi drivers.
trace: evaluation warning: The option `hardware.opengl.enable' defined in `/nix/store/r26x43qclvxcgsgbx9pc8gy0pw3bmhjc-source/opengl.nix' has been renamed to `hardware.graphics.enable'.
trace: evaluation warning: i18n.inputMethod.enabled will be removed in a future release. Please use .type, and .enable = true instead
[ 0.427][v][vo/gpu-next] Loading hwdec drivers for format: 'vaapi'
[ 0.427][v][vo/gpu-next] Loading hwdec driver 'vaapi'
[ 0.427][v][vo/gpu-next/vaapi] libplacebo dmabuf interop requires support for PL_HANDLE_DMA_BUF import.
[ 0.427][v][vo/gpu-next/vaapi] VAAPI hwdec only works with OpenGL or Vulkan backends.
[ 0.427][v][vo/gpu-next] Loading failed.
[ 0.427][v][vd] Could not create device.
[ 0.427][v][vd] Looking at hwdec hevc-nvdec-copy...
[ 0.427][e][ffmpeg] AVHWDeviceContext: Cannot load libcuda.so.1
[ 0.427][e][ffmpeg] AVHWDeviceContext: Could not dynamically load CUDA
[ 0.427][v][vd] Could not create device.
[ 0.427][v][vd] Looking at hwdec hevc-vaapi-copy...
[ 0.427][v][vaapi] libva: VA-API version 1.22.0
[ 0.427][v][vaapi] libva: Trying to open /run/opengl-driver/lib/dri/radeonsi_drv_video.so
[ 0.430][v][vaapi] libva: Found init function __vaDriverInit_1_22
[ 0.442][v][vaapi] libva: va_openDriver() returns 0
[ 0.442][v][vaapi] Initialized VAAPI: version 1.22
[ 0.442][d][ffmpeg] AVHWDeviceContext: VAAPI driver: Mesa Gallium driver 24.1.4 for AMD Radeon RX 580 Series (radeonsi, polaris10, LLVM 18.1.8, DRM 3.54, 6.6.43).
[ 0.442][d][ffmpeg] AVHWDeviceContext: Driver not found in known nonstandard list, using standard behaviour.
[ 0.442][v][vd] Trying hardware decoding via hevc-vaapi-copy.
[ 0.446][v][vd] Selected codec: HEVC (High Efficiency Video Coding)
[ 0.434][v][vo/gpu-next/cuda] Failed to load CUDA symbols
[ 0.434][v][vo/gpu-next] Loading failed.
[ 0.434][v][vd] Could not create device.
[ 0.434][v][vd] Looking at hwdec hevc-vaapi...
[ 0.434][v][vo/gpu-next] Loading hwdec drivers for format: 'vaapi'
[ 0.434][v][vo/gpu-next] Loading hwdec driver 'vaapi'
[ 0.434][v][vo/gpu-next/vaapi] libplacebo dmabuf interop requires support for PL_HANDLE_DMA_BUF import.
[ 0.434][v][vo/gpu-next/vaapi] VAAPI hwdec only works with OpenGL or Vulkan backends.
[ 0.434][v][vo/gpu-next] Loading failed.
[ 0.434][v][vd] Could not create device.
[ 0.434][v][vd] Looking at hwdec hevc-nvdec-copy...
[ 0.434][e][ffmpeg] AVHWDeviceContext: Cannot load libcuda.so.1
[ 0.434][e][ffmpeg] AVHWDeviceContext: Could not dynamically load CUDA
[ 0.434][v][vd] Could not create device.
[ 0.434][v][vd] Looking at hwdec hevc-vaapi-copy...
[ 0.435][v][vaapi] libva: VA-API version 1.22.0
[ 0.435][v][vaapi] libva: Trying to open /run/opengl-driver/lib/dri/radeonsi_drv_video.so
[ 0.437][v][vaapi] libva: Found init function __vaDriverInit_1_22
[ 0.450][v][vaapi] libva: va_openDriver() returns 0
[ 0.450][v][vaapi] Initialized VAAPI: version 1.22
[ 0.450][d][ffmpeg] AVHWDeviceContext: VAAPI driver: Mesa Gallium driver 24.1.4 for AMD Radeon RX 580 Series (radeonsi, polaris10, LLVM 18.1.8, DRM 3.54, 6.6.43).
[ 0.450][d][ffmpeg] AVHWDeviceContext: Driver not found in known nonstandard list, using standard behaviour.
[ 0.450][v][vd] Trying hardware decoding via hevc-vaapi-copy.
services.xserver.enable = true;
services.xserver.videoDrivers = [ "modesetting" ];
hardware.amdgpu.initrd.enable = true;
# https://github.com/NixOS/nixpkgs/issues/221535#issuecomment-1473815585
environment.variables = {
# VAAPI and VDPAU config for accelerated video.
# See https://wiki.archlinux.org/index.php/Hardware_video_acceleration
"VDPAU_DRIVER" = "radeonsi";
"LIBVA_DRIVER_NAME" = "radeonsi";
};
# amd显卡驱动 驱动可能默认配置了 无需手动
# Enable OpenGL
# hardware.graphics = {
# enable = true;
# enable32Bit = true;
# extraPackages = with pkgs; [
# mesa
#];
# extraPackages32 = with pkgs.pkgsi686Linux; [
# mesa
#];
#};
The graphics driver seems to be the best configuration by default so I deleted a little bit These listed configurations can be deleted? But it's already working, so I'm not testing it anymore.
❯ nix-shell -p libva-utils --run vainfo
Trying display: wayland
libva info: VA-API version 1.22.0
libva info: User environment variable requested driver 'radeonsi'
libva info: Trying to open /run/opengl-driver/lib/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_22
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: Mesa Gallium driver 24.1.4 for AMD Radeon RX 580 Series (radeonsi, polaris10, LLVM 18.1.8, DRM 3.54, 6.6.43)
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileHEVCMain : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointEncSlice
VAProfileHEVCMain10 : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
Describe the bug
A clear and concise description of what the bug is. 不能使用vaapi 只能vaapi-copy
Steps To Reproduce
Steps to reproduce the behavior:
Setting hwdec=vaapi in mpv.conf will
Poor -copy performance Loses frames in high bitrate videos.
mpv.conf
Expected behavior
Play using vaapi
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
I have used alpine mpv's, they are vaapi and the context is shown as wayland instead of waylandvk
Notify maintainers
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Add a :+1: reaction to issues you find important.