Firmware failed to load

Due to the specific hardware, I need to add some extra firmware packages:

hardware.firmware = lib.mkBefore [ pkgs.linux-firmware-xxx ];

I used nix repl to inspect the corresponding derivation and its output, and confirmed that the files do exist.

However, after rebuilding the system and rebooting, I still get β€˜file not found’ errors in dmesg:

remoteproc remoteproc1: Direct firmware load for qcom/sm8150/xiaomi/nabu/cdsp.mbn failed with error -2
remoteproc remoteproc2: Direct firmware load for qcom/sm8150/xiaomi/nabu/adsp.mbn failed with error -2
remoteproc remoteproc1: request_firmware failed: -2
remoteproc remoteproc2: request_firmware failed: -2

On other distros, the expected output looks like this:

remoteproc remoteproc1: Booting fw image qcom/sm8150/xiaomi/nabu/cdsp.mbn, size 9455252
remoteproc remoteproc1: remote processor cdsp is now up
remoteproc remoteproc2: Booting fw image qcom/sm8150/xiaomi/nabu/adsp.mbn, size 14430684
remoteproc remoteproc2: remote processor adsp is now up

Any ideas on how to fix this? Am I doing something wrong?

1 Like

Hrm… I lost you at -xxx. What is that? Did you make that package? Can you confirm the file layout of its out path?

Yes, it’s a package I built myself. Here’s how I verified it:

# First, get the output path
nix path-info --impure .#nixosConfigurations.XiaomiNabu.config.hardware.firmware.outPath
# Then inspect it with tree
tree -l /nix/store/xxxxxxxx

part of the output:

/nix/store/15mb693r73cyid19vz35s7w6sn7v6ir0-firmware
└── lib
    └── firmware
        β”œβ”€β”€ qcom
        β”‚   β”œβ”€β”€ sm8150
        β”‚   β”‚   └── xiaomi -> /nix/store/rim02j2isk0ch9065fj15qcxgkbkh9ms-linux-firmware-xiaomi-nabu-25.04.26-zstd/lib/firmware/qcom/sm8150/xiaomi
        β”‚   β”‚       └── nabu
        β”‚   β”‚           β”œβ”€β”€ a640_zap.mbn.zst
        β”‚   β”‚           β”œβ”€β”€ adsp.mbn.zst
        β”‚   β”‚           β”œβ”€β”€ cdsp.mbn.zst
        β”‚   β”‚           β”œβ”€β”€ modem.mbn.zst
        β”‚   β”‚           β”œβ”€β”€ modemuw.jsn.zst
        β”‚   β”‚           β”œβ”€β”€ slpi_nb.mbn.zst
        β”‚   β”‚           β”œβ”€β”€ venus.mbn.zst
        β”‚   β”‚           └── wlanmdsp.mbn.zst

That firmware doesn’t seem to be referenced by mainline Linux, is there an out of tree module that’s trying to load the firmware?

1 Like

You could also try disabling firmware compression (NixOS Search) as it’s incompatible with partial firmware reads.

Actually, this is a custom kernel. You can find the β€œlinux-firmware” package here.

Still not working :frowning:

What’s interesting is that other files packaged alongside themare being recognized:

[   12.360025] remoteproc remoteproc0: powering up modem
[   12.417207] remoteproc remoteproc0: Booting fw image qcom/sm8150/xiaomi/nabu/modem.mbn, size 5101612

So modem.mbn loads fine from the same package, but cdsp.mbn and adsp.mbn don’t. They’re all in the same directory, same derivation output. This is really puzzling.