darktable-org / darktable

darktable is an open source photography workflow application and raw developer
https://www.darktable.org
GNU General Public License v3.0
9.91k stars 1.15k forks source link

OpenCL? crash when running on Windows #9887

Closed Rybec closed 3 years ago

Rybec commented 3 years ago

Crashes when attempting to run. The program never gets to a point where the window is displayed. (A console window does pop up and instantly disappear.)

This may be related to the fact that I am also mining crypto, which uses OpenCL (the backtrace implicates AMD's OpenCL driver), however it still crashes even when not mining. This is the OpenCL information provided when the miner starts up, in case that helps: "Ellesmere OpenCL 2.0 AMD-APP (2527.7) Memory : 8.00 GB (8589934592 B)". It may be worth noting also that my AMD card is significantly underclocked and operating at a much lower than normal power level (to deal with heat issues when mining, as the system wasn't designed to handle extreme heat generation).

Platform I've provided what I remember off the top of my head. If more specific information is needed, please let me know, and I will provide it as soon as I have time.

Backtrace file:

this is darktable 3.6.0 reporting an exception:


Error occurred on Friday, August 27, 2021 at 21:38:28.

darktable.exe caused an Access Violation at location 00007FF99015434A in module amdocl64.dll Reading from location 0000000000000020.

AddrPC Params 00007FF99015434A 0000000000000000 0000000000000000 0000000000000000 amdocl64.dll!clGetPipeInfo 00007FF990154260 000001B59B7D5060 0000000000000000 000001B59B7D5920 amdocl64.dll!clGetPipeInfo 00007FF99015287D 000001B59B7D8EA0 000001B59B7D5920 0000000000000000 amdocl64.dll!clGetPipeInfo 00007FF990150F22 000001B59B7D4FF0 000001B59B7D4DC0 0000000000000000 amdocl64.dll!clGetPipeInfo 00007FF9901348DD 000001B5B87D5BB0 0000000000000000 0000000000000000 amdocl64.dll!clGetPipeInfo 00007FF99011EE0E 000001B5B87D5BB0 0000000000000000 0000000000000000 amdocl64.dll!clGetPipeInfo 00007FF99013EE79 0000000000000000 0000000000000000 0000000000000000 amdocl64.dll!clGetPipeInfo 00007FF9F04E4034 0000000000000000 0000000000000000 0000000000000000 KERNEL32.DLL!BaseThreadInitThunk 00007FF9F2663691 0000000000000000 0000000000000000 0000000000000000 ntdll.dll!RtlUserThreadStart

