有没有带 GPU 加速的 windows in docker

2022-10-01 00:49:00 +08:00
 soclearn

目前已知道的是 redriod:andriod in docker ,可以带软解,效率还不错,

2472 次点击
所在节点    Windows
12 条回复
bao3
2022-10-01 02:13:43 +08:00
Docker container 是容器,不是虚拟机……
fzinfz
2022-10-01 03:13:48 +08:00
https://learn.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/gpu-acceleration

DirectX (and all the frameworks built on top of it) are the only APIs that can be accelerated with a GPU today. 3rd party frameworks are not supported.
soclearn
2022-10-01 03:26:18 +08:00
@bao3 里面套个 qemu 没听过?
bao3
2022-10-01 11:25:16 +08:00
@minlearn 你都已经套 docker 套 qemu 了。。。。。
flyqie
2022-10-01 17:36:28 +08:00
1. 没搞懂你在这说的 qemu 是什么意思。

2. windows 容器只能在 windows 下部署,不支持 linux ,而且相对于正常版本 windows 做了很多阉割(这种阉割基本无法补齐,只能靠微软)。

3. redroid 是直接改 android 源码并且加 hal 来编译了一个 android rootfs 做的,并不是靠的 qemu ,linux 下用 docker 跑 windows 目前看来大概率只能靠 qemu(with/without kvm),这样所造成的性能损失还是挺大的,个人认为意义有(保持了 host 环境的干净),但是不大(都这样了其实还不如直接在 host 跑,环境污染也不太至于)。
soclearn
2022-10-03 08:18:12 +08:00
@flyqie 我直觉感觉 redriod 对 andriod 的改动并不大。虽然我没看代码也看不懂。或许现今的软解技术真的达到了可用的地步( vulkan 这种运行时有了很大的优化,没有 gpu 加速也能获得相当不错的效率)。比如,可以用于云游戏。

anbox ,另一种容器化的安卓。也是加增了图形 API 实现的效率,并配了一个 qemud 的效率层。目前不知道 redriod 和它相比,是不是存在某种技术上的关联
soclearn
2022-10-03 09:05:37 +08:00
@fzinfz 这个文档的确是精确回答。但是希望在 linux 下整 win/wine
soclearn
2022-10-03 11:41:06 +08:00
@bao3 你的回答简直没有任何建议作用。后面总带省略号这风格有点阴阳怪气
bao3
2022-10-04 01:29:50 +08:00
@minlearn 这种回复太正常了,省略和部分要是写了,没准人家回复得会更杠。所以网络太多元了,只能顺着你那个问号,我再加个省略号。你看,语气不就对上了。有没有建设性,全在你那个问号上。
soclearn
2022-10-08 11:57:39 +08:00
事实证明我猜的有 8 分对:
```
It's just a parameter to let the Android OS know that it's running in an emulated environment as opposed to running natively on a physical device.
For example, the GPU stack has to be somehow emulated using a custom OpenGL driver (in this case `mesa3d`). There's software emulation (swiftshader) and host GPU mode (GLES).
For performance reasons when using the host GPU, the GLES commands from the guest have to be serialized and sent over a kernel pipe to the QEMU and to the host OS. The commands are deserialized on the host and executed on the physical host GPU through the Shader Translator library (taken from the Google ANGLE project). The Google's QEMU fork (aka Android Emulator) usually loads this library and then takes care of proper rendering, such that users can see the rendering output of the emulated OS properly inside the emulator window on the host machine. You can do the same for the docker, otherwise you'd have to implement some other trick to share the GPU. virtio-gpu is a Linux kernel facility that is meant to replace QEMU pipe in the future.
The high-level details of this OpenGL emulation mechanism are described here: https://android.googlesource.com/platform/external/qemu/+/ma...
You can find the implementation of the QEMU OpenGL pipe mechanism here: https://cs.android.com/android/platform/superproject/+/maste...
```
软解效率高是源于这一个项目:ANGLE (全称 Almost Native Graphics Layer Engine),
redriod 和 anbox 果然是同一路线的,,,啥都一样。只是一个 lxc 一个 docker 的区别而已,anbox 有桌面集成直接处理相关的部分,而 redriod 更偏向命令行 adb 呈现服务
soclearn
2022-10-08 12:02:48 +08:00
redriod 更接近云。更精简
soclearn
2022-10-08 12:03:21 +08:00
而 anbox 效率高点,与桌面集成更拖沓

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/884140

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX