LeelaChessZero / lc0

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

Unhandled exception: clGetPlatformIDs #1522

Open batot1 opened 3 years ago

batot1 commented 3 years ago

Hello,

Im trying run Lc0 on Linux firsth time. Compiled and trying run and get something this:

$ ./lc0 
       _
|   _ | |
|_ |_ |_| v0.23.3+git.29c15a4 built Feb 11 2021
go nodes 100
Found pb network file: ./weight
Creating backend [opencl]...
OpenCL, maximum batch size set to 16.
Initializing OpenCL.
OpenCL: clGetPlatformIDs
Unhandled exception: clGetPlatformIDs
Aborted (core dumped)

Maybe sombady know what is it wrong?

installed opencl-headers (2:2020.12.18-1)
$ uname -a
Linux xxx 5.4.94-1-lts #1 SMP Sat, 30 Jan 2021 14:14:01 +0000 x86_64 GNU/Linux
$ pacman -Q cuda
cuda 11.2.0-3
$ lspci |grep -i vga
01:00.0 VGA compatible controller: NVIDIA Corporation GF119 [NVS 310] (rev a1)
$ ls /etc/OpenCL/vendors
nvidia.icd
$ clinfo
Number of platforms 0

Maybe this help us:

$ sudo pacman -Ss opencl
extra/libclc 11.0.1-1
    Library requirements of the OpenCL C programming language
extra/ocl-icd 2.2.14-1 [installed]
    OpenCL ICD Bindings
extra/opencl-clhpp 2.0.13-1
    OpenCL C++ header files
extra/opencl-headers 2:2020.12.18-1 [installed]
    OpenCL (Open Computing Language) header files
extra/opencl-mesa 20.3.4-1
    OpenCL support for AMD/ATI Radeon mesa drivers
extra/opencl-nvidia 460.39-1
    OpenCL implemention for NVIDIA
community/clinfo 3.0.20.11.20-1
    Simple OpenCL application that enumerates all available platform and device properties
community/clpeak 1.1.0-1
    A tool which profiles OpenCL devices to find their peak capacities
community/erlang-cl 1.2.4-2
    OpenCL binding for Erlang
community/intel-compute-runtime 20.48.18558-1
    Intel(R) Graphics Compute Runtime for oneAPI Level Zero and OpenCL(TM) Driver
community/intel-graphics-compiler 1:1.0.5435-1
    Intel Graphics Compiler for OpenCL
community/intel-opencl-clang 11.0.0-1
    Wrapper library around clang that can compile OpenCL C kernels to SPIR-V modules
community/pocl 1.6-1
    Portable OpenCL is an open-source implementation of OpenCL which can be easily adapted for new targets
community/pyopencl-headers 1:2020.2.1-2
    A complete, object-oriented language binding of OpenCL to Python
community/python-pyopencl 1:2020.2.1-2
    A complete, object-oriented language binding of OpenCL to Python
multilib/lib32-ocl-icd 2.2.14-1 [installed]
    OpenCL ICD Bindings (32-bit)
multilib/lib32-opencl-mesa 20.3.4-1
    OpenCL support for AMD/ATI Radeon mesa drivers (32-bit)
multilib/lib32-opencl-nvidia 460.39-1
    OpenCL implemention for NVIDIA (32-bit)
gcp commented 3 years ago
$ clinfo
Number of platforms 0

You need to install OpenCL drivers for your hardware if you want to use OpenCL.

gcp commented 3 years ago

That said: v0.23.3+git.29c15a4 built Feb 11 2021

For some reason you're building a very very old version. Also your GPU is useless for lc0, better to disable OpenCL entirely. It's not even supported by CUDA any more.

batot1 commented 3 years ago

That said: v0.23.3+git.29c15a4 built Feb 11 2021

For some reason you're building a very very old version.

We can install this version on official site - check: https://github.com/LeelaChessZero/lc0/blob/v0.24.1/README.md#building-and-running-lc0 And I'm doing all with instruction: git clone -b release/0.23 --recurse-submodules https://github.com/LeelaChessZero/lc0.git [...]

Also your GPU is useless for lc0, better to disable OpenCL entirely. It's not even supported by CUDA any more.

I know that this GPU is history but I wont only test that lc0 working on GPU. NVS 310 has support for CUDA so I don't see any point in turning it off.

gcp commented 3 years ago
We can install this version on official site - check:
https://github.com/LeelaChessZero/lc0/blob/v0.24.1

You're looking at an older, archived copy of the homepage. This is the right one: https://github.com/LeelaChessZero/lc0

NVS 310 has support for CUDA

Yes, but CUDA no longer supports your GPU. You'd have to find an older CUDA version.

batot1 commented 3 years ago

ou need to install OpenCL drivers for your hardware if you want to use OpenCL.

You thinking abut this yea?

extra/opencl-nvidia 460.39-1
    OpenCL implemention for NVIDIA

Look:
$ sudo pacman -S opencl-nvidia
[sudo] password for xxx:
resolving dependencies...
looking for conflicting packages...
:: opencl-nvidia and opencl-nvidia-340xx are in conflict. Remove opencl-nvidia-340xx? [y/N]
error: unresolvable package conflicts detected
error: failed to prepare transaction (conflicting dependencies)
:: opencl-nvidia and opencl-nvidia-340xx are in conflict
$ sudo pacman -S opencl-nvidia-340xx
error: target not found: opencl-nvidia-340xx
$ 

I can answer "Y" but afraid that all will be okey past reboot system.

Ok opencl-nvidia installed but still get:

$ clinfo
Number of platforms                               0
]$ locate libOpenCL.so
/opt/cuda/targets/x86_64-linux/lib/libOpenCL.so
/opt/cuda/targets/x86_64-linux/lib/libOpenCL.so.1
/opt/cuda/targets/x86_64-linux/lib/libOpenCL.so.1.0
/opt/cuda/targets/x86_64-linux/lib/libOpenCL.so.1.0.0
/usr/lib/libOpenCL.so
/usr/lib/libOpenCL.so.1
/usr/lib/libOpenCL.so.1.0.0
/usr/lib32/libOpenCL.so
/usr/lib32/libOpenCL.so.1
/usr/lib32/libOpenCL.so.1.0.0
/usr/share/man/man7/libOpenCL.so.7.gz

I see that sometimes user must something change in BIOS to see GPU - interesting. https://computergraphics.stackexchange.com/questions/1990/opencl-doesnt-detect-gpu

$  lsmod | grep nvidia
nvidia_drm             49152  0
nvidia_modeset       1056768  1 nvidia_drm
nvidia              14729216  1 nvidia_modeset
ipmi_msghandler        69632  2 ipmi_devintf,nvidia
drm_kms_helper        221184  2 vboxvideo,nvidia_drm
drm                   520192  6 drm_kms_helper,drm_vram_helper,vboxvideo,nvidia_drm,ttm

$ ls -la /usr/lib/ | grep opencl
lrwxrwxrwx   1 root root        21 Jan 26 17:01 libnvidia-opencl.so -> libnvidia-opencl.so.1
lrwxrwxrwx   1 root root        26 Jan 26 17:01 libnvidia-opencl.so.1 -> libnvidia-opencl.so.460.39
-rwxr-xr-x   1 root root  17351336 Jan 26 17:01 libnvidia-opencl.so.460.39
gcp commented 3 years ago

NVIDIA's current drivers don't support your card any more: https://www.nvidia.com/download/driverResults.aspx/170134/en-us and check supported products.

It sounds like you need drivers no newer than 390 or something around that timeframe: https://www.anandtech.com/show/12624/nvidia-moves-fermi-to-legacy-ends-32bit-os-support