darktable.exe 3.6.0.0 ntdll.dll 10.0.17134.1425 KERNEL32.DLL 10.0.17134.1425 KERNELBASE.dll 10.0.17134.1610 msvcrt.dll 7.0.17134.1 libintl-8.dll 0.19.8.0 ADVAPI32.dll 10.0.17134.471 sechost.dll 10.0.17134.1610 libdarktable.dll RPCRT4.dll 10.0.17134.1130 libglib-2.0-0.dll 2.68.3.0 ole32.dll 10.0.17134.1038 GDI32.dll 10.0.17134.285 gdi32full.dll 10.0.17134.1667 combase.dll 10.0.17134.1550 libcairo-2.dll exchndl.dll 0.9.2.0 ucrtbase.dll 10.0.17134.677 USER32.dll 10.0.17134.1667 PSAPI.DLL 10.0.17134.1 msvcp_win.dll 10.0.17134.619 win32u.dll 10.0.17134.1 SHELL32.dll 10.0.17134.1610 bcryptPrimitives.dll 10.0.17134.1488 cfgmgr32.dll 10.0.17134.1 WS2_32.dll 10.0.17134.1098 shcore.dll 10.0.17134.1610 libgdk-3-0.dll 3.24.29.0 windows.storage.dll 10.0.17134.1610 libgdk_pixbuf-2.0-0.dll 2.42.4.0 IMM32.dll 10.0.17134.1 shlwapi.dll 10.0.17134.1 SETUPAPI.dll 10.0.17134.1 kernel.appcore.dll 10.0.17134.112 libgio-2.0-0.dll 2.68.3.0 profapi.dll 10.0.17134.1 powrprof.dll 10.0.17134.1 libgobject-2.0-0.dll 2.68.3.0 FLTLIB.DLL 10.0.17134.1 libharfbuzz-0.dll libgtk-3-0.dll 3.24.29.0 libpangocairo-1.0-0.dll 1.48.5.0 libpango-1.0-0.dll 1.48.5.0 zlib1.dll libiconv-2.dll 1.16.0.0 MSIMG32.dll 10.0.17134.1 mgwhelp.dll 0.9.2.0 comdlg32.dll 10.0.17134.1 libwinpthread-1.dll 1.0.0.0 libgcc_s_seh-1.dll libstdc++-6.dll libgomp-1.dll libavif.dll libexiv2.dll libcurl-4.dll CRYPT32.dll 10.0.17134.1246 libgmodule-2.0-0.dll 2.68.3.0 libgphoto2-6.dll MSASN1.dll 10.0.17134.1 WLDAP32.dll 10.0.17134.1 libgphoto2_port-12.dll libGraphicsMagick-3.dll libfontconfig-1.dll libicuuc68.dll libicuin68.dll libIlmImf-2_5.dll libfreetype-6.dll 2.10.4.0 libpixman-1-0.dll libpng16-16.dll libjpeg-8.dll libjson-glib-1.0-0.dll libopenjp2-7.dll liblcms2-2.dll libpugixml.dll 1.11.0.0 librsvg-2-2.dll libsecret-1-0.dll libsqlite3-0.dll libsoup-2.4-1.dll libxml2-2.dll libtiff-5.dll libpcre-1.dll dwmapi.dll 10.0.17134.1 gdiplus.dll 10.0.17134.1667 DNSAPI.dll 10.0.17134.1667 IPHLPAPI.DLL 10.0.17134.1 WINMM.dll 10.0.17134.1 NSI.dll 10.0.17134.1 libcairo-gobject-2.dll libepoxy-0.dll libfribidi-0.dll libpangowin32-1.0-0.dll 1.48.5.0 libffi-7.dll VERSION.dll 10.0.17134.1 USP10.dll 10.0.17134.1130 libgraphite2.dll libpangoft2-1.0-0.dll 1.48.5.0 libthai-0.dll dbghelp.dll 10.0.17134.1 WINSPOOL.DRV 10.0.17134.753 COMCTL32.dll 6.10.17134.1667 libatk-1.0-0.dll 2.36.0.0 libdav1d.dll 5.1.0.0 libexpat-1.dll libaom.dll rav1e.dll libexif-12.dll libltdl-7.dll libsystre-0.dll libbz2-1.dll libbrotlidec.dll libidn2-0.dll libcrypto-1_1-x64.dll 1.1.1.11 libnghttp2-14.dll libpsl-5.dll libssh2-1.dll libzstd.dll libssl-1_1-x64.dll 1.1.1.11 libHalf-2_5.dll libicudt68.dll libIex-2_5.dll libIlmThread-2_5.dll libImath-2_5.dll USERENV.dll 10.0.17134.1098 libgcrypt-20.dll 1.9.2.0 liblzma-5.dll 5.2.5.0 libdeflate.dll libjbig-0.dll libwebp-7.dll winmmbase.dll 10.0.17134.1 libdatrie-1.dll bcrypt.dll 10.0.17134.885 PROPSYS.dll 7.0.17134.982 OLEAUT32.dll 10.0.17134.1610 libtre-5.dll libunistring-2.dll 0.9.10.0 libbrotlicommon.dll libgpg-error-0.dll 1.42.0.0 dbgcore.DLL 10.0.17134.1 CRYPTBASE.DLL 10.0.17134.1 CRYPTSP.dll 10.0.17134.1 rsaenh.dll 10.0.17134.254 uxtheme.dll 10.0.17134.1345 Nahimic2DevProps.dll 2.5.27.49023 Nahimic2OSD.dll 2.5.27.49023 clbcatq.dll 2001.12.10941.16384 NahimicVRDevProps.dll MMDevApi.dll 10.0.17134.1 DEVOBJ.dll 10.0.17134.1 AUDIOSES.DLL 10.0.17134.1488 wintypes.dll 10.0.17134.1550 AVRT.dll 10.0.17134.1 mswsock.dll 10.0.17134.1456 MSCTF.dll 10.0.17134.1667 WINTRUST.dll 10.0.17134.556 OpenCL.dll 2.2.5.0 dxgi.dll 10.0.17134.112 amdocl64.dll 10.0.2906.10 OPENGL32.dll 10.0.17134.1 GLU32.dll 10.0.17134.1 atiadlxx.dll 26.20.13001.50005 atig6txx.dll 26.20.13001.50005 amdocl12cl64.dll 0.8.0.0 amdcomgr64.dll nvopencl64.dll 26.21.14.4587 AppXDeploymentClient.dll 10.0.17134.1488 StateRepository.Core.dll 10.0.17134.112 nvapi64.dll 26.21.14.4587 amdocl64.dll 23.20.15002.11 Windows.ApplicationModel.dll 10.0.17134.1610 twinapi.appcore.dll 10.0.17134.1610 RMCLIENT.dll 10.0.17134.950 amdocl12cl64.dll 23.20.15002.11 mrmcorer.dll 10.0.17134.1610 iertutil.dll 11.0.17134.1610 Windows.UI.dll 10.0.17134.1 TextInputFramework.dll 10.0.17134.858 InputHost.dll CoreUIComponents.dll 10.0.17134.376 CoreMessaging.dll 10.0.17134.1488 ntmarta.dll 10.0.17134.1 bcp47mrm.dll 10.0.17134.1 nvcompiler64.dll 26.21.14.4587

