[SOLVED] LXC no permission to use VAAPI

luciferlu

Active Member
Apr 22, 2019
26
2
43
44
The LXC can no longer be access to the VAAPI When I change my PVE to use gvt-g. But the host works.
on host vainfo outputs
Code:
error: can't connect to X server!
libva info: VA-API version 1.10.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_10
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.10 (libva 2.10.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 21.1.1 ()
vainfo: Supported profile and entrypoints
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileNone                   : VAEntrypointStats
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointFEI
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointFEI
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointFEI
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileVP8Version0_3          : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointFEI
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD

on LXC vainfo outputs
Code:
root@jellyfin-test:/dev# vainfo
error: can't connect to X server!
error: failed to initialize display

and strace vainfo

Code:
…………
rt_sigaction(SIGRTMIN, {sa_handler=0x7f56495ac6b0, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x7f56495b8730}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x7f56495ac740, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f56495b8730}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
brk(NULL)                               = 0x556a33bba000
brk(0x556a33bdb000)                     = 0x556a33bdb000
socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0) = 4
connect(4, {sa_family=AF_UNIX, sun_path="/run/user/0/wayland-0"}, 24) = -1 ENOENT (No such file or directory)
close(4)                                = 0
write(2, "error: can't connect to X server"..., 34error: can't connect to X server!
) = 34
openat(AT_FDCWD, "/dev/dri/renderD128", O_RDWR) = -1 EPERM (Operation not permitted)
openat(AT_FDCWD, "/dev/dri/card0", O_RDWR) = -1 EPERM (Operation not permitted)
write(2, "error: failed to initialize disp"..., 35error: failed to initialize display) = 35
write(2, "\n", 1
)                       = 1
exit_group(1)                           = ?
+++ exited with 1 +++


Code:
root@jellyfin-test:/dev# ls -l /dev/dri
total 0
drwxr-xr-x 2 root root           80 Jun 27 15:10 by-path
crw-rw---- 1 root video    226,   0 Jun 28 00:40 card0
crw-rw-rw- 1 root postdrop 226, 128 Jun 27 15:10 renderD128

gvt-g cannot be applied to the LXC container. What's my problem? I use gvt-g in a Win10 VM. It works perfect.But in LXC I can not use UHD630 any more.
 
Last edited:
I am having this exact problem after upgrading the host to Proxmox VE 7.

My LXC is running Ubuntu 20.04 with Emby.

The container has the following devices:

crwxrwxrwx 1 root video 226, 0 Jul 13 21:35 card0
crwxrwxrwx 1 root render 226, 128 Jul 13 21:35 renderD128

but Emby is unable to access them. It reports "Failed to open the drm device /dev/dri/renderD128"
 
please include your full container config..
 
Container config is as follows:

Code:
arch: amd64
cores: 4
hostname: emby1
memory: 4096
mp0: /store0/Media,mp=/media/store0/Media
net0: name=eth0,bridge=vmbr0,gw=10.69.1.254,hwaddr=A6:3D:6B:A5:7C:54,ip=10.69.1.24/24,type=veth
onboot: 1
ostype: ubuntu
rootfs: lvm-nvme0:vm-125-disk-0,size=32G
swap: 512
lxc.cgroup.devices.allow: c 226:0 rwm
lxc.cgroup.devices.allow: c 226:128 rwm
lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file
lxc.mount.entry: /dev/dri/card0 dev/dri/card0 none bind,optional,create=file
 
Code:
you need to switch your 'lxc.cgroup' lines to 'lxc.cgroup2' if your system uses cgroupv2 - see the upgrade docs..

Yes!
Thank you !
I can cancel my plan to add a Nvidia card although I have succeed in unlock vgpu on it.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!