%3CLINGO-SUB%20id%3D%22lingo-sub-1526002%22%20slang%3D%22en-US%22%3EGPU%20compute%20within%20Windows%20Subsystem%20for%20Linux%202%20supports%20AI%20and%20ML%20workloads%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1526002%22%20slang%3D%22en-US%22%3E%3CH2%20id%3D%22toc-hId--1299923989%22%20id%3D%22toc-hId--1299923989%22%3EDirectML%3C%2FH2%3E%0A%3CP%3EDirectML%20is%20a%20high-performance%2C%20hardware-accelerated%20DirectX%2012%20library%20for%20machine%20learning.%20DirectML%20provides%20GPU%20acceleration%20for%20common%20machine%20learning%20tasks%20across%20a%20broad%20range%20of%20supported%20hardware%20and%20drivers%2C%20including%20all%20DirectX%2012-capable%20GPUs%20from%20vendors%20such%20as%20AMD%2C%20Intel%2C%20NVIDIA%2C%20and%20Qualcomm.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20preview%20of%20GPU%20compute%20is%20now%20available%20within%20WSL%202%20to%20Windows%20Insiders%20(Build%2020150%20or%20higher)!%20This%20preview%20will%20initially%20support%20artificial%20intelligence%20(AI)%20and%20machine%20learning%20(ML)%20workflows%2C%20enabling%20professionals%20and%20students%20alike%20to%20run%20ML%20training%20workloads%20across%20the%20breadth%20of%20GPUs%20in%20the%20Windows%20ecosystem.%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1187588844%22%20id%3D%22toc-hId-1187588844%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22DirectMLGPUWSL.gif%22%20style%3D%22width%3A%20800px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205759iDCF90AD1A604A760%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22DirectMLGPUWSL.gif%22%20alt%3D%22DirectMLGPUWSL.gif%22%20%2F%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3ENVIDIA%20CUDA%20support%3C%2FH2%3E%0A%3CP%3ENVIDIA%E2%80%99s%20CUDA%20as%20the%20optimized%20path%20for%20GPU%20hardware%20acceleration%20is%20typically%20utilised%20to%20enable%20data%20scientists%20to%20use%20hardware-acceleration%20in%20their%20training%20scripts%20on%20NVIDIA%20GPUs.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3ENVIDIA%20CUDA%20support%20has%20been%20present%20on%20Windows%20for%20years.%20However%2C%20there%20is%20a%20variety%20of%20CUDA%20compute%20applications%20that%20only%20run%20in%20a%20native%20Linux%20environment.%20However%20there%20is%20now%20CUDA%20inside%20WSL%202.%20There%20is%20a%26nbsp%3B%26nbsp%3Bpreview%20of%20CUDA%20for%20WSL%202.%20This%20preview%20includes%20support%20for%20existing%20ML%20tools%2C%20libraries%2C%20and%20popular%20frameworks%2C%20including%20PyTorch%20and%20TensorFlow.%20As%20well%20as%20all%20the%20Docker%20and%20NVIDIA%20Container%20Toolkit%20support%20available%20in%20a%20native%20Linux%20environment%2C%20allowing%20containerized%20GPU%20workloads%20built%20to%20run%20on%20Linux%20to%20run%20as-is%20inside%20WSL%202.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%3ESee%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fwin32%2Fdirect3d12%2Fgpu-accelerated-training%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fwin32%2Fdirect3d12%2Fgpu-accelerated-training%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--619865619%22%20id%3D%22toc-hId--619865619%22%3E%3CSPAN%20style%3D%22color%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E%3CBR%20%2F%3EEmpowering%20educators%20and%20students%20through%20DirectML%3C%2FSPAN%3E%3C%2FH2%3E%0A%3CP%3EThe%20DirectML%20API%20enables%20accelerated%20inference%20for%20machine%20learning%20models%20on%20any%20DirectX%2012%20based%20GPU%2C%20and%20we%20are%20extending%20its%20capabilities%20to%20support%20training.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20addition%2C%20we%20intend%20to%20integrate%20DirectML%20with%20popular%20machine%20learning%20tools%2C%20libraries%2C%20and%20frameworks%20so%20that%20they%20can%20automatically%20use%20it%20as%20a%20hardware-acceleration%20backend%20on%20Windows.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EDirectML%20works%20well%20in%20Windows%20or%20Windows%20Subsystem%20for%20Linux%20WSL.%20By%20doing%20so%2C%20our%20intent%20is%20to%20fully%20empower%20students%20to%20learn%20in%20the%20Windows%20or%20Linux%20environment%20that%20works%20for%20them%2C%20on%20the%20hardware%20they%20already%20have.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20more%20information%2C%20see%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E-ERR%3AREF-NOT-FOUND-Get%20Started%20with%20Windows%20ML.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fai%2Fwindows-ml%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EWindows%20Machine%20Learning%20Overview%20(docs.microsoft.com)%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FMicrosoft%2FWindows-Machine-Learning%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EWindows%20Machine%20Learning%20GitHub%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E-ERR%3AREF-NOT-FOUND-WinMLRunner%2C%20a%20tool%20for%20executing%20ONNX%20models%20using%20WinML%20with%20DirectML%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH2%20id%3D%22toc-hId-1867647214%22%20id%3D%22toc-hId-1867647214%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22toc-hId-60192751%22%20id%3D%22toc-hId-60192751%22%3EONNX%20Runtime%20on%20DirectML%3C%2FH2%3E%0A%3CP%3EONNX%20Runtime%20is%20a%20cross-platform%20inferencing%20and%20training%20accelerator%20compatible%20with%20many%20popular%20ML%2FDNN%20frameworks%2C%20including%20PyTorch%2C%20TensorFlow%2FKeras%2C%20scikit-learn%2C%20and%20more.%3C%2FP%3E%0A%3CP%3EDirectML%20is%20available%20as%20an%20optional%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CEM%3Eexecution%20provider%3C%2FEM%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Efor%20ONNX%20Runtime%20that%20provides%20hardware%20acceleration%20when%20running%20on%20Windows%2010.%3C%2FP%3E%0A%3CP%3EFor%20more%20information%20about%20getting%20started%2C%20see%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E-ERR%3AREF-NOT-FOUND-Using%20the%20DirectML%20execution%20provider.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Faka.ms%2Fonnxruntime%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EONNX%20Runtime%20homepage%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fonnxruntime%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EONNX%20Runtime%20GitHub%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fonnxruntime%2Fblob%2Fmaster%2Fdocs%2Fexecution_providers%2FDirectML-ExecutionProvider.md%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDirectML%20Execution%20Provider%20readme%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH2%20id%3D%22toc-hId--1747261712%22%20id%3D%22toc-hId--1747261712%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22toc-hId-740251121%22%20id%3D%22toc-hId-740251121%22%3ETensorflow%20with%20DirectML%3C%2FH2%3E%0A%3CP%3EWe%20have%20a%20preview%20package%20of%20TensorFlow%20with%20a%20DirectML%20backend.%20Students%20and%20beginners%20can%20start%20with%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E-ERR%3AREF-NOT-FOUND-TensorFlow%20tutorial%20models%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eor%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E-ERR%3AREF-NOT-FOUND-our%20examples%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eto%20start%20building%20the%20foundation%20for%20their%20future.%20In%20line%20with%20this%2C%20we%20are%20also%20engaging%20with%20the%20TensorFlow%20community%20through%20their%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E-ERR%3AREF-NOT-FOUND-RFC%26nbsp%3Bprocess.%20We%20plan%20to%20open%20source%20our%20extension%20of%20the%20TensorFlow%20code%20base%20that%20works%20with%20DirectML.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20WSL%20See%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fwin32%2Fdirect3d12%2Fgpu-tensorflow-wsl%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fwin32%2Fdirect3d12%2Fgpu-tensorflow-wsl%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20Windows%20See%26nbsp%3B-ERR%3AREF-NOT-FOUND-%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fwin32%2Fdirect3d12%2Fgpu-tensorflow-windows%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fwin32%2Fdirect3d12%2Fgpu-tensorflow-windows%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2FDirectML%2Fblob%2Fmaster%2FTensorFlow%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ETensorFlow%20on%20DirectML%20homepage%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fpypi.org%2Fproject%2Ftensorflow-directml%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Etensorflow-directml%20PyPI%20project%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Ftensorflow%2Fcommunity%2Fpull%2F243%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ETensorFlow%20GitHub%20%7C%20RFC%3A%20TensorFlow%20on%20DirectML%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fwww.tensorflow.org%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3ETensorFlow%20homepage%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH1%20id%3D%22toc-hId-729748017%22%20id%3D%22toc-hId-729748017%22%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2FDirectML%23tensorflow-with-directml-preview%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3EDirectML%20on%20GitHub%3C%2FA%3E%3C%2FH1%3E%0A%3CP%3EWhen%20used%20standalone%2C%20the%20DirectML%20API%20is%20a%20low-level%20DirectX%2012%20library%20and%20is%20suitable%20for%20high-performance%2C%20low-latency%20applications%20such%20as%20frameworks%2C%20games%2C%20and%20other%20real-time%20applications.%20The%20seamless%20interoperability%20of%20DirectML%20with%20Direct3D%2012%20as%20well%20as%20its%20low%20overhead%20and%20conformance%20across%20hardware%20makes%20DirectML%20ideal%20for%20accelerating%20machine%20learning%20when%20both%20high%20performance%20is%20desired%2C%20and%20the%20reliability%20and%20predictability%20of%20results%20across%20hardware%20is%20critical.%3C%2FP%3E%0A%3CP%3EMore%20information%20about%20DirectML%20can%20be%20found%20in%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E-ERR%3AREF-NOT-FOUND-Introduction%20to%20DirectML.%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId--1077706446%22%20id%3D%22toc-hId--1077706446%22%3EYour%20feedback%3C%2FH1%3E%0A%3CP%3EIf%20you%20have%20feedback%20on%20the%20NVIDIA%20CUDA%20path%20for%20WSL%2C%20please%20share%20it%20via%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E-ERR%3AREF-NOT-FOUND-Community%20Forum%20for%20CUDA%20on%20WSL.%20For%20feedback%20on%20the%20TensorFlow%20with%20DirectML%20package%2C%20please%20use%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E-ERR%3AREF-NOT-FOUND-DirectML%20GitHub%20repo.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--387144972%22%20id%3D%22toc-hId--387144972%22%3EGetting%20started%20using%20GPU%20with%20WSL%3C%2FH2%3E%0A%3CP%3EIn%20order%20to%20get%20your%20system%20setup%20please%20use%20our%3CSPAN%20style%3D%22color%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E-ERR%3AREF-NOT-FOUND-getting%20started%20documentation%3CSPAN%20style%3D%22color%3A%20inherit%3B%20font-family%3A%20inherit%3B%22%3E.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--520829696%22%20id%3D%22toc-hId--520829696%22%3EKeep%20upto%20date%20with%20announcement%20on%20WSL%3C%2FH2%3E%0A%3CP%20class%3D%22%22%3ETo%20stay%20in%20the%20loop%20on%20our%20latest%20news%20and%20future%20updates%2C%20stay%20tuned%20to%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E-ERR%3AREF-NOT-FOUND-Windows%20Command%20Line%20blog%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eand%20follow%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E-ERR%3AREF-NOT-FOUND-%40crahrig%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eon%20Twitter!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1526002%22%20slang%3D%22en-US%22%3E%3CP%3EAdding%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E-ERR%3AREF-NOT-FOUND-GPU%20compute%20support%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eto%20WSL%20has%20been%20our%20%231%20most%20requested%20feature%20since%20the%20first%20release.%20Over%20the%20last%20few%20years%2C%20the%20WSL%2C%20Virtualization%2C%20DirectX%2C%20Windows%20Driver%2C%20Windows%20AI%20teams%2C%20and%20our%20silicon%20partners%20have%20been%20working%20hard%20to%20deliver%20this%20capability.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1526002%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDirectML%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Efaculty%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EGPU%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Elearning%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ELinux%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Eml%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Eonnx%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Eteaching%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Etensorflow%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWindows%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWSL%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWSL2%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

