dthpham / sminterpolate

Make motion interpolated and fluid slow motion videos from the command line.
MIT License
1.38k stars 91 forks source link

Windows: opencl call failed #103

Open SpaceMonkeyForever opened 5 years ago

SpaceMonkeyForever commented 5 years ago
Traceback (most recent call last):
  File "C:/msys64/mingw64/lib/python2.7/site-packages/cx_Freeze/initscripts/Console.py", line 27, in <module>
  File "butterflow/__main__.py", line 12, in <module>
  File "butterflow/cli.py", line 262, in main
RuntimeError: opencl call failed

I do have the latest nVidia driver installed. I'm using Windows 10.

wagesj45 commented 5 years ago

I've experienced the same problem. I've done some research into it and as far as I can tell the problem is the latest nVidia drivers. What, exactly, I can't tell. If you roll back your drivers you can fix the problems with butterflow, but you won't have the latest driver so there is a trade-off.

I haven't tested exactly which update caused the issue, I just randomly picked an old driver manually from nVidia's website, I think it was sub 400, but don't remember exactly. All I can say for sure is that an older driver (somewhere in the history) will work as a work around for now.

For what it is worth, I followed the instructions for building butterflow for windows, seeing if I could build against the latest drivers and maybe fix this issue. No dice. The build fails with a similar opencl failure when trying to build ffmpeg.

SpaceMonkeyForever commented 5 years ago

I see, thanks a lot! I find Python it be very unreliable on Windows overall tbh

EricHallahan commented 5 years ago

Have you installed a Windows DCH driver by chance? I have a feeling it is the issue.

wagesj45 commented 5 years ago

@EricHallahan could you elaborate please? The only display adapter I have installed is the nVidia driver. I should also say that I experience this issue on another machine that has an AMD processor, thus no Intel onboard video. I'll include a screenshot of my display drivers just for clarity.

image

EricHallahan commented 5 years ago

I'm sorry, I originally had a longer post, but my computer decided to crash. :)

Windows DCH is Microsoft's new driver format for a Universal Windows world: the point is that it automatically choses ARM or x86-64 binaries upon the host ISA. I was wondering if it could be the culprit, as both NVIDIA and Intel have the new drivers. (The latest version GPU-Z will tell you if you have it.) OpenCL 2 runs fine on my machine though (I ran LuxMark to be sure), so I am starting to doubt it now. I now think it is more a compatibility issue on Butterflow's side, maybe OpenCV 3.

Aidiakapi commented 5 years ago

I just downloaded butterflow to try it out, but get the exact same error. I'm on the latest standard (non-DCH) drivers (419.17, 2019-02-20), Windows 10 Pro.

EricHallahan commented 5 years ago

Okay, was just a thought.

Kronos256 commented 5 years ago

i have exactlly the same issue :/

lambdan commented 5 years ago

I also had the same issue, and just like @wagesj45 said going back to an older driver worked. I went straight to 399.24. Performed a clean install, didn't even reboot, and now butterflow works.

Tifik commented 5 years ago

The latest Driver version wich works is 416.34

excxp commented 5 years ago

i think i found the problem: butterflow expects the pathname to 64bit opencl dll to be installed at: HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenCL\Vendors

and 32bit dll at: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Khronos\OpenCL\Vendors

For some reason recent nvidia driver installers do not setup the regkeys. if you want to get butterflow working with latest nvidia drivers, manually installing the regkeys worked for me:

do a search in your windows folder for nvopencl64.dll and nvopencl32.dll (it should be in driverstore, use the one from your latest nvidia driver). here's an example of the regkeys to install :

[HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenCL\Vendors] "C:\Windows\System32\nvopencl64.dll"=dword:00000000

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Khronos\OpenCL\Vendors] "C:\Windows\System32\nvopencl32.dll"=dword:00000000

dthpham commented 5 years ago

@excxp Great find. I'll try to make BF point to the right DLLs automatically in the next release.

irfanfadilah commented 5 years ago

@excxp your solution is working fine. But in my case, the location of the dll files are located at:

C:\Windows\System32\DriverStore\FileRepository\nvmii.inf_amd64_995a8ca55addcada\nvopencl64.dll

and

C:\Windows\System32\DriverStore\FileRepository\nvmii.inf_amd64_995a8ca55addcada\nvopencl32.dll
Anime4000 commented 5 years ago

@excxp it works with AMD as well! Administrator Command Prompt Administrator Command Prompt - butterflow  -v -sm -r 60  sppl_01_op avi -o  test mp4 Edit DWORD (32-bit) Value

ChaoticBlankness commented 5 years ago

@dthpham 0.2.4a2 fixed AMD detection for me. Thanks!!

Had been using the above regedit fix, removed that before testing alpha2 and all seems well. =D

ChaoticBlankness commented 5 years ago

@dthpham @wagesj45 I spoke too soon. While 0.2.4a2 correctly reports with butterflow -d

OpenCL devices: Platform : AMD Accelerated Parallel Processing Platform Vendor : Advanced Micro Devices, Inc. Platform Version : OpenCL 2.1 AMD-APP (2906.9)

