I'd like suggesting to merge the 17 patches from wine-staging/patches/nvcuda-CUDA_Support patches into upstream wine for the following reasons:
Currently Cuda applications for Windows do not run in native Wine. Such an application is Warpem (available for Windows only), and CUDA-Z for Windows. I assume there are other applications as well. This could be fixed by pulling in the 17 patches wine-staging/patches/nvcuda-CUDA_Support.
Possible disadvantages: - build dependency to cuda - some distros might not want to have a build dependency on cuda.h That's the choice of the package manager, but this should be endorsed and recommended for the above reason.
- run-time dependency on cuda wine does not have a runtime dependency on cuda (probably due to dynamic linking) e.g. cuda-z can be started under wine, and stops gracefully with a message the cuda is not available.
- number of APIs to maintain is currently done anyway (by the wine-staging team)
From a the perspective of some application, Cuda is part of the operating system should be provided by the platform (Wine in our case). Overall, it seems merging the nvcuda-CUDA_Support into upstream Wine are the right thing to do.
Best regards, Alois
On Sat, Nov 12, 2022 at 9:13 AM Alois Schlögl alois.schloegl@gmail.com wrote:
I'd like suggesting to merge the 17 patches from wine-staging/patches/nvcuda-CUDA_Support patches into upstream wine
In my opinion, CUDA for Wine would make the most sense as some kind of downloadable add-on (maybe something akin to Wine Mono). But I never use CUDA, so it would be up to someone else to make that happen.
-Alex
Am 11/16/22 um 02:21 schrieb Alex Henrie:
On Sat, Nov 12, 2022 at 9:13 AM Alois Schlögl alois.schloegl@gmail.com wrote:
I'd like suggesting to merge the 17 patches from wine-staging/patches/nvcuda-CUDA_Support patches into upstream wine
In my opinion, CUDA for Wine would make the most sense as some kind of downloadable add-on (maybe something akin to Wine Mono). But I never use CUDA, so it would be up to someone else to make that happen.
-Alex
[1] seems to suggest that this is not possible because cuda is a "low-level library", and because of that "...You cant install some windows driver in wine and expect this to work. ...".
Therefore, adding the nvcuda patches in upstream wine seems to be the proper approach.
- Alois
For the runtime dependency, could we also support HIP ? We have a large audience of steam deck users who might want to tinker around with HIP applications. I'd like to share a library my team has been working on called Orochi https://github.com/GPUOpen-LibrariesAndSDKs/Orochi It handles runtime linking of both nvcuda.dll and amdhip64.dll dynamically. This could be used as part of a wine add-on.
Cheers, Aaryaman
On Wed, Nov 16, 2022 at 4:39 PM Alois Schlögl alois.schloegl@gmail.com wrote:
Am 11/16/22 um 02:21 schrieb Alex Henrie:
On Sat, Nov 12, 2022 at 9:13 AM Alois Schlögl alois.schloegl@gmail.com
wrote:
I'd like suggesting to merge the 17 patches from wine-staging/patches/nvcuda-CUDA_Support patches into upstream wine
In my opinion, CUDA for Wine would make the most sense as some kind of downloadable add-on (maybe something akin to Wine Mono). But I never use CUDA, so it would be up to someone else to make that happen.
-Alex
[1] seems to suggest that this is not possible because cuda is a "low-level library", and because of that "...You cant install some windows driver in wine and expect this to work. ...".
Therefore, adding the nvcuda patches in upstream wine seems to be the proper approach.
- Alois
I tend to agree that since CUDA needs the linux version of libcuda that only come with the nvidia driver, i am a bit unsure if it would be a "default wine" thing. A regular windows user do not install (nv)CUDA.dll libraries unless they use an NVIDIA adapter afaik.
I have been working on improving CUDA support for wine here: https://github.com/SveSop/nvcuda/tree/devel , but i am unable to crack compatibility with CUDA SDK 11.6 and newer i am afraid.
Sveinar
On 16.11.2022 08:38, Alois Schlögl wrote:
Am 11/16/22 um 02:21 schrieb Alex Henrie:
On Sat, Nov 12, 2022 at 9:13 AM Alois Schlögl alois.schloegl@gmail.com wrote:
I'd like suggesting to merge the 17 patches from wine-staging/patches/nvcuda-CUDA_Support patches into upstream wine
In my opinion, CUDA for Wine would make the most sense as some kind of downloadable add-on (maybe something akin to Wine Mono). But I never use CUDA, so it would be up to someone else to make that happen.
-Alex
[1] seems to suggest that this is not possible because cuda is a "low-level library", and because of that "...You cant install some windows driver in wine and expect this to work. ...".
Therefore, adding the nvcuda patches in upstream wine seems to be the proper approach.
- Alois
Am 16.11.2022 um 17:40 schrieb Sveinar Søpler cybermax@dexter.no:
I tend to agree that since CUDA needs the linux version of libcuda that only come with the nvidia driver, i am a bit unsure if it would be a "default wine" thing. A regular windows user do not install (nv)CUDA.dll libraries unless they use an NVIDIA adapter afaik.
I have been working on improving CUDA support for wine here: https://github.com/SveSop/nvcuda/tree/devel , but i am unable to crack compatibility with CUDA SDK 11.6 and newer i am afraid.
Afaiu a challenge with this is interop with graphics APIs. I am writing this from half-knowledge here, but I think CUDA has ways to transfer data to and from OpenGL, d3d and Vulkan. Getting those to work will need deep rooted hooks in winex11.drv and wined3d, for a vendor specific library.
One important thing is that a Wine built on a machine with Cuda headers and libs needs to run on a machine without Cuda installed (minus Cuda functions, obviously).
On Wed, Nov 16, 2022 at 7:41 AM Sveinar Søpler cybermax@dexter.no wrote:
I tend to agree that since CUDA needs the linux version of libcuda that only come with the nvidia driver, i am a bit unsure if it would be a "default wine" thing. A regular windows user do not install (nv)CUDA.dll libraries unless they use an NVIDIA adapter afaik. ...
We would either need: 1) to have it runtime detect the library (since distro builds could have the library where an end-user would not) or 2) we would need to build both the Unix and Windows library together and distribute them as an addon*
I have been working on improving CUDA support for wine here: https://github.com/SveSop/nvcuda/tree/devel , but i am unable to crack compatibility with CUDA SDK 11.6 and newer i am afraid.
Best, Erich
* I do not believe that our current addons (wine-gecko/wine-mono) have a way to distribute files on the Unix side of the line, but I haven't looked at this in a while
On Wed, Nov 16, 2022 at 10:46 AM Erich E. Hoover erich.e.hoover@gmail.com wrote:
- I do not believe that our current addons (wine-gecko/wine-mono) have
a way to distribute files on the Unix side of the line, but I haven't looked at this in a while
This is correct, they only contain PE/Windows binaries. Distributing unix code in this way would be more complicated because it needs to be available for all platforms Wine supports, not just Linux.
I don't think that addons are a good fit for wrapping native libraries.
On Wed, Nov 16, 2022 at 11:55 AM Esme Povirk (any/all) esme@codeweavers.com wrote:
On Wed, Nov 16, 2022 at 10:46 AM Erich E. Hoover erich.e.hoover@gmail.com wrote:
- I do not believe that our current addons (wine-gecko/wine-mono) have
a way to distribute files on the Unix side of the line, but I haven't looked at this in a while
This is correct, they only contain PE/Windows binaries. Distributing unix code in this way would be more complicated because it needs to be available for all platforms Wine supports, not just Linux.
If you were to take this route it would require building for all these platforms and storing them with the information that allows you to download the correct one ( like Python does with "wheels" / https://stackoverflow.com/a/41645556/185828 ).
I don't think that addons are a good fit for wrapping native libraries.
Yeah, I'm not really a fan either - the "autodetect the library at runtime" approach is much easier.
Best, Erich