pal1000 / mesa-dist-win

Pre-built Mesa3D drivers for Windows
MIT License
905 stars 79 forks source link

OpenCL support through clover over llvmpipe #28

Open pal1000 opened 4 years ago

pal1000 commented 4 years ago

Add @donizettilorenzo to conversation as he showed interest in this topic as #5.

Recently Mesa3D landed clover state tracker support to llvmpipe driver which should provide an OpenCL CPU runtime similar to POCL that hopefully builds on Windows.

Roadmap

donizettilorenzo commented 4 years ago

Thanks man, you're better than an AI agent :D Of course I'm interested!

Il giorno sab 28 dic 2019 alle ore 17:38 pal1000 notifications@github.com ha scritto:

Add @donizettilorenzo https://github.com/donizettilorenzo to conversation as he showed interest in this topic as #5 https://github.com/pal1000/mesa-dist-win/issues/5.

Recently Mesa3D landed clover state tracker support to llvmpipe driver which should provide an OpenCL CPU runtime similar to POCL that hopefully builds on Windows. Roadmap

  • Attempt clover build in standalone mode then test it with GPU Caps Viewer if build is successful;
  • Build in ICD mode then register and test it with GPU Caps Viewer if build is successful;
  • Update per app deployment tool to support OpenCL standalone install mode;
  • Update system wide deployment tool to support OpenCL ICD install mode by complying with this spec https://www.khronos.org/registry/OpenCL/specs/2.2/html/OpenCL_ICD_Installation.html .

Bonus

  • Fake advertise CL GPU support on Microsoft Basic Display Adapter.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pal1000/mesa-dist-win/issues/28?email_source=notifications&email_token=AAOZJ3MTMN7NKVHPGSK3U2LQ256KBA5CNFSM4KAPE4E2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IDBDZTQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOZJ3OL2HVPGFUC6LBG6IDQ256KBANCNFSM4KAPE4EQ .

pal1000 commented 4 years ago

First attempt doesn't look very promising. Clover has some unique requirements:

Current status: it doesn't get far and my hands are tied:

Select Python installation
1. Python 3.8 64 bit

Select Python version by entering its index from the table above:1

Using Python 3.8.1 from C:\Users\prodea2\AppData\Local\Programs\Python\Python38\python.exe.

Update python packages (y/n):y

Do you want to throttle build. Enter number of parallel jobs. Defaults to 4 which represents the number of your CPU available hyperthreads. You should not enter a value greater than that:

Do you want to rebuild pkgconf (y/n):

Begin LLVM build. Only needs to run once for each ABI and version. Proceed (y/n):

Do you want to dump build environment information to a text file (y/n):

Begin mesa build. Proceed - y/n :y

Applying patch s3tc...
error: patch failed: src/gallium/drivers/llvmpipe/lp_tex_sample.h:37
error: src/gallium/drivers/llvmpipe/lp_tex_sample.h: patch does not apply

Applying patch subprojects-update...
error: patch failed: subprojects/zlib.wrap:5
error: subprojects/zlib.wrap: patch does not apply

Applying patch swravx512...
error: patch failed: src/gallium/drivers/swr/meson.build:249
error: src/gallium/drivers/swr/meson.build: patch does not apply

Applying patch meson-build-both-osmesa...
error: patch failed: include/meson.build:89
error: include/meson.build: patch does not apply
error: patch failed: meson.build:444
error: meson.build: patch does not apply
error: patch failed: meson_options.txt:295
error: meson_options.txt: patch does not apply
error: patch failed: src/gallium/meson.build:175
error: src/gallium/meson.build: patch does not apply
error: patch failed: src/mesa/meson.build:744
error: src/mesa/meson.build: patch does not apply

Build Mesa without LLVM (y/n). llvmpipe and swr drivers and high performance JIT won't be available for other drivers and libraries:

Use Ninja build system instead of MsBuild (y/n); less storage device strain and maybe faster build:y

Do you want to build GLAPI as a shared library and standalone GLES libraries (y/n):y

Do you want to build off-screen rendering drivers (y/n):y

Do you want to build graw library (y/n):y

Build Mesa3D clover OpenCL state tracker (y/):y

WARNING: Meson build always performs clean build. This is last chance to cancel build.
Press any key to continue . . .

**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.4.2
** Copyright (c) 2019 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64_x86'

Build configuration command: meson.exe build/x86 --default-library=static --buildtype=release -Db_vscrt=mt -Dllvm=true --backend=ninja -Dshared-glapi=true -Dgles1=true -Dgles2=true -Dosmesa=gallium,classic -Dbuild-tests=true -Dgallium-opencl=standalone

The Meson build system
Version: 0.52.1
Source dir: C:\Software\Development\projects\mesa\mesa
Build dir: C:\Software\Development\projects\mesa\mesa\build\x86
Build type: native build
Program python found: YES (C:\Users\prodea2\AppData\Local\Programs\Python\Python38\python.EXE)
Project name: mesa
Project version: 20.0.0-devel
C compiler for the host machine: cl (msvc 19.24.28314)
C linker for the host machine: link 19.24.28314
C++ compiler for the host machine: cl (msvc 19.24.28314)
C++ linker for the host machine: link 19.24.28314
Host machine cpu family: x86
Host machine cpu: x86
Program pkg-config found: YES (C:\Software\DEVELO~1\projects\mesa\pkgconf\build\pkg-config.EXE)
Found pkg-config: C:\Software\DEVELO~1\projects\mesa\pkgconf\build\pkg-config.EXE (1.6.3)
Did not find CMake 'cmake'
Found CMake: NO
Run-time dependency libclc found: NO (tried pkgconfig)

meson.build:719:2: ERROR: Dependency "libclc" not found, tried pkgconfig

A full log can be found at C:\Software\Development\projects\mesa\mesa\build\x86\meson-logs\meson-log.txt

Build command: ninja -j 4

Press any key to continue . . .
pal1000 commented 2 years ago

There has been work to build clover over llvmpipe for Windows upstream. It still depends on 1 patch.

pal1000 commented 2 years ago

I was successful in building 64-bit clover in both ICD and standalone forms for 21.3.2 release. 51d15e77400a661ac985f53d8fb69ed945f2b92f was the last fix needed. It annoys me that ICD and standalone builds can't be done in a single build pass though.

pal1000 commented 2 years ago

Depends on #88.