It does not however work with or without the registry edit fix. butterflow -r 2x test.MOV

Traceback (most recent call last): File "C:/msys64/mingw64/lib/python2.7/site-packages/cx_Freeze/initscripts/startup.py", line 14, in run File "C:/msys64/mingw64/lib/python2.7/site-packages/cx_Freeze/initscripts/Console.py", line 26, in run File "butterflow/main.py", line 8, in File "butterflow/cli.py", line 288, in main RuntimeError: opencl call failed

**This same .MOV works correctly using 0.2.4a1 with the registry edit.

ghost commented 5 years ago

^ Same here. Anyone have the 0.2.4a1 build?

dthpham commented 5 years ago

Good to know device detection is working again. @BrimsonBhin I re-uploaded a1 and you can download it here. Going to try to get everything fixed in the next few days.

goocy commented 5 years ago

Nvidia user here. Just in case you don't know already: the regfix works for r1, but not for r3.

My dll location was also in System32/FileRepository/...

yhyu13 commented 5 years ago

win10 x64 user, nvidia 430.16 works

soulx commented 5 years ago

Win10x64 not working with regkey fix C:\Windows\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_547eeefb57db4499\nvopencl64.dll

OpenCL devices: Platform : NVIDIA CUDA Platform Vendor : NVIDIA Corporation Platform Version : OpenCL 1.2 CUDA 10.1.120

Traceback (most recent call last): File "C:/msys64/mingw64/lib/python2.7/site-packages/cx_Freeze/initscripts/startup.py", line 14, in run File "C:/msys64/mingw64/lib/python2.7/site-packages/cx_Freeze/initscripts/Console.py", line 26, in run File "butterflow/main.py", line 34, in File "butterflow/cli.py", line 288, in main RuntimeError: opencl call failed

**EDIT Fixed in 0.2.4a4

EricHallahan commented 5 years ago

Just another report to help with 0.2.4a3 for Intel systems:

PS C:\WINDOWS\system32> butterflow -d
OpenCL devices:
  Platform              : Intel(R) OpenCL
  Platform Vendor       : Intel(R) Corporation
  Platform Version      : OpenCL 2.1
*  Device 0             : Intel(R) UHD Graphics 620
      Version           : OpenCL 2.1
      Version           : 26.20.100.6999
      Work Sizes        : 256, 256x256x256
      Compatible        : Yes
*  Device 1             : Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
      Version           : OpenCL 2.1
      Version           : 7.6.0.0228
      Work Sizes        : 8192, 8192x8192x8192
      Compatible        : Yes

Running provides RuntimeError: opencl call failed as @ChaoticBlankness reported.

3dfoster commented 5 years ago

i think i found the problem: butterflow expects the pathname to 64bit opencl dll to be installed at: HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenCL\Vendors

and 32bit dll at: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Khronos\OpenCL\Vendors

For some reason recent nvidia driver installers do not setup the regkeys. if you want to get butterflow working with latest nvidia drivers, manually installing the regkeys worked for me:

do a search in your windows folder for nvopencl64.dll and nvopencl32.dll (it should be in driverstore, use the one from your latest nvidia driver). here's an example of the regkeys to install :

[HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenCL\Vendors] "C:\Windows\System32\nvopencl64.dll"=dword:00000000

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Khronos\OpenCL\Vendors] "C:\Windows\System32\nvopencl32.dll"=dword:00000000

I tried this fix on my laptop with Ryzen Mobile but when I run the butterflow command my terminal hangs: nothing outputs and I don't see a process in task manager with any CPU usage. I am using alpha1 release as instructed.

Can someone let me know if I've set up my registry key correctly?

reg

Here are the locations I have opencl dll files:

dlls

Using --show-devices on alpha3 outputs the following:

devices
dthpham commented 5 years ago

~To be clear a3 expects the registry keys to be set at HKEY_CURRENT_USER\Software\Khronos\OpenCL\Vendors, while~ Alpha1 and earlier expects keys to be set at HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenCL\Vendors.

I've found that you don't really need to set the full path of the driver but just the driver name so nvopencl64.dll, amdocl64.dll, IntelOpenCL64.dll or whatever will do.

@fasterthan That looks fine. The output is showing it's detecting your devices. Try running with -v to see verbose output. Try selecting the device you want to use with -device \<number>. There's a bug with device selection in a1 and up. If the right device isn't being selected or if you're getting an opencl error try selecting device negative one, so: -device -1.

Edit: Going forward, a4 and future releases will expect keys to be set at HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenCL\Vendors. Use the full path of your drivers just in case.

bensontrent commented 5 years ago

The butterflow readme for windows setup doesn't include instructions to set up the 32 bit key at [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Khronos\OpenCL\Vendors] "C:\Windows\System32\nvopencl32.dll"=dword:00000000

I added the 64-bit key, but Butterflow would not work without the 32-bit reference, even on a 64-bit machine. I'll submit a PR.

Tylemagne commented 4 years ago

Fixed using @excxp solution. I recommend everyone use voidtools' Everything to search and find the latest DLLs. amdocl.dll and amdocl64.dll were in folders created by the Radeon 2020 drivers with each install version.