Building graphics/gpu-firmware-kmod with synth / help needed

Hello,

I think I need some help here. I am running synth upgrade-system for local ports upgrade. Everything goes almost smoothly, but there are few errors after long run.
One port which is failing graphics/gpu-firmware-kmod

In the synth logs, there are many messages like this:

Code:
===>   gpu-firmware-kmod-20240401,1 depends on package: gpu-firmware-amd-kmod-polaris12>0 - not found
===>   Installing existing package /packages/All/gpu-firmware-amd-kmod-polaris12-20230625_2.pkg
Installing gpu-firmware-amd-kmod-polaris12-20230625_2...
Extracting gpu-firmware-amd-kmod-polaris12-20230625_2: .......... done
kldxref: can't create //boot/lhint.OkHH8C: Read-only file system
pkg-static: POST-INSTALL script failed

This is just one example. All firmware modules fail.

Code:
===>   gpu-firmware-kmod-20240401,1 depends on package: gpu-firmware-amd-kmod-gc-11-0-4>0 - not found
===>   Installing existing package /packages/All/gpu-firmware-amd-kmod-gc-11-0-4-20230625_2.pkg
Installing gpu-firmware-amd-kmod-gc-11-0-4-20230625_2...
Extracting gpu-firmware-amd-kmod-gc-11-0-4-20230625_2: ....
pkg-static: Fail to extract /boot/modules/amdgpu_gc_11_0_4_mes_bin.ko from package: Write error
Extracting gpu-firmware-amd-kmod-gc-11-0-4-20230625_2... done

Failed to install the following 1 package(s): /packages/All/gpu-firmware-amd-kmod-gc-11-0-4-20230625_2.pkg
*** Error code 1

Stop.
make: stopped in /xports/graphics/gpu-firmware-kmod



--------------------------------------------------
--  Termination
--------------------------------------------------

What might be the problem, and where can I find the solution?

Best regards!
 
This appears to be due to a bug-ette in kldxref. When synth builds its build-tree it mounts a read-only /boot with a read/write /boot/modules. The GPU firmware tries to install some modules in this /boot/modules and then run kldxref. The kldxref program reads through the mounted /boot/modules and generates a loader.hints file. However, the temporary file it uses to do this generation winds up with the name //boot/lhint.<generated> instead of //boot/modules/lhint.<generated>.

The bug is fixed in commit src: f4613af424cc93d42f35730fd9862f0c6f964cbd but this commit has not been backported (yet?).

Note: picking the fix and trying again simply leads to a new failure, e.g.:
Code:
Installing gpu-firmware-amd-kmod-gc-11-0-4-20230625_2...
Extracting gpu-firmware-amd-kmod-gc-11-0-4-20230625_2: ....
pkg-static: Fail to create temporary file for /boot/modules/amdgpu_gc_11_0_4_mes_bin.ko:No space left on device

I'll poke at this more later.
 
Not surprisingly, this just turns out to be a too-small limit in tmpfs sizes.

The following patch suffices to build. I have not boot-tested yet.

I'll see if the synth repo maintainer on GitHub likes the proposed change.

Code:
commit 3726fd7bcab7efcc42438d725249999020626a4a (HEAD -> main)
Author: Chris Torek <chris.torek@gmail.com>
Date:   Tue Nov 19 01:51:50 2024 -0800

    ports-mgmt/synth: increase tmpfs sizes
    
    The loadable module and firmware builds are much larger now.
    Raise their tmpfs sizes from 100 MB to 1000 MB.

diff --git a/ports-mgmt/synth/files/patch-replicant.adb b/ports-mgmt/synth/files/patch-replicant.adb
new file mode 100644
index 000000000000..14f3d2b5b929
--- /dev/null
+++ b/ports-mgmt/synth/files/patch-replicant.adb
@@ -0,0 +1,11 @@
+--- src/replicant.adb.orig     2024-11-19 01:43:16.581345000 -0800
++++ src/replicant.adb  2024-11-19 01:43:41.546836000 -0800
+@@ -1170,6 +1170,6 @@
+                   mount_nullfs (target      => bootdir,
+                                 mount_point => location (slave_base, boot));
+-                  mount_tmpfs (slave_base & root_boot_fw, 100);
+-                  mount_tmpfs (slave_base & root_kmodules, 100);
++                  mount_tmpfs (slave_base & root_boot_fw, 1000);
++                  mount_tmpfs (slave_base & root_kmodules, 1000);
+                end if;
+             end;
 
Note: with drm-61-kmod and updated firmware modules, running FreeBSD-15-CURRENT, using the AMD 7950 built in graphics, kldload amdgpu no longer crashes, but the console display goes blank. Not sure what the status of the next rev of the Linux drivers is, at this point.
 
Back
Top