How does LInux use the NPU

I’m a recent (as of like 30 mins ago) purchaser of a Framework 13! I was curious about how the built in NPU works with non-Windows OSes.

How does Linux use the NPU in the AMD AI 3k series APU? I know windows has some buit-in support, drivers, and application support but i’m considering cachyos vs windows home. I’ve been a cachyos for a year or so now and recently switched back to windows so that I could use the NPU. Is there any confirmed way I can tell?

I don’t believe there are any Linux Distro’s that use the NPU for OS tasks like Windows does.

The correct answer is “Who gives a sh*t”. NPUs are a meme.

The AMD NPU is essentially an FPGA.
If you have some application that could make good use of an FPGA, then go ahead and use the NPU.
In general, developers tend to start developing for a CPU, and if they need more performance / optimization, might move to the GPU, and if that is not helpful, might then consider an FPGA / NPU.
So, in practice, the use of NPU is less likely than one might think.

When comparing CPU vs GPU vs FPGA, simplistically it can be viewed as:
CPU: one can think of a CPU running a variable set of instructions across a dataset with small level of parallelism. (number of CPU cores)
GPU: one can think of a GPU running a fixed set of instructions across a dataset with large level of parallelism. (GPU compute wavefronts/CUs)
FPGA / NPU: one can think of the Data stream being run across a fixed set of instructions with an arbitrary amount of parallelism depending on the FPGA size. FPGAs do not tend to have much RAM inside them, but rely on the input/output data stream to do their work.
NPU / FPGAs need the developer to think fundamentally differently with regards to how to go about processing data, so there is a pretty steep learning curve for anyone wishing to use them.

1 Like

Thre’s a thread about NPU use with links to download the NPU and XDNA kernel modules. You wouldn’t be using it without loading the base XDNA and NPU drivers. The Linux Kernel AMD NPU documentation explains some of this workflow, and there’s a step-by-step example here via Xilinx, the FPGA company AMD ingested for these chips. There are other NPU tools here, but these AI accelerator chips are solutions to a problem Microsoft convinced PC makers that end users have.

1 Like

Isn’t it just in Microsoft’s best interest to have an npu to accelerate copilot functions. I guess Linux doesn’t have the same embedded equivalent.