LeelaChessZero / lc0

The rewritten engine, originally for tensorflow. Now all other backends have been ported here.
GNU General Public License v3.0
2.47k stars 534 forks source link

DirectX 12 Error: "Unspecified Error" #1128

Closed Caleb-Kang closed 4 years ago

Caleb-Kang commented 4 years ago

DirectX 12 Error: "Unspecified Error"

Hello. I downloaded lc0-v0.24.0-windows10-gpu-dx12.zip and extracted all. First I ran the Windows Batch file, check_dx. Then there was some error that appeared at the bottom. Here are the results:


Sanity checking the dx12 driver. | | | | | |_| v0.24.0+git.2449d9e built Mar 11 2020 Found pb network file: C:\Users\Iwontspecifythispart\Desktop\leela\lichess-bot-master\engines\lc0-v0.24.0-windows10-gpu-dx12/latest.txt Creating backend [check]... Working backend set to blas. Reference backend set to dx12. Creating backend [blas]... Using Eigen version 3.3.5 BLAS max batch size is 256. Creating backend [dx12]... Dx error: Unspecified error (c:\projects\lc0\src\neural\dx\shader_wrapper.cc:122) Press any key to continue . . .


Below is hardware and software information. Lc0 version: v0.24.0 (https://github.com/leelachesszero/lc0/releases) Operating System: Windows 10 Home Backend Type: DirectX 12 UCI Lc0 parameters: weights, threads, gpu, tempdecay, noise, log.

Hardware: Acer Nitro 5 Number of GPUs: 2 Model of GPUs: Radeon RX 560X Series, AMD Radeon(TM) Vega 8 Graphics Amount of RAM in the system: 8.00 GB (6.90 GB usable) CPU: AMD Ryzen 5 2500U with Radeon Vega Mobile Gfx 2.00 GHz

Can somebody help me?

borg323 commented 4 years ago

What is the version number of windows 10 you are using, and do you have the latest GPU drivers? Also does this happen with both GPUs? (Add -bbackend-opts=gpu=1 to test the second GPU).

Caleb-Kang commented 4 years ago

Edition: Windows 10 Home Version: 1909 OS build: 18363.720

How do I check if I have the latest GPU drivers? Where do I add the -bbackend-opts=gpu=1 command?

Caleb-Kang commented 4 years ago

I run lc0 as a lichess-bot with https://github.com/ShailChoksi/lichess-bot. I am using the OpenCL backend for now, but I want to try DX12 for better gameplay.

Naphthalin commented 4 years ago

@CalKK8 this looks very similar to what I encountered with my Laptop as well, AMD 2500U, when the driver version is too old. Please check "device manager" --> "GPUs" --> "driver" and post the driver version (alternatively: "dxdiag" --> "display" --> "driver")

Caleb-Kang commented 4 years ago

@Naphthalin GPU 0 Radeon RX 560X Series

Driver version: 23.20.826.3072
Driver date:    6/16/2018
DirectX version:    12 (FL 12.0)
Physical location:  PCI bus 1, device 0, function 0 

GPU 1 AMD Radeon(TM) Vega 8 Graphics

Driver version: 23.20.826.3072
Driver date:    6/16/2018
DirectX version:    12 (FL 12.1)
Physical location:  PCI bus 4, device 0, function 0
Caleb-Kang commented 4 years ago

If the GPU Drivers need to be updated, how can I do it?

Naphthalin commented 4 years ago

Yes, this driver is definitely too old, the necessary dx commands weren't implemented yet.

Easiest way to update: "device manager" --> "GPU" --> "RX 560X" --> "driver" --> "update driver". My PC shows version 26.20.15019.19000 there, dated 2020/02/28.

However I couldn't update the driver myself yet on my Notebook, as the newer driver freezes when idle, and I had to revert to the older driver version by clicking "previous driver" just below the "update" field. Just in case that happens to you as well, make sure that your power button will bring your machine to standby before updating. If it freezes, bring it into standby and wake it up again, then open youtube and play a video, as that prevents the idle mode. Then you can revert the driver version.

(current driver version on my laptop: 26.20.12028.2 from 2019/08/16 is still too old, 26.20.15019.1003 from 2020/01/30 is the version I can update to, but freezes my machine, as do all other 2020 AMD drivers)

Caleb-Kang commented 4 years ago

@Naphthalin I could not find "GPU" in the device manager. Is there any other way to update it?

Naphthalin commented 4 years ago

I have no Idea what language your OS is in. It is definitely there, around position 7.

Caleb-Kang commented 4 years ago

My OS language is English.

Caleb-Kang commented 4 years ago

I have updated the drivers and this is the result GPU 0

Radeon RX 560X Series

Driver version: 26.20.11028.1002
Driver date:    8/26/2019
DirectX version:    12 (FL 12.0)
Physical location:  PCI bus 1, device 0, function 0

Utilization 0%
Dedicated GPU memory    0.0/4.0 GB
Shared GPU memory   0.0/3.5 GB
GPU Memory  0.0/7.5 GB
mooskagh commented 4 years ago

@CalKK8 with the updated drivers, do you still have the same error when you run Lc0?

Naphthalin commented 4 years ago

do you still get the same error? I would assume that this driver is still too old...

You can always download the latest driver directly from AMD (anything from january/february 2020 should work), as it seems that your vendor doesn't have the current driver.

Caleb-Kang commented 4 years ago

My driver did not work with DX12, so I uninstalled my RX 560X Series GPU and am installing one from AMD's website. Hopefully, this works...


Is there any other way to update the driver to 2020?

Naphthalin commented 4 years ago

@CalKK8 did updating the driver from the AMD site work? which driver version did you try?

Caleb-Kang commented 4 years ago

Apparently, my driver did not update. But here are the results. check_dx

Naphthalin commented 4 years ago

Which driver version did you try to install, and which do you have installed?

Caleb-Kang commented 4 years ago

It's a lot to explain.

I uninstalled the previous RX 560X GPU and reinstalled it from AMD's website. A Google search said that I could update the GPU through "AMD Radeon Settings," so I was aiming to use that. But when my computer restarted, AMD Radeon Settings was replaced with AMD Radeon Software, and unfortunately, my driver was not updated. I cannot figure out how to update my driver through Radeon Software.

GPU 0

Radeon RX 560X Series

Driver version: 26.20.11028.1002
Driver date:    8/26/2019
DirectX version:    12 (FL 12.0)
Physical location:  PCI bus 1, device 0, function 0

Can the lc0 team add support for older GPU drivers?

Naphthalin commented 4 years ago

Can the lc0 team add support for older GPU drivers?

No, it can't, as the necessary optimizations aren't included in the older GPU drivers yet. Can you post the link where you downloaded the driver/AMD Software?

Caleb-Kang commented 4 years ago

https://www.amd.com/en/support/apu/amd-ryzen-processors/amd-ryzen-5-mobile-processors-radeon-vega-graphics/amd-ryzen-5

Naphthalin commented 4 years ago

for me this site displays a 20.3.1 which should install a newer driver version as well -- did you install this?

Caleb-Kang commented 4 years ago

Yes, I did.

AMD Radeon Software says: Software Version - 2020.0228.1832.33370 Driver Version - 19.10.28.01-190826a-345857C-Acer Provider - Advanced Micro Devices, Inc. 2D Driver Version - 8.1.1.1634 Direct3D® Version - 9.14.10.01394 OpenGL® Version - 26.20.11000.13560 AMD Audio Driver Version - 10.0.1.12 Vulkan™ Driver Version - 2.0.87 Vulkan™ API Version - 1.1.106 Windows Version - Windows 10 (64 bit)

Naphthalin commented 4 years ago

Does the dx12 version work now, and which AMD driver version do you have installed now?

Caleb-Kang commented 4 years ago

My driver was not updated. Right now, I still have 8/26/2019

Caleb-Kang commented 4 years ago

I tried updating the drivers through Device Manager, but it already found the "best drivers." How strong is DX12 compared to the CUDA+CUDNN backend?

Naphthalin commented 4 years ago

Without a 20.x driver the dx12 backend won't work as intended; you already posted the link above.

How strong is DX12 compared to the CUDA+CUDNN backend?

cuda + cudnn only work for nvidia cards; for them, the cudnn backend and dx12 basically have the same performance, and e.g. my RX Vega 56 with dx12 backend gives comparable performance to a 1080.

Caleb-Kang commented 4 years ago

So to update my driver, do I necessarily need to uninstall the old one and install the new one? How well will an RX 560X Series (DX12) compare to NVidia CUDA + CUDNN?

Caleb-Kang commented 4 years ago

Hi guys, I was able to update my driver by rolling it back, and I think the DX 12 backend works. Thanks! You all can close this issue. Thank you @Naphthalin especially :)

Naphthalin commented 4 years ago

Good to hear that :) If you encounter problems with Lc0 not working with a driver version we expect to work properly, let us know please.