我在Ubuntu16.0.4LTS上运行了一个特权lxc
容器。
我注意到,与直接在主机上运行相比,我们游戏的图形在容器中非常缓慢。
有人能指出什么是原因吗?
因此,我在容器中运行了glxgears
应用程序。虽然应用程序运行良好,但我在控制台上看到了以下信息+错误:
libGL error: failed to open drm device: Permission denied
libGL error: failed to load driver: nouveau
4057 frames in 5.0 seconds = 811.356 FPS
4238 frames in 5.0 seconds = 847.557 FPS
4251 frames in 5.0 seconds = 850.081 FPS
4254 frames in 5.0 seconds = 850.743 FPS
4253 frames in 5.0 seconds = 850.431 FPS
4255 frames in 5.0 seconds = 850.949 FPS
4253 frames in 5.0 seconds = 850.450 FPS
4254 frames in 5.0 seconds = 850.733 FPS
4250 frames in 5.0 seconds = 849.960 FPS
4247 frames in 5.0 seconds = 849.254 FPS
4246 frames in 5.0 seconds = 849.129 FPS
发布于 2016-09-22 15:01:25
我修好了。首先,我们必须确保lxc
容器中的用户属于video
组。为此,请执行以下操作:(假设用户名为ubuntu
)
sudo usermod -a -G video ubuntu
然后,在容器配置文件(即/var/lib/lxc/mk7i_container/config
)中添加以下内容。我的容器名是mk7i_container
。
#Video DRI
lxc.cgroup.devices.allow = c 226:* rwm
##/dev/dri mounts
lxc.mount.entry = /dev/dri dev/dri none bind,optional,create=dir
现在,重新启动容器。图形应该工作得很好。
https://askubuntu.com/questions/828434
复制