GPU problem -- not game-related

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
salmo6
Level 2
Level 2
Posts: 10
Joined: Mon Sep 06, 2021 8:44 pm

GPU problem -- not game-related

Post by salmo6 »

I use Wine extensively to run Topaz photo-enhancing software, especially Topaz DeNoise AI, which removes digital noise from photos. It was the capability to use CPU or GPU. It runs great when I use the CPU. But when I set it to use the GPU (nVidia GeForce GTX 1660 Super) for faster performance, it not only freezes the app, but freezes my whole X session. Is there a suggested procedure to troubleshoot this, or am I destined to continue as I've been doing, and ignoring my GPU while using Wine?
jkfloris
Level 12
Level 12
Posts: 3136
Joined: Thu Aug 14, 2014 10:10 am

Re: GPU problem -- not game-related

Post by jkfloris »

To make use of the GPU, CUDA is required. This is not yet in Wine, and since version 7.22 it is disabled in wine-staging. You can install CUDA from https://github.com/SveSop/nvidia-libs

(Note: This program also requires vcrun2019)
salmo6
Level 2
Level 2
Posts: 10
Joined: Mon Sep 06, 2021 8:44 pm

Re: GPU problem -- not game-related

Post by salmo6 »

Thanks for the pointer. That's gotten me started in the right direction. But that nvidia-libs package won't compile. I get a ton of C syntax errors (mostly "expected declaration specifiers before ‘CUresult’"), ending with:

winegcc: /usr/bin/gcc failed
ninja: build stopped: subcommand failed.

I'm on Fedora 37, with gcc-12.2 and wine-devel-8.0.

Is that nvidia-libs package maybe looking for a different (older?) version of gcc?
jkfloris
Level 12
Level 12
Posts: 3136
Joined: Thu Aug 14, 2014 10:10 am

Re: GPU problem -- not game-related

Post by jkfloris »

Ready-to-use files are also provided:
https://github.com/SveSop/nvidia-libs/r ... tag/v0.7.6
salmo6
Level 2
Level 2
Posts: 10
Joined: Mon Sep 06, 2021 8:44 pm

Re: GPU problem -- not game-related

Post by salmo6 »

Thanks. I don't know how I missed those. Anyway, nvidia-libs is installed now, but I'm still getting the same error whenever I set Topaz DeNoise to use the GPU instead of the CPU. As soon as it starts working, it crashes. The backtrace shows:

Unhandled exception: divide by zero in 64-bit code (0x0000005bfafc4d).

(I have the whole backtrace if anyone really wants to see it.)

I have winetricks vcrun2019 running in a separate window, but I don't really get how I'm supposed to use vcrun2019, so if I'm doing that bit wrong, I'd welcome a correction.
jkfloris
Level 12
Level 12
Posts: 3136
Joined: Thu Aug 14, 2014 10:10 am

Re: GPU problem -- not game-related

Post by jkfloris »

With following steps, the program seems to work:
- Create a new prefix and install vcrun2019

Code: Select all

WINEPREFIX="${HOME}/Topaz" winetricks -q vcrun2019
- Install Topaz DeNoise in the new wineprefix

Code: Select all

# cd /to/the/directory/where/the/installer/is/stored 
WINEPREFIX="${HOME}/Topaz" wine TopazDeNoiseAI-3.7.0-windows-x64-Full-Installer.exe
# Don't start the program after the installation
- Install the nvidia-libs

Code: Select all

# cd /to/the/directory/where/the/nvidia-libs/is/stored 
WINEPREFIX="${HOME}/Topaz" bash setup_nvlibs.sh install
- Run Topaz DeNoise

Code: Select all

cd "${HOME}/Topaz/drive_c/Program Files/Topaz Labs LLC/Topaz DeNoise AI"
WINEPREFIX="${HOME}/Topaz" wine "Topaz DeNoise AI.exe"
If this still does not work, check that the cuda libraries are installed.
On Fedora these are in the xorg-x11-drv-nvidia-cuda-libs packages.

Code: Select all

sudo ldconfig -p | grep libcuda
	libcuda.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libcuda.so.1
	libcuda.so.1 (libc6) => /lib/i386-linux-gnu/libcuda.so.1
	libcuda.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libcuda.so
	libcuda.so (libc6) => /lib/i386-linux-gnu/libcuda.so
salmo6
Level 2
Level 2
Posts: 10
Joined: Mon Sep 06, 2021 8:44 pm

Re: GPU problem -- not game-related

Post by salmo6 »

Thank you! That worked (I think). I'm going to save that for future reference.

It did raise some follow-up questions that I'm not sure are Wine-related or app-related:

1. Previously, the option in the app for selecting GPU showed my actual GPU: nVidia GeForce GTX 1660 Super. Now it just shows "Default GPU". Is there something that would now be obscuring the GPU info?

2. When I select "Default GPU", it doesn't crash any more, but the processing speeds are the same as with CPU. But if I select the third option, "Auto", it runs faster, in just over half the time.

Together these have me wondering if I'm not using the GPU after all.
jkfloris
Level 12
Level 12
Posts: 3136
Joined: Thu Aug 14, 2014 10:10 am

Re: GPU problem -- not game-related

Post by jkfloris »

1. Previously, the option in the app for selecting GPU showed my actual GPU: nVidia GeForce GTX 1660 Super. Now it just shows "Default GPU". Is there something that would now be obscuring the GPU info?
Right, I noticed that too. Perhaps it's better to ask this question on the github page.
2. When I select "Default GPU", it doesn't crash any more, but the processing speeds are the same as with CPU. But if I select the third option, "Auto", it runs faster, in just over half the time.
You can check if the GPU is being used with nvtop and the CPU with htop

Keep in mind that the nvcuda drivers are very experimental.
salmo6
Level 2
Level 2
Posts: 10
Joined: Mon Sep 06, 2021 8:44 pm

Re: GPU problem -- not game-related

Post by salmo6 »

Well, nvtop and htop both show that I'm still just using the CPU, not the GPU, so it appears that the drivers aren't really working for this application. For now I'll just be content with using the CPU. It's not that bad. Thanks for all the help.
Locked