15 ms·
GPU Video acceleration in the Windows Subsystem for Linux now available
- shmerl 4y agoI'd prefer MS to stop pushing DX12 NIH for a change and start using Vulkan.
- pkulak 4y agoVkd3d is only going to get better, and it's pretty darn good right now. I'm okay with Microsoft just sticking with D3D12 for a very long time. I use it to play lots of games on Linux. :D
- shmerl 4y agoThat helps to break the lock-in for sure, but it took a huge amount of effort to make this work around and it will continue to be costly. Good thing Valve are footing the bill for it, but it will always need to play catch up.
- Femtiono 4y agoYou are aware of the history of DX right? Their SDK is old and really good. Just because Vulkan exist doesn't mean DX is invalid. Good to have more than one thing. Innovation and stuff
- kevingadd 4y agoArguably without the OpenGL vs D3D and now Vulkan vs D3D back and forths, along with experimental APIs like MANTLE, we definitely wouldn't have a lot of the robust tech we have access to today. OpenGL's freeform experimentation and evolution with extensions let people test things out in production environments to figure out what worked, while D3D's stable feature set meant that games and productivity software could - if it made sense for the developer - choose to ship a more limited feature set that worked everywhere, all of the time. D3D also has consistently offered great debugging tools and a robust reference rasterizer, things you simply can't get in an OpenGL environment. As a game developer it's invaluable to be able to swap over to a Direct3D backend for debugging even if you end up using OpenGL as your default. (These days, Vulkan has first-class debugging support too, which is great.) Now we have Vulkan as the new home for experimentation and it has great debugging and validation layers, while D3D pushes forward on certain new features and provides a more consistent baseline on Windows desktops. For console games as well, you can use Vulkan on (AFAIK) Nintendo Switch, while using D3D12 on Xbox, so each API is providing value for console game devs as well.
- bitwize 4y ago> OpenGL's freeform experimentation and evolution with extensions let people test things out in production environments to figure out what worked Yeah, except nobody did this. The cutting-edge features came to Direct3D first because Microsoft had early access to what the GPU vendors were doing and could plan out what that would look like from an API perspective. The vendor extensions only came out around the same time as the DirectX support, maybe later. Core OpenGL support would onlu emerge years later. > As a game developer it's invaluable to be able to swap over to a Direct3D backend for debugging even if you end up using OpenGL as your default. What? Name a game developer who's done this in the past 20 years -- use Direct3D for debugging and OpenGL as the default. Only Id Software actually used OpenGL and Vulkan seriously, and they are owned by Microsoft now so that will change.
- smoldesu 4y ago> Name a game developer who's done this in the past 20 years I'd imagine it was really popular among console developers, who would usually develop two versions of their game anyways (a DirectX one for Xbox/PC and an agnostic one for Mac/Playstation/other). DirectX is traditionally considered easier to use (and comes with PC tooling) so I could see how people would prefer it for debugging.
- pjmlp 4y agoContrary to urban myths OpenGL was never a thing in most game consoles. Sony only supported it on PS 2, and quickly moved into LibGNM(X) as almost no one cared, Nintendo had a OpenGL like API on the Wii, and while the Switch supports GL 4.6/Vulkan, its main API is NVN.
- kevingadd 4y agoIIRC there was an OpenGL layer for PS3, but it was terrible and I only know of one (indie) dev who shipped a full-blown game on it. It was an awful experience from my understanding.
- 4y ago
- shmerl 4y agoI'm aware of history of DX12. It started as a clone of Mantle, which they made with full knowledge that Vulkan is going to be a thing. No one stopped them from collaborating on Vulkan instead which originated in Mantle the same way. I see no excuse here but the classic NIH / lock-in push. For the reference: https://twitter.com/renderpipeline/status/581086347450007553 https://twitter.com/renderpipeline/status/581086347450007553
- MindSpunk 4y agoD3D12 is nothing like mantle. Not even close. D3D12 is heavily derived from D3D11. D3D12's own documentation is even specified as 'behaves like D3D11 except for these bits'. If anything, Vulkan is a clone of Mantle because Vulkan is Mantle. It was donated to the Khronos Group by AMD and served as the foundation for Vulkan. If you have both API headers for Vulkan and Mantle side by side it's shocking how similar they are. Vulkan 1.0 is largely just Mantle with more API ceremony for tile-based mobile GPUs and NVidia's (at the time) far more restrictive binding model.
- shmerl 4y agoIt was derived directly from Mantle, same as Vulkan. See the link above which literally records that historic fact. Same way Mantle was used for Vulkan by Khronos, MS used it for their NIH becasue they didn't want for collaborative effort to reduce their grip on the gaming market. Without AMD, MS would have never came up with DX12 on their own so fast. AMD expressed the interest in collaborative API quite early on and Mantle was presented for that very purpose. Khronos used that as intended, while MS hijacked that for their own market manipulation purposes in their usual MS only way.
- MindSpunk 4y agoThe linked tweet only really shows that some of their documentation language was 'borrowed'. The actual API semantics are nothing like Mantle or Vulkan. The synchronization model is completely different, the queue system is completely different, the memory allocation model is completely different. The binding models are massively different. Maybe some of the core ideas behind Mantle were taken with explicit synchronization, and maybe they started from Mantle as a base but the end result is completely alien to what Mantle was. Microsoft could never justify using Vulkan over DirectX 'Next' to its developers. It would be a total deprecation of Direct3D. It would require all their developers to throw their entire renderer backend out and start fresh with 100% new tools. A lot of effort was put into making the transition to D3D12 from D3D11 easy, even to (IMO) the detriment of the API semantics. They even kept shaders inter compatible while adopting an enormously different binding model. D3D12 is also largely a much friendlier API to use. Vulkan is (was) verbose to the extreme in ways that really didn't matter to the majority of Direct3D users on desktop GPUs. Vulkan render passes are a nightmare to work with, and largely served no benefit to the desktop and console GPUs Direct3D is used for. Vulkan has evovled a lot since 1.0, relaxing lots of the excessive restrictions that were originally there. A lot of this stuff likely wouldn't have happened if it weren't for D3D12 putting pressure on Khronos to improve the developer experience. Vulkan is not the panacea people think it is, but it's getting better. And so is D3D12 by borrowing some of Vulkan's better ideas. To say D3D12 should have never existed is just 'M$ bad' dogma.
- gjsman-1000 4y agoNIH? Vulkan was released nearly a year after DX12. And DX12 follows a long line of DirectX versions. Also... OpenGL has kind of always sucked compared to DirectX. There is no reason for Microsoft to abandon 25+ years of support because finally we have a competitive open standard for Direct3D. And on that note, you are just complaining about Direct3D. There are a ton of DirectX APIs for things that aren't graphics, like sound (XAudio), raytracing (DXR), storage (DirectStorage), machine learning (DirectML), and many more. Vulkan doesn't really attempt most of these other DirectX features. So... you're asking Microsoft to abandon Direct3D for Vulkan, and have everyone use a Vulkan/DirectX hybrid, which sounds awful.
- shmerl 4y agoDebunked this "year after" argument in the above comment.
- vore 4y agoIs 3D rendering and audio output really so coupled together that you can't just swap out Direct3D for Vulkan and keep using XAudio? It sounds awful if that's the design in the first place. For what it's worth, many AAA games do exactly that...
- SquareWheel 4y ago> Vulkan was released nearly a year after DX12. True, but Vulkan is largely a continuation of Mantle which released two years before DX12.
- deleted 4y ago[deleted]
- kevingadd 4y agoWhat's stopping Intel, AMD and NVIDIA from offering native Vulkan support in WSL, then? This 'NIH' (not so as already explained by another commenter) is offering graphics acceleration to WSL guests based on existing Windows drivers, which compensates for the fact that the GPU vendors aren't already offering acceleration - Vulkan or otherwise - for WSL guests. I'm actually not sure how I would get stable acceleration, Vulkan or otherwise, in a Linux host in any VM. In my experience acceleration in VMWare and VirtualBox are both a crapshoot to the point of not being worth using.
- ColonelPhantom 4y agoHow about VirGL with QEMU/KVM? It's also not perfect but might work for you.
- kevingadd 4y agoWill give it a try the next time I need to test accelerated graphics on Linux, thanks a lot! Never heard of it before.
- bitwize 4y agoFor 25 years now the standard for 3D graphics has been DirectX. Why would you expect Microsoft, of all companies, to support anything else?
- dharma1 4y agoFor GPU accelerated ML in Win11 (PyTorch w/ CUDA) - is WSL enough nowadays, or still dual boot to Linux?
- sxp 4y agoI was able to get Stable Diffusion and other similar ML systems working in WSL2 on Win11. There might be performance differences between WSL and a native system. I haven't benchmarked AI in different configs, but my main use case is Rust+wgpu and there were noticeable performance differences because the GPU driver exposed by WSL didn't have as many features as the GPU driver used on Windows. I also had problems with other APIs on WSL such as Optix.
- arprocter 4y agofwiw I have Stable Diffusion working in WSL2 on Windows 10
- rfoo 4y agoFor my CUDA workload WSL2 (or really, Hyper-V GPU-PV) is about 75% native performance. Isn't too bad, I still prefer running non-virtualized Linux for anything longer than overnight. OTOH, run Linux on the metal and Windows in KVM works just better.
- lostmsu 4y agoI've been using PyTorch + CUDA on native Windows without much problems for a few years now.
- deepsquirrelnet 4y agoI’ve also been doing native windows without too much issue. I have run into difficulty setting up libraries like detectron though. For the record, I loathe working in the windows terminal. But for people like me, conda is a lifesaver. The m2-base packages bring a pretty good number of tools into the terminal and significantly resurrect its usability. I’m a little tempted to try wsl again with this improvement, but my last experience wasn’t great with it and I’ve gotten comfortable enough without it.
- Fervicus 4y agoI want to be able to use IntelliJ from WSL. Can I do that yet?
- stonecolddevin 4y agoI've been doing it for almost a year, am I missing something?
- DiabloD3 4y agoI, too, want to mention that this has already been working. Any app that works with "real" Xwayland (or already is Wayland native), will work on WSL2. WSL2's Xwayland uses Mesa/DRI's WDDM backend, so its translating DRI IL into DX12 IL, and passing it off to the GPU driver inside of NT kernel space. There are a few exceptions, such as I think Firefox has a bug where its misinterpreting the DX12 Mesa target and attempting to use a feature that isn't advertised (they're working on a fix); Chrome (thus all the Chromiums and Electrons) work, GTK, Qt, the Java toolkits, etc, all work.
- Fervicus 4y agoIt was a genuine question. Good to know that this is possible! It was my understanding that it was not the case.
- baq 4y agoThere were issues with enterprise vpn and firewalls last time I tried, but on a home desktop gui apps basically just work.
- deleted 4y ago[deleted]
- RockRobotRock 4y agoCan I ask why? Jetbrains products on Windows have good WSL support and remote interpreting already.
- gjsman-1000 4y agoMicrosoft - if you are reading this, I love this - but if you could throw Ext4 support into Windows, so that I can use Linux-formatted drives natively, that would be truly next-level. I know you can do it through WSL, but that's kind of a hack compared to native support in Windows Explorer.
- deleted 4y ago[deleted]
- speed_spread 4y agoext4 I don't know, but if you're willing to go with btrfs: https://github.com/hbs7/btrfs-windows https://github.com/hbs7/btrfs-windows Note that I didn't try it but it looks amazing. There's even some mad lad that uses it to boot Windows.
- MarkSweep 4y agoYou can compile your own kernel to use with WSL2. See the Config file for how you can specify the path to your own kernel and the command line to pass to it: https://learn.microsoft.com/en-us/windows/wsl/wsl-config https://learn.microsoft.com/en-us/windows/wsl/wsl-config Here is adding ZFS support: https://wsl.dev/wsl2-kernel-zfs/ https://wsl.dev/wsl2-kernel-zfs/
- mikepurvis 4y agoI think the GP's ask is for native Windows support, which is orthogonal to anything WSL/WSL2 can do.
- barrkel 4y agoNative Windows support would conflict with the WSL2 stack, at its integration level. File system drivers aren't generally designed to share the underlying block device between different kernels concurrently. The block device isn't consistent with the latest writes without flushing caches, and a native driver wouldn't see those caches without hooking the Linux kernel, but that's not the WSL2 integration point. WSL2 is based on virtualization not kernel hooking. Native Windows would be able to access the file system as long as you killed all WSL2 processes first, and vice versa: run any WSL2 process and lose native access. Access via network makes far more sense.
- ognarb 4y agoThis entire concept of having directx in WSL sounds like Embrace Extend Extinghish, all over the place. This means we will have some linux programs only running in WSL. This is fucked. > libd3d12.so and libdxcore.so are closed source, pre-compiled user mode binaries that ship as part of Windows. These binaries are compatible with glibc based distros and are automatically mounted under /usr/lib/wsl/lib and made visible to the loader. Mesa is a freedesktop project and this is not the freedesktop I was imaginating.
- Laaas 4y agoThis will never happen. Linux is way too big for this. The percentage of developers using Linux is so large that making your tool only work under WSL makes very little sense, especially when the native approach is usually easier/simpler.
- jameshilliard 4y agoMaking non-WSL Linux unusable for at least some applications is clearly the goal here. Microsoft isn't even hiding that at all as they even list it as a specific goal of the directx related changes being pushed to mesa: https://devblogs.microsoft.com/directx/in-the-works-opencl-and-opengl-mapping-layers-to-directx/ https://devblogs.microsoft.com/directx/in-the-works-opencl-a... > Make it easier for developers to port their apps to D3D12. For developers looking to move from older OpenCL and OpenGL API versions to D3D12
- jameshilliard 4y agoYeah, I pointed this out on the mailing list when when microsoft was trying to upstream their dxgkrnl driver: https://lore.kernel.org/all/CADvTj4q_-A9p2UkH975SPPYmSzVAv38VJxLDBQjEnHoCSERzOw@mail.gmail.com/ https://lore.kernel.org/all/CADvTj4q_-A9p2UkH975SPPYmSzVAv38... As have others: https://lore.kernel.org/all/Yh8wEj5wKMRtxaBB@infradead.org/ https://lore.kernel.org/all/Yh8wEj5wKMRtxaBB@infradead.org/ Looks like the up-streaming has been abandoned as Microsoft has not made a real effort to fix the issues pointed out: https://lore.kernel.org/all/YinPR66ekfKWHR0R@kroah.com/ https://lore.kernel.org/all/YinPR66ekfKWHR0R@kroah.com/
- yodon 4y agoGPU acceleration sounds great, but fixing the slow disk speed across the Linux/Windows boundary would be even better.
- naikrovek 4y agoNTFS is just slow for accessing lots of files in a short amount of time. That was a tradeoff that was made intentionally, and it won't go away until you use another filesystem for your boot volume. ReFS is apparently going to be an option for this sometime soon.
- teruakohatu 4y agoWSL2 is slow, even accounting for NTFS. It is painfully slow. Accessing the Linux volume from Windows is also slow. WSL1 was faster too. It makes backing up the linux home directory painful.
- naikrovek 4y agoah, it's 9p that's slow, then. there are other ways to get files from A to B. consider backing up to the local network rather than the host Windows machine, maybe. I don't know. another option may be to mount your home directory from another host. that may not suffice if you're doing a lot of windows interop I suppose. once in WSL I tend to stay there, and not do much related stuff in Windows, and I just tar & gz the home directory and put it on a flash drive when I want to back it up.
- yellow_postit 4y agoGreat to see the video progress. Hoping to see more with sound support soon as well. I’d love to be able to more easily work with libraries like OpenAI Whisper under WSL once issues with soundcards in WSL [1] are addressed. [1] https://github.com/microsoft/WSL/issues/7327 https://github.com/microsoft/WSL/issues/7327
- deleted 4y ago[deleted]
- laech 4y agoI wanted to give Windows/WSL another try, but unfortunately installing WSL on a clean install of Windows 11 gives a blue screen of death boot loop on my laptop. Seems to be related to this 3 year old bug: https://github.com/microsoft/WSL/issues/4784 https://github.com/microsoft/WSL/issues/4784
- samsaga2 4y agoMy problem with WSL is the performance. A real Linux is a lot faster, even a Linux in VirtualBox works a lot better. Maybe only happens to me.
- sz4kerto 4y agoIt's just you. WSL2 is a real Linux, there's almost zero performance hit. (If you access Windows filesystem then that's slow, of course.)
- zinclozenge 4y agoCurious, though I feel like when I develop using an IDE like intellij, there's some sluggishness when the project files are on the wsl file system. Is it because of mixing between the windows one where the IDE is installed, and the wsl one?
- smileybarry 4y agoYes, the WSL2 implementation uses a sort-of SMB to mix filesystems, compared to WSL1’s “real” syscall translations etc.
- aspyct 4y agoI use WSL2 on a daily basis and I love it, but the console output is slow. It's mostly due to Windows Terminal having performance issues. But it does have a big impact on any script that prints a lot.
- pjmlp 4y agoThe folks had it all wrong, it wasn't the Year of Desktop Linux, rather the Year of Desktop POSIX, that most people cared about, by investing into Apple hardware. Even if WSL runs Linux kernel, macOS definitely not, and both combined make OEMs selling GNU/Linux proper almost irrelevant.
- NayamAmarshe 4y agoTake but never give back, well played Microsoft. So Windows users can run Ubuntu in your little VM and that Ubuntu can utilize DirectX without any issues but not real Linux machines. No, I don't think this is laziness but a well planned step. We get it, you don't wanna lose your gaming marketshare. After all, you're the main player even with a bloated and anti-consumer software like that but know that Linux is inevitable. Maybe not today, but the better software will win. No matter what your opinion is, FOSS is coming.
- self_awareness 4y agoWas there even any doubt what are MS intentions regarding WSL? MS is known for Embrace, Extend, Extinguish. > "Embrace, extend, and extinguish" (EEE), also known as "embrace, extend, and exterminate", is a phrase that the U.S. Department of Justice found that was used internally by Microsoft to describe its strategy for entering product categories involving widely used standards, extending those standards with proprietary capabilities, and then using those differences in order to strongly disadvantage its competitors.
- NayamAmarshe 4y agoFunny enough, WSL is what pushed me towards Linux even more. To the point that I stopped dual booting altogether and switched to Linux permanently because of how horrible WSL is and how much time it wastes. I honestly believe that people who stick to WSL and are afraid of using a real Linux distro are a little too afraid of trying something different from what they're used to. I used to be in a similar position, so I won't blame them but hey, at least I got to compare the software side by side and eventually decided which one's better by a thousand miles.
- CoolCold 4y agoI'm stick to Windows and WSL - I'm not looking into Linux On Desktop land (not in FreeBSD on Desktop as well of course), I have enough Linux on servers at work and doing sysadmin job at home is not appealing to me. I like the robust, reliable and solid system Windows provides me. I have close to 0 issues, not having problems with updates, basically every case and every tool I _may_ need works, making me confident about Windows as tool to solve my tasks.
- jlpcsl 4y agoSmells like another piece of their usual Embrace, Extend, Extinguish tactics. So sad seeing people being so naive buying everything these tech feudalists say.
- jakogut 4y agoThat's one of my big problems with WSL, and Microsoft's contributions to open source projects like Mesa. Their Dozen driver implements Vulkan on top of D3D12, a proprietary API only available officially on Windows. This is useless for anybody not using their proprietary software. In my opinion, it should never have been accepted without an officially supported open source backend. I don't care if it's in the form of a Linux library, BSD, whatever, if it only adds value to your proprietary product, why should the open source community be shouldered with the burden of maintenance? Especially when _using_ said functionality locks users to your product. Why didn't they use Vulkan for a backend, which is portable, well-supported, and open, and use and contribute to existing high quality drivers on top of it? There's only one reasonable answer, they're not interested in portability, working with the community, or omni-win-win scenarios.
- mouse_ 4y agoI was perfectly happy using mingw with gcc in my build environment to create nifty little graphical exes with raylib. Now, Windows Defender likes to flag anything built with mingw as a virus, and the official answer is "Just use WSL!". This isn't a problem for me personally, as I trust my own software, but it's absolutely unacceptable if I wanted to ship something on itch.io or Steam or the like. I suppose I've been extinguished for now, and will probably just start building to html5/webassembly, but I'm 110% onto their tricks.
- phendrenad2 4y agoThank goodness. Linux is terrible and it needs a fresh start. Maybe if WSL kills it we can start over fresh.
- thesorrow 4y agovirgl/video will soon be available in Mesa for linux kvm too [1]. [1] https://www.phoronix.com/news/Virgl-Encode-H264-H265 https://www.phoronix.com/news/Virgl-Encode-H264-H265
- t0bia_s 4y agoGreat. Now I want GPU pass-trough in VM on linux with Nvidia GPU. I mean something that you don't need nuclear physics degree to actually understand how to set up.
- NoGravitas 4y agoRemember, WSL is pronounced "weasel".
- phendrenad2 4y agoActually it's pronounced "duble-yu ess ell" by most people I know.