Kernel pve-kernel-5.4.55-1 complie error

MnM

Active Member
May 12, 2016
16
1
43
Hi,

Try to compile the new kernel (to add the NAVI patch to it) and get this error during build:

Code:
  INSTALL sound/x86/snd-hdmi-lpe-audio.ko
  INSTALL sound/xen/snd_xen_front.ko
  INSTALL ubuntu/hio/hio.ko
  INSTALL ubuntu/xr-usb-serial/xr_usb_serial_common.ko
  INSTALL virt/lib/irqbypass.ko
  DEPMOD  5.4.55-1-pve
make[2]: Leaving directory '/usr/src/pve-kernel/build/ubuntu-focal'
# install zfs drivers
install -d -m 0755 debian/pve-kernel-5.4.55-1-pve/lib/modules/5.4.55-1-pve/zfs
install -m 644 modules/zfs.ko modules/zavl.ko modules/znvpair.ko modules/zunicode.ko modules/zcommon.ko modules/icp.ko modules/zlua.ko modules/spl.ko debian/pve-kernel-5.4.55-1-pve/lib/modules/5.4.55-1-pve/zfs
# remove firmware
rm -rf debian/pve-kernel-5.4.55-1-pve/lib/firmware
# strip debug info
find debian/pve-kernel-5.4.55-1-pve/lib/modules -name \*.ko -print | while read f ; do strip --strip-debug "$f"; done
# finalize
/sbin/depmod -b debian/pve-kernel-5.4.55-1-pve/ 5.4.55-1-pve
# Autogenerate blacklist for watchdog devices (see README)
install -m 0755 -d debian/pve-kernel-5.4.55-1-pve/lib/modprobe.d
ls debian/pve-kernel-5.4.55-1-pve/lib/modules/5.4.55-1-pve/kernel/drivers/watchdog/ > watchdog-blacklist.tmp
echo ipmi_watchdog.ko >> watchdog-blacklist.tmp
cat watchdog-blacklist.tmp|sed -e 's/^/blacklist /' -e 's/.ko$//'|sort -u > debian/pve-kernel-5.4.55-1-pve/lib/modprobe.d/blacklist_pve-kernel-5.4.55-1-pve.conf
rm -f debian/pve-kernel-5.4.55-1-pve/lib/modules/5.4.55-1-pve/source
rm -f debian/pve-kernel-5.4.55-1-pve/lib/modules/5.4.55-1-pve/build
touch .install_mark
cp: cannot stat 'ubuntu-focal/.tmp_2643': No such file or directory
make[1]: *** [debian/rules:172: .headers_prepare_mark] Error 1
make[1]: Leaving directory '/usr/src/pve-kernel/build'
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
make: *** [Makefile:58: pve-kernel-5.4.55-1-pve_5.4.55-1_amd64.deb] Error 2

Anyone has any ideas how to fix this?
 
It builds fine here (obviously ^^), so it may be some side effect on your setup - often that can be not enough storage space or some error when adding custom patches.

cp: cannot stat 'ubuntu-focal/.tmp_2643': No such file or directory make[1]: *** [debian/rules:172: .headers_prepare_mark] Error 1

This is highly probably only a followup error with the real cause being log far above in the build log.
Can you upload a full build log, generated (for example) with: make | tee build.log
 
Here is it

cd pve-kernel
git status
Code:
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)
  (commit or discard the untracked or modified content in submodules)

        modified:   submodules/ubuntu-focal (modified content)

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        build/
        config-5.4.55.org

no changes added to commit (use "git add" and/or "git commit -a")

cd submodules/ubuntu-focal/
git status
Code:
HEAD detached at 367e715472ef
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   drivers/pci/quirks.c

no changes added to commit (use "git add" and/or "git commit -a")

Using exact steps that I am using now compiled 5.4.44-2-pve kernel without any issues (did this a few weeks ago)

Full log coming soon...
 
Here is the full process (worked with 5.4.44-2-pve kernel )

I have a virtualized ProxMox on bare metal ProxMox just for building kernels. 87GB free space on hdd.

running latest version of ProxMox with 5.4.55-1-pve kernel

Following was installed:

Code:
apt-get install git debhelper build-essential dh-python dh-systemd sphinx-common lintian

Code:
apt-get install asciidoc-base bison flex libdw-dev libelf-dev libiberty-dev libnuma-dev libslang2-dev libssl-dev lz4 xmlto zlib1g-dev

cd /usr/src

Make the patch file, paste and save the file

Code:
vi patch

Code:
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 44c4ae1abd00..d94ddb1c6832 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -3825,6 +3825,97 @@ static int delay_250ms_after_flr(struct pci_dev *dev, int probe)
return 0;
}

