Skip to content

Update Mesa to 21.1.6 and enable OpenCL #2173

Merged
merged 4 commits into from
Aug 9, 2021

Conversation

pmenzel
Copy link
Collaborator

@pmenzel pmenzel commented Aug 4, 2021

Built without libclc’s SPIRV-Mesa-targets as it’s unclear how to get LLVM_SPIRV/llvm_spirv.

Install with sudo bee update libclc mesalib.

Tested on maleficent (01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon Pro WX 5100] [1002:67c7]).

@thomas
Copy link
Collaborator

thomas commented Aug 4, 2021 via email

[Description][1]:

> libclc is an open source, BSD/MIT dual licensed implementation of the
> library requirements of the OpenCL C programming language, as specified
> by the OpenCL 1.1 Specification.

Building Mesa 3D with OpenCL support (`-Dgallium-opencl="icd"`) requires
LLVM’s libclc.

    Run-time dependency libclc found: NO (tried pkgconfig and cmake)

    ../source/meson.build:849:2: ERROR: Dependency "libclc" not found, tried pkgconfig and cmake

[1]: https://libclc.llvm.org/
Building all targets fails due to the check below:

    if( "spirv-mesa3d-" IN_LIST LIBCLC_TARGETS_TO_BUILD OR "spirv64-mesa3d-" IN_LIST LIBCLC_TARGETS_TO_BUILD )
            if( NOT LLVM_SPIRV )
                    message( FATAL_ERROR "SPIR-V targets requested, but spirv-tools is not installed" )
            endif()
    endif()

The failure is:

    LLVM cxx flags:
    -I/usr/include;-std=c++14;;;-fno-exceptions;-D_GNU_SOURCE;-D__STDC_CONSTANT_MACROS;-D__STDC_FORMAT_MACROS;-D__STDC_LIMIT_MACROS;-fno-rtti;-fno-exceptions

    clang: /usr/bin/clang
    llvm-as: /usr/bin/llvm-as
    llvm-link: /usr/bin/llvm-link
    opt: /usr/bin/opt
    llvm-spirv: LLVM_SPIRV-NOTFOUND

    CMake Error at CMakeLists.txt:115 (message):
      SPIR-V targets requested, but spirv-tools is not installed

    -- Configuring incomplete, errors occurred!
    See also "/dev/shm/bee-pmenzel/libclc/libclc-12.0.1-0/build/CMakeFiles/CMakeOutput.log".

List of all targets:

*   amdgcn--
*   amdgcn--amdhsa
*   r600--
*   nvptx--
*   nvptx64--
*   nvptx--nvidiacl
*   nvptx64--nvidiacl
*   spirv-mesa3d-
*   spirv64-mesa3d-

As LLVM_SPIRV/llvm_spirv is not shipped in MarIuX, and it’s unclear how
to package it (maybe [LLVM-SPIRV-Backend][1]), do it [as Debian does
it][2], and disable the SPIRV targets, by only building the non-SPIRV
targets.

[1]: https://github.com/KhronosGroup/LLVM-SPIRV-Backend
[2]: https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/blob/a5528e133ea546feaa48f13f734b94e5744960bc/debian/rules#L544
@pmenzel pmenzel force-pushed the update-mesa-to-21.1.6-and-enable-opencl branch from c708b7e to 8f5b450 Compare August 5, 2021 11:14
@pmenzel
Copy link
Collaborator Author

pmenzel commented Aug 5, 2021

I disabled the SPIRV-Mesa-targets in libclc, and Mesa could be built with OpenCL support. No idea what SPIRV is, and if we need it.

I didn’t do any OpenCL testing. It’d be great, if somebody knowledgeable could do that.

@pmenzel pmenzel merged commit af24e09 into master Aug 9, 2021
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants