[Mesa-dev] [Libre-soc-dev] Loading Vulkan Driver

Dave Airlie airlied at gmail.com
Sun Aug 23 19:48:47 UTC 2020


> (if i can fill in this bit)
>
> the context is: to augment the PowerISA Instruction set to add 3D
> opcodes *directly* to PowerISA, with the guidance, full knowledge and
> under the supervision of the OpenPOWER Foundation.
>
> this will include:  adding sin, cos, atan2... *to PowerISA*.  adding
> texture interpolation instructions... *to PowerISA*.  adding YUV2RGB
> and FP32-to-RGB8888 conversion instructions... *to PowerISA*.
>
> therefore, whilst the initial target is "general purpose scalar
> non-accelerated non-vectorised soft-3D", this is simply because the
> next step is to add 3D opcodes *directly* to the POWER9 core that we
> are developing.
>
>
> i mention this because normally, GPUs are considered completely
> separate entities - completely separate processors.  LibreSOC will be
> the first ever libre-licensed *hybrid* 3D-capable CPU, i.e. where the
> *main processor* ISA is augmented to no longer need a completely
> separate GPU.
>
> i appreciate that i have said the same thing in several different
> ways.  this is because hybrid CPU/VPU/GPUs are so unusual and so "not
> normal industry practice" (because they're easier to sell if they're
> separate) that it takes a while to sink in.

I don't want to get involved in half-thought out schemes here, but I'm
going to indulge myself in one post.

The programming model is what designs the driver:
If your "GPU" is a scalar processor with 1000s of threads, then you
want to operate it with a GPU driver.
If your "GPU" is a wide-vector processor with only 10s of threads, you
want to use llvmpipe style driver.

llvmpipe takes NIR, vectorises it, converts it to LLVM IR, and uses
LLVM to create an executable piece of code that for rasterization and
compute is run multiple times across multiple threads on the CPU.

The big thing doing what Jacob did before, and from memory where he
went wrong despite advice to the contrary is he skipped the
"vectorises it" stage, which is highly important for vector CPU
execution, as opposed to scalar GPU.

I'm guessing you want to add an LLVM backend for your "GPU"
instructions (are these all vectorised?), and just work out how to use
llvmpipe and vallium. Any perceived design issues in llvmpipe will be
totally in the noise compared to designing a CPU rasterizer by
yourself.

But I'd also suggest not distracting people here with too much noise,
if loading a skeleton vulkan driver is this hard, writing a rasterizer
is infinitely harder.

Dave.


More information about the mesa-dev mailing list