+/*
+ * AMD Navi 10 series GPUs require a vendor specific reset procedure.
+ * According to AMD a PSP mode 2 reset should be enough however at this
+ * time the details of how to perform this are not available to us.
+ * Instead we can signal the SMU to enter and exit BACO which has the same
+ * desired effect.
+ */
+static int reset_amd_navi10(struct pci_dev *dev, int probe)
+{
+ const int mmMP0_SMN_C2PMSG_81 = 0x16091;
+ const int mmMP1_SMN_C2PMSG_66 = 0x16282;
+ const int mmMP1_SMN_C2PMSG_82 = 0x16292;
+ const int mmMP1_SMN_C2PMSG_90 = 0x1629a;
+
+ u16 cfg;
+ resource_size_t mmio_base, mmio_size;
+ uint32_t __iomem * mmio;
+ unsigned int sol;
+ unsigned int timeout;
+
+ /* bus resets still cause navi to flake out */
+ dev->dev_flags |= PCI_DEV_FLAGS_NO_BUS_RESET;
+
+ if (probe)
+ return 0;
+
+ /* save the PCI state and enable memory access */
+ pci_save_state(dev);
+ pci_read_config_word(dev, PCI_COMMAND, &cfg);
+ pci_write_config_word(dev, PCI_COMMAND, cfg | PCI_COMMAND_MEMORY);
+
+ /* map BAR5 */
+ mmio_base = pci_resource_start(dev, 5);
+ mmio_size = pci_resource_len(dev, 5);
+ mmio = ioremap_nocache(mmio_base, mmio_size);
+ if (mmio == NULL) {
+ pci_disable_device(dev);
+ pci_err(dev, "Navi10: cannot iomap device\n");
+ return 0;
+ }
+
+ /* check the sign of life indicator */
+ sol = readl(mmio + mmMP0_SMN_C2PMSG_81);
+ pci_info(dev, "Navi10: SOL 0x%x\n", sol);
+ if (sol == 0 || sol == 0xffffffff) {
+ pci_info(dev, "Navi10: device doesn't need to be reset\n");
+ goto out;
+ }
+
+ pci_info(dev, "Navi10: performing BACO reset\n");
+
+ /* the SMU might be busy already, wait for it */
+ for(timeout = 200; timeout && readl(mmio + mmMP1_SMN_C2PMSG_90) != 0; --timeout)
+ msleep(1);
+ readl(mmio + mmMP1_SMN_C2PMSG_90);
+
+ /* send PPSMC_MSG_ArmD3 */
+ writel(0x00, mmio + mmMP1_SMN_C2PMSG_90);
+ writel(0x46, mmio + mmMP1_SMN_C2PMSG_66);
+ for(timeout = 200; timeout && readl(mmio + mmMP1_SMN_C2PMSG_90) != 0; --timeout)
+ msleep(1);
+
+ /* send PPSMC_MSG_EnterBaco with param */
+ writel(0x00, mmio + mmMP1_SMN_C2PMSG_90);
+ writel(0x00, mmio + mmMP1_SMN_C2PMSG_82);
+ writel(0x18, mmio + mmMP1_SMN_C2PMSG_66);
+ for(timeout = 200; timeout && readl(mmio + mmMP1_SMN_C2PMSG_90) != 0; --timeout)
+ msleep(1);
+
+ /* wait for the regulators to shutdown */
+ msleep(400);
+
+ /* send PPSMC_MSG_ExitBaco */
+ writel(0x00, mmio + mmMP1_SMN_C2PMSG_90);
+ writel(0x19, mmio + mmMP1_SMN_C2PMSG_66);
+ for(timeout = 200; timeout && readl(mmio + mmMP1_SMN_C2PMSG_90) != 0; --timeout)
+ msleep(1);
+
+ /* wait for regulators to startup again */
+ msleep(400);
+
+out:
+ /* unmap BAR5 */
+ iounmap(mmio);
+
+ /* restore the PCI state and command register */
+ pci_restore_state(dev);
+ pci_write_config_word(dev, PCI_COMMAND, cfg);
+ return 0;
+}
+
static const struct pci_dev_reset_methods pci_dev_reset_methods[] = {
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82599_SFP_VF,
reset_intel_82599_sfp_virtfn },
@@ -3836,6 +3927,13 @@ static const struct pci_dev_reset_methods pci_dev_reset_methods[] = {
{ PCI_VENDOR_ID_INTEL, 0x0953, delay_250ms_after_flr },
{ PCI_VENDOR_ID_CHELSIO, PCI_ANY_ID,
reset_chelsio_generic_dev },
+ { PCI_VENDOR_ID_ATI, 0x7310, reset_amd_navi10 },
+ { PCI_VENDOR_ID_ATI, 0x7312, reset_amd_navi10 },
+ { PCI_VENDOR_ID_ATI, 0x7318, reset_amd_navi10 },
+ { PCI_VENDOR_ID_ATI, 0x7319, reset_amd_navi10 },
+ { PCI_VENDOR_ID_ATI, 0x731a, reset_amd_navi10 },
+ { PCI_VENDOR_ID_ATI, 0x731b, reset_amd_navi10 },
+ { PCI_VENDOR_ID_ATI, 0x731f, reset_amd_navi10 },
{ 0 }
};

then

Code:
git clone git://git.proxmox.com/git/pve-kernel.git

then

Code:
cd pve-kernel

then (this step takes a while)

Code:
git submodule update --init --recursive

then

Code:
cd submodules/ubuntu-focal

then I apply the patch

Code:
patch -p1 < /usr/src/patch

the result is

Code:
patching file drivers/pci/quirks.c
Hunk #1 succeeded at 3973 (offset 148 lines).
Hunk #2 succeeded at 4075 (offset 148 lines).

then

Code:
cd /usr/src/pve-kernel

then

Code:
make | tee build.log

Then it errors out as mentioned before (hdd still had 38GB free).

Log file attached.
 

Attachments

  • build.zip
    225.5 KB · Views: 1
Then it errors out as mentioned before (hdd still had 38GB free).

argh, I forgot to tell you to redirect stderr to stdout before piping to tee, sorry -.-
make 2>&1 | tee build.log

But, I just did a full clean re-build in a new Debian CT with fresh git clones from git.proxmox.com, builds just fine...
 
Rebuild also with your patch applied, works just fine...

Please check your environment, as said the build log should have a more telling error farther above, the failing cp is quite probably just an effect of a build step failing to produce that directory.
 
Thanks for helping.
I will start a Debian CT too and see how it goes.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!