V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
soclearn
V2EX  ›  Windows

有没有带 GPU 加速的 windows in docker

  •  
  •   soclearn · 2022-10-01 00:49:00 +08:00 · 2458 次点击
    这是一个创建于 563 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    第 1 条附言  ·  2022-10-03 09:04:20 +08:00
    ==============

    换个说法,带 GPU 加速的 wine in docker 也行
    第 2 条附言  ·  2022-10-04 06:36:33 +08:00
    是不是 arm 机器或服务器的软解能力,本来就十分不错,基本到了堪用的地步。
    实测 orc arm 机器软解下居然可以流畅游戏。
    12 条回复    2022-10-08 12:03:21 +08:00
    bao3
        1
    bao3  
       2022-10-01 02:13:43 +08:00 via iPhone
    Docker container 是容器,不是虚拟机……
    fzinfz
        2
    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
        3
    soclearn  
    OP
       2022-10-01 03:26:18 +08:00
    @bao3 里面套个 qemu 没听过?
    bao3
        4
    bao3  
       2022-10-01 11:25:16 +08:00
    @minlearn 你都已经套 docker 套 qemu 了。。。。。
    flyqie
        5
    flyqie  
       2022-10-01 17:36:28 +08:00 via Android
    1. 没搞懂你在这说的 qemu 是什么意思。

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

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

    anbox ,另一种容器化的安卓。也是加增了图形 API 实现的效率,并配了一个 qemud 的效率层。目前不知道 redriod 和它相比,是不是存在某种技术上的关联
    soclearn
        7
    soclearn  
    OP
       2022-10-03 09:05:37 +08:00
    @fzinfz 这个文档的确是精确回答。但是希望在 linux 下整 win/wine
    soclearn
        8
    soclearn  
    OP
       2022-10-03 11:41:06 +08:00
    @bao3 你的回答简直没有任何建议作用。后面总带省略号这风格有点阴阳怪气
    bao3
        9
    bao3  
       2022-10-04 01:29:50 +08:00 via iPhone
    @minlearn 这种回复太正常了,省略和部分要是写了,没准人家回复得会更杠。所以网络太多元了,只能顺着你那个问号,我再加个省略号。你看,语气不就对上了。有没有建设性,全在你那个问号上。
    soclearn
        10
    soclearn  
    OP
       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
        11
    soclearn  
    OP
       2022-10-08 12:02:48 +08:00
    redriod 更接近云。更精简
    soclearn
        12
    soclearn  
    OP
       2022-10-08 12:03:21 +08:00
    而 anbox 效率高点,与桌面集成更拖沓
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5456 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 06:57 · PVG 14:57 · LAX 23:57 · JFK 02:57
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.