BUILD 2020: Direct3D12 and DirectML are coming to Linux

Discussion in 'Rendering Technology and APIs' started by Ike Turner, May 19, 2020.

  1. Ike Turner

    Veteran Regular

    Joined:
    Jul 30, 2005
    Messages:
    2,105
    Likes Received:
    2,290
    Welp...
    https://devblogs.microsoft.com/directx/directx-heart-linux/

    Earlier this year Microsoft also announced OpenCL & OpenGL for DirectX12

    https://www.collabora.com/news-and-...introducing-opencl-and-opengl-on-directx.html

    Microsoft is also porting TensorFlow to DirectML for WSL & Windows (!)

    https://devblogs.microsoft.com/comm...m-for-linux-build-2020-summary/?sf234145990=1

    What a time to be alive...
     
    #1 Ike Turner, May 19, 2020
    Last edited: May 20, 2020
  2. Kaotik

    Kaotik Drunk Member
    Legend

    Joined:
    Apr 16, 2003
    Messages:
    9,789
    Likes Received:
    3,958
    Location:
    Finland
    But only for Windows Subsystem for Linux, it still relies on Windows being there too.
     
    Alessio1989 and BRiT like this.
  3. Ike Turner

    Veteran Regular

    Joined:
    Jul 30, 2005
    Messages:
    2,105
    Likes Received:
    2,290
    Well that's still better than nothing.
    The OpenCL & OpenGL port to DX12 is interesting as it will finally allow Windows ARM devices to run OGL & OCL apps.
     
  4. DmitryKo

    Regular

    Joined:
    Feb 26, 2002
    Messages:
    881
    Likes Received:
    1,022
    Location:
    55°38′33″ N, 37°28′37″ E
    Well, not native Linux, rather custom Linux Kernel in Windows Subsystem for Linux 2.0 (WSL2).

    This will require Windows Insider Preview 21H1 Iron with WDDM 2.9 drivers which will come packaged with Linux user-mode binaries and kernel drivers for WSL2 to support DXCore (Linux version of DXGI), Direct3D 12, DirectML, as well as OpenGL, OpenCL and Vulkan (using Mesa3D mapping layers), and NVIDIA CUDA libraries.

    https://devblogs.microsoft.com/directx/directx-heart-linux/

    [​IMG]



    By design, the Linux kernel driver (dxgkrnl) simply redirects all calls from the user-mode runtime/driver to the WDDM Kernel Mode driver (DXGK) using HyperV interfaces - that said, I suppose it's only a matter of time before libd3d12 and libdirectml end up in native Linux and dxg thunk interfaces are implemented by propritetary Linux Kernel drivers from AMD and NVIDIA, and this could help support other Microsoft frameworks on Linux, like WPF and Direct2D/DirectWrite which are all based on Direct3D...

    https://www.phoronix.com/scan.php?page=news_item&px=Microsoft-DX12-WSL2
    https://www.phoronix.com/scan.php?page=news_item&px=Microsoft-DXGKRNL-Uphill-Battle
    https://www.phoronix.com/scan.php?page=news_item&px=Microsoft-Writing-Wayland-Comp
     
    #4 DmitryKo, May 19, 2020
    Last edited: May 21, 2020
    Alessio1989 and pharma like this.
  5. Lurkmass

    Regular Newcomer

    Joined:
    Mar 3, 2020
    Messages:
    306
    Likes Received:
    345
    Interesting ...

    Does DirectML backend for Tensorflow have all the same features as the CUDA/ROCm backend including XLA compiler support or is it limited to Tensorflow Lite which only does inferencing as far as I know ?
     
  6. DmitryKo

    Regular

    Joined:
    Feb 26, 2002
    Messages:
    881
    Likes Received:
    1,022
    Location:
    55°38′33″ N, 37°28′37″ E
    Ike Turner likes this.
  7. Ike Turner

    Veteran Regular

    Joined:
    Jul 30, 2005
    Messages:
    2,105
    Likes Received:
    2,290
    The merge proposal:

    Objective
    Implement a new TensorFlow device type and a new set of kernels based on DirectML, a hardware-accelerated machine learning library on the DirectX 12 Compute platform. This change broadens the reach of TensorFlow beyond its existing GPU footprint and enables high-performance training and inferencing on Windows devices with any DirectX12-capable GPU.

    Motivation
    TensorFlow training and inferencing on the GPU have so far been limited to Nvidia CUDA and AMD ROCm platform, with limited availability on ROCm only on Linux. Bringing the full machine learning training capability to Windows on any GPU has been one of the most requested features from the Windows developer community in our recent survey. By implementing a new set of TensorFlow kernels based on DirectML, Windows developers, professionals, and enthusiasts will be able to realize the full breadth of TensorFlow functionality on the vast hardware ecosystem of Windows devices, significantly expanding TensorFlow's availability on both the edge and the cloud.

    User Benefit
    1. Users will be able to use TensorFlow on any DirectX12-capable GPU on any Windows device.
    2. It works right out of the box. DirectML is an operating system component that works with any GPU on the device. The users do not need to go through the process of finding the right combination of CUDA/cuDNN runtime dependencies and graphics driver that works with a version of TensorFlow.
    3. The size of our current TensorFlow-DirectML packages is roughly 20% of the current TensorFlow-GPU 1.15 package size of the comparable build. We expect our package size to double at launch, which will still be no bigger than half the current size. The smaller package size simplifies the requirements for the containers and other deployment mechanisms.
    4. DirectML starts up considerably faster than the CUDA runtime. This improves the developer's experience in the model development process.
     
    BRiT likes this.
  8. pharma

    Veteran Regular

    Joined:
    Mar 29, 2004
    Messages:
    4,204
    Likes Received:
    3,388
    From the proposal some exceptions are no XLA complier and no dependencies using CUDA/ROC specific kernels.

     
  9. DmitryKo

    Regular

    Joined:
    Feb 26, 2002
    Messages:
    881
    Likes Received:
    1,022
    Location:
    55°38′33″ N, 37°28′37″ E
    It looks like an implementation of Direct3D on native Linux (if there is one) would have to use DRI/DRM interfaces directly - not dxg/dxgkernel which is just a redirector to familiar WDDM DDIs.
    And if Microsoft is not open-sourcing its libd3d12 implementation, kernel developers are unlikely to accept the required DDI changes.
    https://www.phoronix.com/scan.php?page=news_item&px=Microsoft-Writing-Wayland-Comp


    Maybe they could refactor their upcoming Vulkan to Direct3D 12 translation layer for Mesa 3D/Gallium to work the other way round and provide Direct3D 12 on top of Vulkan?
    https://www.collabora.com/news-and-...introducing-opencl-and-opengl-on-directx.html

    There's also the VKD3D project which implements a subset of Direct3D 12 on top of Vulkan.
     
    #9 DmitryKo, May 21, 2020
    Last edited: Dec 18, 2020
    BRiT likes this.
  10. Alessio1989

    Regular Newcomer

    Joined:
    Jun 6, 2015
    Messages:
    605
    Likes Received:
    320
    It's coming to WSL(2), not to Linux.
    This, only the kernel mode driver of a subset of DXGK is open source and probably it's meant to better handling the different distros running on WSL. Everything else is closed. OpenGL is limited to 3.3 version AFIK since they will using their translation layer initially developed for the crappy Qualcomm drivers as well for OpenCL 1.2 (another dead API). Everything then is passed to WDDM with a hardware virtualization interface, no x.org/wayland/mir clusterfuck involved.. CUDA support will run with an updated proprietary driver for WSL (so Windows)... What about AMD ROCm&co? Who knows, probably neither AMD since they do not have a clear strategy on GPGPU..

    This move is to attract more Linux developers on Windows and WSL and possibly Azure. This move is not to favour gaming on Linux.
     
    #10 Alessio1989, May 21, 2020
    Last edited: May 21, 2020
  11. Ike Turner

    Veteran Regular

    Joined:
    Jul 30, 2005
    Messages:
    2,105
    Likes Received:
    2,290
    Nobody ever thought or expected it to be about gaming.
    All these projects are about facilitating Linux development on Windows, bringing OpenGL/CL support to Windows ARM devices (whether both those APIs are "dead" is off-topic as this is meant to support legacy apps/soft that will never have been updated/ported to run on ARM) & finally bringing TensorFlow to 100s Millions of devices (as of right now it Linux & CUDA/ROCm only & an exceptional pain to get up & running).
     
  12. Alessio1989

    Regular Newcomer

    Joined:
    Jun 6, 2015
    Messages:
    605
    Likes Received:
    320
    I know! ..But I read into too much websites the opposite. So better repeat that like a mantra.
     
    Ike Turner likes this.
  13. Lurkmass

    Regular Newcomer

    Joined:
    Mar 3, 2020
    Messages:
    306
    Likes Received:
    345
    ROCm won't work with this model. CUDA on WSL2 uses the WDDM kernel driver which is already the case with Windows itself. ROCm needs AMDKFD (kernel fusion driver). If WSL3 does come to fruition then it must allow custom kernel drivers if it's desired that ROCm should work on Windows in some form ...

    As a sidenote not having the XLA compiler supported with DirectML might be a deal breaker for some but then there are other advanced features that CUDA/ROCm supports like cuDNN/MIOpen and NCCL/RCCL of which I'm not even sure there's even an equivalent for DirectML ...
     
  14. DmitryKo

    Regular

    Joined:
    Feb 26, 2002
    Messages:
    881
    Likes Received:
    1,022
    Location:
    55°38′33″ N, 37°28′37″ E
  15. ethernity

    Newcomer

    Joined:
    May 1, 2018
    Messages:
    88
    Likes Received:
    207
    ROCm will use PAL on Windows according to @bridgman
     
  16. DmitryKo

    Regular

    Joined:
    Feb 26, 2002
    Messages:
    881
    Likes Received:
    1,022
    Location:
    55°38′33″ N, 37°28′37″ E
Loading...

Share This Page

  • About Us

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...