DirectML

DirectML is a high-performance, hardware-accelerated DirectX 12 library for machine learning. DirectML provides GPU acceleration for common machine learning tasks across a broad range of supported hardware and drivers, including all DirectX 12-capable GPUs from vendors such as AMD, Intel, NVIDIA, and Qualcomm.

 

The preview of GPU compute is now available within WSL 2 to Windows Insiders (Build 20150 or higher)! This preview will initially support artificial intelligence (AI) and machine learning (ML) workflows, enabling professionals and students alike to run ML training workloads across the breadth of GPUs in the Windows ecosystem.

DirectMLGPUWSL.gif

NVIDIA CUDA support

NVIDIA’s CUDA as the optimized path for GPU hardware acceleration is typically utilised to enable data scientists to use hardware-acceleration in their training scripts on NVIDIA GPUs.


NVIDIA CUDA support has been present on Windows for years. However, there is a variety of CUDA compute applications that only run in a native Linux environment. However there is now CUDA inside WSL 2. There is a  preview of CUDA for WSL 2. This preview includes support for existing ML tools, libraries, and popular frameworks, including PyTorch and TensorFlow. As well as all the Docker and NVIDIA Container Toolkit support available in a native Linux environment, allowing containerized GPU workloads built to run on Linux to run as-is inside WSL 2.

