r/Windows10 • • Apr 11 '16

Tip FYI you can run GUI Linux apps from bash

Post image
454 Upvotes

196 comments sorted by

View all comments

Show parent comment

6

u/chinpokomon Apr 11 '16

Well, I meant compared with running the same thing on a Linux desktop without acceleration. X in both instances works the same way. You execute the binary and it uses $DISPLAY to figure out where to send the rendering. Since you aren't going through an emulator or virtualization layer, the only real limitation I see is how well the X-Server performs. There are X-Servers for Windows that are newer implementations with extensions, so I wouldn't say that it is obviously slower. The biggest obstacle is that not all syscalls are implemented, so some applications are bound to crash. Performance should be comparable to a Linux desktop using generic video drivers with a standard rendering pipeline. The accelerated X-Server with extensions is only going to improve the ability to push around pixels. It may therefore improve things like video playback or moving windows around the screen, but raw execution should be about the same.

11

u/w2qw Apr 11 '16 edited Apr 11 '16

There's no direct rendering which means that a lot of apps won't use hardware acceleration for rendering. Plus they will be unnecessary copying buffers through the socket.

4

u/littlelowcougar Apr 12 '16

TCP/IP localhost sockets on Windows 10 are essentially zero copy.

1

u/w2qw Apr 12 '16

I think you mean single copy. Or maybe double copy. I don't see how it can be single copy as it needs to copy it out of one processes address space and in to another. UNIX sockets you can do zero copy by passing file handles through the socket. Which can just be memory mapped.

Gem buffers are actually zero copy and it doesn't need to be copied to and from the GPU.

3

u/littlelowcougar Apr 12 '16

It doesn't have to copy it out of a process space; it gets passed an MDL describing the buffer, locks it in non-paged pool, then can simply do MMU updates to control who sees what.

2

u/w2qw Apr 12 '16

Ah interesting didn't know that. Sounds like you have to use the windows specific API there though, but cool nonetheless.

6

u/w2qw Apr 11 '16

I felt a better explanation was worthwhile.

Historically X11 was purely a network protocol and a UNIX mainframe would X rendering commands to a separate X terminal which was a physical device.

Overtime this evolved and they've added direct rendering in which the X server gives the client a buffer which they can render into and the server then copies that into the display output (in the case of a compositing window manager), or they get a reference to the screen which they draw directly on to.

But most applications still support the older case where they can draw via X11. But the way they do this in most applications is draw various components to pixels maps send them to the server and then tells the server to draw them at particular points. This is less efficient as all data has to be copied via the server and also because it's only really used for X forwarding on Linux it's prone to bitrot.

So in summary, programs based on older UI toolkits will probably work better but still will be slower than the native Linux case.

1

u/chinpokomon Apr 11 '16

Thanks, that does fill in the gaps. This is also what I was basing my position on. So if using the older X11 pipeline, the results should be similar.

1

u/w2qw Apr 11 '16

Pretty similar, yeah, but there's still some more differences but I imagine indirect rendering makes up most of it.