#976684 regression: leela-zero fails to start with current Mesa, but previously worked

Package:
mesa-opencl-icd
Source:
mesa
Description:
free implementation of the OpenCL API -- ICD runtime
Submitter:
Ximin Luo
Date:
2020-12-17 15:54:04 UTC
Severity:
normal
#976684#5
Date:
2020-12-06 22:31:44 UTC
From:
To:
Dear Maintainer,

The current version of mesa-opencl-icd does not work with Leela-Zero; clinfo is fine:

$ CLOVER_DEBUG=llvm,native CLOVER_DEBUG_FILE=dump-file OCL_ICD_VENDORS=libMesaOpenCL.so.1 clinfo -l
Platform #0: Clover
 `-- Device #0: Radeon RX 580 Series (POLARIS10, DRM 3.39.0, 5.9.0-4-amd64, LLVM 11.0.0)

$ CLOVER_DEBUG=llvm,native CLOVER_DEBUG_FILE=dump-file OCL_ICD_VENDORS=libMesaOpenCL.so.1 leelaz
[..]
Selected device: Radeon RX 580 Series (POLARIS10, DRM 3.39.0, 5.9.0-4-amd64, LLVM 11.0.0)
with OpenCL 1.1 capability.
Half precision compute support: No.
Tensor Core support: No.

Started OpenCL SGEMM tuner.
Will try 290 valid configurations.
Failed to compile: 290 kernels.
Failed to find a working configuration.
Check your OpenCL drivers.
Minimum error: 100.000000. Error bound: 0.000100

Started OpenCL SGEMM tuner.
Will try 290 valid configurations.
Failed to compile: 290 kernels.
Failed to find a working configuration.
Check your OpenCL drivers.
Minimum error: 100.000000. Error bound: 0.100000
Both single precision and half precision failed to run.
terminate called after throwing an instance of 'std::runtime_error'
  what():  Failed to initialize net.
Aborted
exit code 134

I think Mesa is the problem and not libclc; I downgraded to a previously-working version
of libclc (0.2.0+git20180917-3) but with current Mesa (20.2.3-1) and this bug was still
present. I did not try downgrading Mesa (or upgrading it to the version in experimental)
as that is a much more invasive change to my system, I hope you can appreciate.

Despite the presence of CLOVER_DEBUG=llvm,native CLOVER_DEBUG_FILE=dump-file there were
no dump-files dumped by the above leelaz command, maybe you can deduce something from that.
Let me know if I can run anything else to provide further information.

For the time being I am using the proprietary AMD OpenCL lib as described in #976295.

Ximin

#976684#12
Date:
2020-12-07 08:10:10 UTC
From:
To:
What was the previous version of mesa? Regressions should be filed
upstream too.

#976684#17
Date:
2020-12-07 19:01:50 UTC
From:
To:
Timo Aaltonen:

I narrowed down the problem further: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3946

Something to do with cl-denorms-are-zero but previous versions of mesa recognised it fine.

X

#976684#24
Date:
2020-12-17 15:51:28 UTC
From:
To:
As stated in the forwarded upstream bug report, they have a hacky workaround:

https://gitlab.freedesktop.org/airlied/mesa/-/commit/4e1eb5f5b95141b93ea3da9369a193237bc2f92d

They do not want to merge it as-is, as they want to think about the proper solution first (details in the bug report).

However I don't see that it could cause any harm, it makes something that is broken work again - could you please apply it in the Debian package?

Best,
Ximin

Ximin Luo: