EDIT: The original title of this thread was "Good News!! The NTSYNC Driver For Wine/Proton Is "Broken" For Linux 6.10". It has been retitled to The NTSYNC Driver for WINE Saga
This news may seem to be bad news, or even useless news to some, but I want to explain why I believe this news is fantastic and very important to everyone here who uses WINE.
First of all, we all know that WINE and yabridge is our perfect combination for getting Windows plugins to run in our native linux hosts. What some may know and others may not, there is a custom patched version of wine available called, "WINE-TKG" This version of WINE really, really, really increases the performance of WINE. Read the following excerpt from the yabridge GitHub page on improving WINE performance:
https://github.com/robbert-vdh/yabridge
The last but perhaps the most important thing you can do is to use a build of Wine compiled with Proton's fsync or FUTEX2 patches. This can improve performance significantly when using certain multithreaded plugins. If you are running Arch or Manjaro, then you can use Tk-Glitch's Wine fork for a customizable version of Wine with the fsync patches included. Make sure to follow the instructions in the readme to build a version of wine-tkg using the default profile and don't try to use the prebuilt releases as they will have fshack enabled which tends to break many plugins that use Direct3D for their rendering. You'll also want to make sure you're running Linux kernel 5.16 or newer as those include support the _fsync_futex_waitv option that's enabled by default though wine-tkg's customization.cfg. Finally, you'll have to set the WINEFSYNC environment variable to 1 to enable fsync. See the environment configuration section below for more information on where to set this environment variable so that it gets picked up when you start your DAW.
So, the short version is that WINE-TKG exists with special patches to improve WINE performance.
https://zezic.github.io/yabridge-benchmark/
So, going on with my explanation: Back in January of this year, at the Linux Plumbers Conference, a very interesting topic came up:
https://www.phoronix.com/news/Windows-NT-Sync-RFC-Linux
Following discussions from last year's Linux Plumbers Conference, a Windows NT synchronization primitive driver has been proposed for the Linux kernel. This driver would expose /dev/ntsync as a new character device for implementing some of the Windows NT synchronization primitives directly within the Linux kernel. In turn this would help the performance of some Windows games/applications running on Linux via Wine and in some cases would mean significantly better performance.
Elizabeth Figura of CodeWeavers who published the "request for comments" (RFC) to various Linux kernel mailing lists explained of the motivations for this synchronization primitive driver for targeting Windows NT kernel behavior:
"The Wine project emulates the Windows API in user space. One particular part of that API, namely the NT synchronization primitives, have historically been implemented via RPC to a dedicated "kernel" process. However, more recent applications use these APIs more strenuously, and the overhead of RPC has become a bottleneck.The NT synchronization APIs are too complex to implement on top of existing primitives without sacrificing correctness. Certain operations, such as NtPulseEvent() or the "wait-for-all" mode of NtWaitForMultipleObjects(), require direct control over the underlying wait queue, and implementing a wait queue sufficiently robust for Wine in user space is not possible. This proposed driver, therefore, implements the problematic interfaces directly in the Linux kernel."
The point of all of this is that what began as a RFC proposal, is actually moving forward! The attempt was made to get things into linux kernel 6.10, but it didn't quite make it. This means that it is very possible that in the 6.11 kernel release we'll have a huge boost of performance when using WINE. The initial numbers are amazing!
https://www.phoronix.com/news/Windows-NT-Sync-RFC-Linux
But wait! You say.... "These performance improvements are designed only for GAMES! This is true. But the very cool thing about all of this, is that even though the initial purpose is to increase the performance of games, all windows apps benefit! Also, It is very possible that the need for WINE-TKG may no longer be needed after this as well! We'll get a huge performance increase and no longer have to go through extra hassles to get this increase in performance.
So, at any rate, this news that the patches are going forward (even though not ready for 6.10) is very, very good news!
https://www.phoronix.com/news/Linux-6.10-NTSYNC-Broken
The NTSYNC Driver For Wine/Proton Is "Broken" For Linux 6.10
Written by Michael Larabel in Linux Gaming on 15 May 2024 at 12:18 PM EDT. 20 Comments
LINUX GAMINGWhile Linux 6.10 is poised to merge the initial NTSYNC driver for a Windows NT Synchronization Primitive driver that can help with faster Windows gaming performance under Wine/Proton (Steam Play), the driver isn't complete. The initial patches have been in Greg Kroah-Hartman's char-misc-next branch for several weeks to expose the NTSYNC character device, it isn't the entire patch series. Greg has now marked the driver as "broken" for Linux 6.10.
The NTSYNC driver basics are in char-misc-next but the rest of the patch series ironing out the functionality haven't yet been queued. It's now too late for finding it for the Linux 6.10 merge window, so Greg is marking the driver as "broken" which in turn means the driver will not be compiled for common kernel builds. Greg wrote on the message for the patch:
"The ntsync code is only partially enabled in the kernel at this point in time, creating the device node and that's about it. Don't confuse systems that expect to see a working ntsync interface by teasing it with this basic structure at this point in time, so mark the code as "broken" so that it is not built and enabled just yet.
Once the rest of the code is accepted, this will be reverted so that the driver can be correctly built and used, but for now, this is the safest way forward."
That "broken" patch for NTSYNC was picked up a few minutes ago in char-misc-next ahead of the char/misc feature pull being submitted soon for the Linux 6.10 merge window.
NTSYNC driver is broken
CodeWeavers' Elizabeth Figura had commented on the patch when it was volleyed on the mailing list:
"I was even thinking of suggesting something like this myself. Sorry for taking so long to get the rest of the patches into acceptable shape..."
Here's to hoping that the NTSYNC driver code is in good shape then for the Linux 6.11 kernel later in the year for helping speed up Windows gaming on Linux with Valve's Steam Play and Wine.
20 Comments