Windows 10.0.17134 DrMingw 0.9.2

johnny-bit commented 3 years ago

This is clearly issue with AMD driver. Given that you have AMD and nVidia cards the drivers might now like each other ;)

johnny-bit commented 3 years ago

Please report opencl issue with amd driver to https://community.amd.com/t5/opencl/bd-p/opencl-discussions and report back here. In the mean time - closing since there's literally nothing we can do.

As for possible workarounds: check the manual - you should be able to disable opencl completely OR you can try to make sure that darktable uses ONLY nVidia card which might just work.

Rybec commented 3 years ago

Thanks for looking at this. I'll try disabling OpenCL first, and I think I found the instructions for selecting a different video card, so I'll try the Nvidia one for that as well. I'll also report on AMD's support forum.

My system is definitely unusual. I prefer AMD for graphics, but Nvidia is objectively better for machine learning. Surprisingly, I've never had any issues with using them together, aside from maybe this. (And now I've done both machine learning and crypto mining without issues.) Using the Nvidia card for the OpenCL stuff with darktable sounds good to me!

Anyhow, I'll report back on how these work and on what kind of respond I get from the AMD forum. Even if it doesn't provide some way to work around this in code, maybe it will help other users who run into similar issues (if there are any...).

johnny-bit commented 3 years ago

If you learn something new I bet the https://darktable-org.github.io/dtdocs/special-topics/opencl/ section would benefit from having improvements, which you should sent to https://github.com/darktable-org/dtdocs :)

Rybec commented 3 years ago

Ok, so one question: I'm trying to edit darktablerc to change some of the configuration stuff. It doesn't seem to be having any effect. My guess is that there is some OS dependent stuff going on. The manual currently doesn't have much for Windows. There is a darktablerc in the share/darktable/ directory within the install directory for darktable, but changing that is not doing anything. (And there is no $HOME/.config that I can find, either in my Windows home more my MinGW home.) So where is the darktablerc stored, in Windows?

I'm not sure about disabling specific drivers, to exclude my AMD card. I might be able to do it by adjust device priority, but the documentation doesn't really go into what happens if you exclude a device for all activities.

On an interesting side note: I ran it with -d opencl, and I looked through the output. It is reporting 3 "platforms" and 4 "devices" (not sure what this means, exactly). Device 0 is my AMD card. Device 1 is my Nvidia card. Device 2 is my AMD card again. This is where the output ends and the program crashes. Not sure if this is useful in any way. It looks like it is crashing when it tries to initialize my AMD card a second time. It might mean I can just exclude device 2 to avoid the crash (if excluding it in device priorities does prevent it from trying to initialize it), allowing my AMD card to still be used.

Also, running with --disable-opencl does work. Honestly, my machine can probably do perfectly fine without it. Since I designed it for machine learning, it has a fairly decent 6 core CPU. I would like to see if I can make this work though, even if it is only with the Nvidia card.

johnny-bit commented 3 years ago

the config file on windows is on C:\Users\[username]\AppData\Local\darktable\darktablerc (available info from https://www.darktable.org/about/faq/)

Rybec commented 3 years ago

Alright, thanks! (Guess I should go through the FAQ again...) I'll take a look tomorrow and see what I can discover.