Live data from Hacker News

DirectX is coming to the Windows Subsystem for Linux

devblogs.microsoft.com

81–90 of 548 posts

Re: DirectX is coming to the Windows Subsystem for Linux

#81
post #17

Earlier quoted context omitted.

someone could implement it natively in Linux This is exactly what we don't want. There's already plenty of effort wasted on GBM vs. EGLStream so introducing a third API would just lower quality even more.

This "third API" is already well supported by every relevant graphics vendor. Adopting it would actually reduce the number of APIs vendors need to deal with. And the quality of WDDM drivers has always been higher than anything Linux has.

> And the quality of WDDM drivers has always been higher than anything Linux has.

And the outcome of implementing this seems to ensure it will stay that way.

Re: DirectX is coming to the Windows Subsystem for Linux

#82
post #75

Earlier quoted context omitted.

Yes, machine learning is the first priority as they say in the thread. However, the blog post goes on to say that window system integration is coming. This will eventually be a full graphics stack. > Anyway, this isn't really a Linux port of DirectX The entire user mode side of Direct3D is ported, in addition to the user mode parts of the Nvidia, AMD, and Intel graphics drivers.

> This will eventually be a full graphics stack Are we seeing the start of the migration of Windows to linux?

>> the migration of Windows to linux

Please no. Please keep your peanut butter out of my chocolate. Call me a purist, but linux should take nothing from windows, give no ground, make no compromise. One must die for the other to live.

https://bugs.launchpad.net/ubuntu/+bug/1

Re: DirectX is coming to the Windows Subsystem for Linux

#84
post #6

...and extend. I'm sure this architecture was easier for MS but it opens the door to code that runs on WSL2 that doesn't run on regular Linux.

Microsoft doesn’t consider desktop Linux its competition, it considers MacOs its competition. It’s going after macbook’s position as the default developer laptop and Apple deserves what’s coming to them IMO, for neglecting it for so long.

> after macbook’s position as the default developer laptop

Perhaps in your country/field. Certainly not in mine...

Re: DirectX is coming to the Windows Subsystem for Linux

#85
post #2

> This also enables third party APIs, such as the popular NVIDIA Cuda compute API, to be hardware accelerated within a WSL environment. Dollars to donuts this is why Microsoft is implementing this. GPU acceleration is becoming a critical feature for many users (but especially developers) and this will continue. If WSL is to be a serious competitor, this is necessary and I'm glad to see it showing up. This is true of…

Yup, from one of the MS staff replies further in the thread[1] > There is a single usecase for this: WSL2 developer who wants to run machine learning on his GPU. The developer is working on his laptop, which is running Windows and that laptop has a single GPU that Windows is using. Can't say I can get behind MS trying to shift maintenance for a Windows only "feature" onto the Linux devs here. 1. https://lkml.org/lkml…

Is there a possibility Linux upstream won't accept it?

Re: DirectX is coming to the Windows Subsystem for Linux

#86
post #61

Earlier quoted context omitted.

In the linked thread the Microsoft developers explicitly deny that this is the intent, if that's worth anything to you. The goal, rather, is to take all the usual (for the Linux side) GPU stuff and give it access to the Windows host's GPU, when running on WSL. That is, they are already working on getting OpenGL/Vulkan/etc. to run on top of this: https://www.collabora.com/news-and-blog/news-and-events/intr... Rather t…

Does the intent matter if the result is the same?

Will the result be the same?

I don't see why it would be, given the circumstances.

Re: DirectX is coming to the Windows Subsystem for Linux

#87

Earlier quoted context omitted.

Yup, from one of the MS staff replies further in the thread[1] > There is a single usecase for this: WSL2 developer who wants to run machine learning on his GPU. The developer is working on his laptop, which is running Windows and that laptop has a single GPU that Windows is using. Can't say I can get behind MS trying to shift maintenance for a Windows only "feature" onto the Linux devs here. 1. https://lkml.org/lkml…

Is there a possibility Linux upstream won't accept it?

Sure, but that doesn't really stop Microsoft from achieving their goal with WSL2. They would be happy to upstream it if possible if not then oh well.

Re: DirectX is coming to the Windows Subsystem for Linux

#88

The Year of the linux desktop has come

Actually, the year of Linux on the desktop will never come also thanks to this. Developers will find more comfortable writing Linux software on Windows (some already do); desktop users will have both worlds at hand without being forced to dual boot; Linux gamers won't have any reasons to keep using native Linux. Etc. I foresee in a not so distant future Microsoft integrating Windows UI elements and events hooks right…

I disagree, i do not think that anyone would want to start running windows just to run the same software they already run while losing a chunk of control and support. However for the real argument, ask yourself: am I switching to using windows because of this?

Re: DirectX is coming to the Windows Subsystem for Linux

#89
post #63

Earlier quoted context omitted.

I don't see how being "locked into CUDA" should make one less skeptical of a change that will functionally lock projects into Windows. I can't help but think this is going to siphon resources from Linux native graphics development.

I don't see how it'll be locking projects into windows. There's no user space DirectX library here. The whole point looks to take your CUDA code that would run just fine on Linux without a hypervisor, and run it just as well in WSL2. ie. this is at worst still the embrace stage, IMO.

They are providing libd3d12.so, that is a user space library that apps can link to.

At the moment, that library only works under WSL, but I guess the DXVK folks can connect their implementation too.

Re: DirectX is coming to the Windows Subsystem for Linux

#90
I did post my comment in another thread, but this is seriously very very bad:

"Windows could be required to use some Linux apps (Embrace, extend, extinguish)" -> https://news.ycombinator.com/item?id=23238790

The most important is to look at the following page to better understand the implications:

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

Here is how I would sum it up:

* They create a new kernel file descriptor: /dev/dxg

* With this, on the Linux of WSL, it is like a direct "pipe" to a Windows host graphical stack.

* So it means that they can put code in Linux application code that will use Windows proprietary graphical stacks, like DirectX through /dev/dxg.

* And so, clearly, this Linux app will not work inside a normal Linux computer that is not a "guest" of Windows.

Now, you can see the "Embrace" and the "Extend"?

And to well understand the article, the following things have to be stressed: This is not just something to render a Window or something like that, it is a special "passthrough" api to all the things that are provided by Windows GPU stack/drivers.

For example, they give the example of Cuda compute API, but also, they kind of "built" DirectX sdk itself for Linux (debian, ubuntu, ...), but still the proprietary closed blob that "apps" are expected to use, but that will rely on /dev/dxg.

Also, if you want to use anything OpenGL on the Linux WSL, they will ensure that it is translated to DX on Linux side, before going through the same special DirectX api. The good thing would probably have been to do the opposite side, ensure that Windows has the proper OpenGL support to be able to pass gpu acceleration to the Windows host.

Post reply on HN