Nvidia-libs in wine

Hello, I would like to get directions on how installing nvidia-libs support for wine , in order to have cuda support on windows only software
I installed the nvidia drivers from github marioroy/nvidia-driver-on-clear-linux

On other distros like arch - debian fedora etc I had luck simply installing GitHub - SveSop/nvidia-libs: Collection of nVidia libraries for use with Wine or Steam Proton. , requiring
[WINE]
[Meson]
[NINJA]
[MINGW] (version >= 9.0)

I did my best trying to find the right bundles , but the compilation always failed, showing some errors in meson, but I suspect mostly related to MINGW . I already installed all the bundles I could think about, specifically those for compiling pyenv : devpkg-ncurses sqlite devpkg-openssl tcl-basic devpkg-readline devpkg-bzip2 devpkg-sqlite-autoconf devpkg-libffi devpkg-xz user-basic-dev c-basic-mingw wineand who knows what, but onestly no luck.

Right now I’m back to arch, so I cannot reproduce errors-logs ,but I would like to be back on clearlinux if this can be fixed. Also, I might be missing something very obvious, but is there a way to search for bundles ? So far, beside google, the best luck I had was browsing here: clr-bundles/bundles at master · clearlinux/clr-bundles · GitHub

you can use swupd search-file to search for the exact file you may be missing, this should point you to the right bundle that you should install

1 Like

I made an issue for you Missing libwinecrt0.a in wine bundle · Issue #3069 · clearlinux/distribution · GitHub

1 Like

thank You so much, swupd search-file sounds really good, and I didn’t know dnf was installable … If I recall correctly, troubles were coming while compiling the libs, not from the lack of libwinecrt0.a . I also think that nvidia cuda patches were removed from wine-staging a long while ago, so, even installing wine-staging wouldn’t give access to cuda. Right now i’m on arch, using wine 9.3-1 (normal wine), and after installing GitHub - SveSop/nvidia-libs: Collection of nVidia libraries for use with Wine or Steam Proton. cuda works well

installing wine-staging 8.21-1 is not gonna help with cuda, afaik WINE Staging have removed CUDA support ? - WineHQ Forums

If I recall correctly, troubles were coming while compiling the libs, not from the lack of libwinecrt0.a

Not to worry, will probably end up seeing your error if this can be fixed. Then we can go from there.

I think I may have stumbled across your issue
stderr: x86_64-w64-mingw32-g++: error: unrecognized command line option '-mrelax-cmpxchg-loop'
Removing it from the CFLAGS gives this error
error: 'mutex' in namespace 'std' does not name a type
The fix for this is as of dxvk: troubleshooting is to have posix threading support enabled in the cross compiler. Looking at mingw-gcc it’s built with --enable-threads=win32 instead you need one built with --enable-threads=posix
building tips: gcc_crosscompile_setup_help

Thank You! I was just playing right now on a new cl install, and I was stumbling on this issue, so I was going to post the log file, but You’ve been quicker :slight_smile: So, if I understand correctly, i would have to recompile the c-basic-mingw bundle myself enabling the --enable-threads=posix flag? How can I install such self compiled bundle then? This is honestly going beyond my limited knowledge …

I post the log anyway… who knows… it might help

Build started at 2024-03-13T09:37:30.114146
Main binary: /usr/bin/python3
Build Options: -Denable_tests=true -Dprefix=/home/kurageart/nvidia-libs/compilato/nvidia-libs-nvlibs -Dlibdir=lib64 -Dbuildtype=release -Dstrip=True --cross-file=/home/kurageart/nvidia-libs/dxvk-nvapi/build-win64.txt
Python system: Linux
The Meson build system
Version: 1.3.2
Source dir: /home/kurageart/nvidia-libs/dxvk-nvapi
Build dir: /home/kurageart/nvidia-libs/compilato/nvidia-libs-nvlibs/build.64
Build type: cross build
Project name: dxvk-nvapi
Project version: v0.6.4
-----------
Detecting compiler via: `x86_64-w64-mingw32-g++ --version` -> 0
stdout:
x86_64-w64-mingw32-g++ (Clear Linux OS for Intel Architecture) 9.2.1 20191029 gcc-9-branch@277549
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------
Running command: x86_64-w64-mingw32-g++ -E -dM -
-----
-----------
Detecting linker via: `x86_64-w64-mingw32-g++ -Wl,--version -static -static-libgcc -static-libstdc++ -g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -Wformat -Wformat-security -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z,now -Wl,-z,relro -fno-semantic-interposition -ffat-lto-objects -fno-trapping-math -Wl,-sort-common -Wl,--enable-new-dtags -mrelax-cmpxchg-loop -ffunction-sections -fvisibility-inlines-hidden -Wl,--enable-new-dtags -std=gnu++17` -> 1
stderr:
x86_64-w64-mingw32-g++: error: unrecognized command line option '-mrelax-cmpxchg-loop'
-----------

meson.build:1:0: ERROR: Unable to detect linker for compiler `x86_64-w64-mingw32-g++ -Wl,--version -static -static-libgcc -static-libstdc++ -g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -Wformat -Wformat-security -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z,now -Wl,-z,relro -fno-semantic-interposition -ffat-lto-objects -fno-trapping-math -Wl,-sort-common -Wl,--enable-new-dtags -mrelax-cmpxchg-loop -ffunction-sections -fvisibility-inlines-hidden -Wl,--enable-new-dtags -std=gnu++17`
stdout: 
stderr: x86_64-w64-mingw32-g++: error: unrecognized command line option '-mrelax-cmpxchg-loop'

Ok … for those concerning, instead of going trough the “compile” way (that is not going to work anyway), on Releases · SveSop/nvidia-libs · GitHub You can get the last release and just install on your WINEPREFIX :cold_face:

2 Likes