See https://docs.microsoft.com/en-us/windows/win32/direct3d12/gpu-accelerated-training 


Empowering educators and students through DirectML

The DirectML API enables accelerated inference for machine learning models on any DirectX 12 based GPU, and we are extending its capabilities to support training.

 

In addition, we intend to integrate DirectML with popular machine learning tools, libraries, and frameworks so that they can automatically use it as a hardware-acceleration backend on Windows.

 

DirectML works well in Windows or Windows Subsystem for Linux WSL. By doing so, our intent is to fully empower students to learn in the Windows or Linux environment that works for them, on the hardware they already have.

 

For more information, see Get Started with Windows ML.

 

ONNX Runtime on DirectML

ONNX Runtime is a cross-platform inferencing and training accelerator compatible with many popular ML/DNN frameworks, including PyTorch, TensorFlow/Keras, scikit-learn, and more.

DirectML is available as an optional execution provider for ONNX Runtime that provides hardware acceleration when running on Windows 10.

For more information about getting started, see Using the DirectML execution provider.

 

Tensorflow with DirectML

We have a preview package of TensorFlow with a DirectML backend. Students and beginners can start with the TensorFlow tutorial models or our examples to start building the foundation for their future. In line with this, we are also engaging with the TensorFlow community through their RFC process. We plan to open source our extension of the TensorFlow code base that works with DirectML.

 

For WSL See https://docs.microsoft.com/en-us/windows/win32/direct3d12/gpu-tensorflow-wsl 

For Windows See https://docs.microsoft.com/en-us/windows/win32/direct3d12/gpu-tensorflow-windows

 

DirectML on GitHub

When used standalone, the DirectML API is a low-level DirectX 12 library and is suitable for high-performance, low-latency applications such as frameworks, games, and other real-time applications. The seamless interoperability of DirectML with Direct3D 12 as well as its low overhead and conformance across hardware makes DirectML ideal for accelerating machine learning when both high performance is desired, and the reliability and predictability of results across hardware is critical.

More information about DirectML can be found in Introduction to DirectML.

Your feedback

If you have feedback on the NVIDIA CUDA path for WSL, please share it via the Community Forum for CUDA on WSL. For feedback on the TensorFlow with DirectML package, please use the DirectML GitHub repo.

 

Getting started using GPU with WSL

In order to get your system setup please use our getting started documentation.

 

Keep upto date with announcement on WSL

To stay in the loop on our latest news and future updates, stay tuned to the Windows Command Line blog and follow @crahrig on Twitter!