Skip to contentSkip to conversation

mesa: Add packageconfig knob to control tegra gallium driver

PATCH In review Khem Raj 4 participants 8 messages Jul 11, 2024 – Jul 12, 2024

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 mesa: Add packageconfig knob to control tegra gallium driver

---
 meta/recipes-graphics/mesa/mesa.inc | 3 +++
 1 file changed, 3 insertions(+)
meta/recipes-graphics/mesa/mesa.inc +3 -0
index d56def29163..c426e8fddd4 100644
@@ -199,6 +199,9 @@ GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'lima', ',lima', '
 PACKAGECONFIG[panfrost] = ""
 GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'panfrost', ',panfrost', '', d)}"
 
+PACKAGECONFIG[tegra] = ""
+GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'tegra', ',tegra,nouveau', '', d)}"
+
 PACKAGECONFIG[vulkan-beta] = "-Dvulkan-beta=true,-Dvulkan-beta=false"
 
 PACKAGECONFIG[osmesa] = "-Dosmesa=true,-Dosmesa=false"
author
#1 lore raw

PATCH 2/2 arch-arm64: Use neoverse-v1 ISA for Qemu usermode

With latest qemu several places where qemu-usermode is used e.g. nodejs, qtwebengine, chromium, the builds are failing form armv8a tuned machines (e.g. tegra) which is due to qemu crash ( SIGILL ) encoutered when 'max' ISA is used ( which is default ), max seems to use neoverse-n2 equivalent features, which is evident that SIGILL also happens when using -cpu neoverse-v2, therefore explicitly select neoverse-v1 for ISA, which works and covers almost all (if not all) cpu tunes for armv8 we have.

---
 meta/conf/machine/include/arm/arch-arm64.inc | 5 +++++
 1 file changed, 5 insertions(+)
meta/conf/machine/include/arm/arch-arm64.inc +5 -0
index 832d0000acb..9639911d33b 100644
@@ -42,3 +42,8 @@ TARGET_FPU = "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', '${TARGET_FPU_64}
 # support these they're meaningless NOP instructions, so there's very little
 # reason not to.
 TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', ' -mbranch-protection=standard', '', d)}"
+
+# Fix qemu-user crashes while building nodejs/chromium/qtwebengine, defaults ISA is max and it generate SIGILLs
+# qemu: uncaught target signal 4 (Illegal instruction) - core dumped
+# Select the superset ISA
+QEMU_EXTRAOPTIONS_armv8a = "-cpu neoverse-v1"
#2 lore raw

Re: [OE-core] [PATCH 2/2] arch-arm64: Use neoverse-v1 ISA for Qemu usermode

I don't understand. Why setting an earlier CPU (that supports less instructions) solves the problem of trying to execute unsupported instructions? I think Arm folks should look at this.

Alex

Quoted 37 lines · Khem Raj via lists.openembedded.org

With latest qemu several places where qemu-usermode is used e.g. nodejs, qtwebengine, chromium, the builds are failing form armv8a tuned machines (e.g. tegra) which is due to qemu crash ( SIGILL ) encoutered when 'max' ISA is used ( which is default ), max seems to use neoverse-n2 equivalent features, which is evident that SIGILL also happens when using -cpu neoverse-v2, therefore explicitly select neoverse-v1 for ISA, which works and covers almost all (if not all) cpu tunes for armv8 we have.

---
 meta/conf/machine/include/arm/arch-arm64.inc | 5 +++++
 1 file changed, 5 insertions(+)
meta/conf/machine/include/arm/arch-arm64.inc +5 -1
index 832d0000acb..9639911d33b 100644
@@ -42,3 +42,8 @@ TARGET_FPU = "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', '${TARGET_FPU_64}
 # support these they're meaningless NOP instructions, so there's very little
 # reason not to.
 TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', ' -mbranch-protection=standard', '', d)}"
+
+# Fix qemu-user crashes while building nodejs/chromium/qtwebengine, defaults ISA is max and it generate SIGILLs
+# qemu: uncaught target signal 4 (Illegal instruction) - core dumped
+# Select the superset ISA
+QEMU_EXTRAOPTIONS_armv8a = "-cpu neoverse-v1"
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#201796): https://lists.openembedded.org/g/openembedded-core/message/201796
Mute This Topic: https://lists.openembedded.org/mt/107173682/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw

Re: [OE-core] [PATCH 2/2] arch-arm64: Use neoverse-v1 ISA for Qemu usermode

In reply to Khem Raj
Quoted 23 lines · Khem Raj via lists.openembedded.org

With latest qemu several places where qemu-usermode is used e.g. nodejs, qtwebengine, chromium, the builds are failing form armv8a tuned machines (e.g. tegra) which is due to qemu crash ( SIGILL ) encoutered when 'max' ISA is used ( which is default ), max seems to use neoverse-n2 equivalent features, which is evident that SIGILL also happens when using -cpu neoverse-v2, therefore explicitly select neoverse-v1 for ISA, which works and covers almost all (if not all) cpu tunes for armv8 we have.

---
meta/conf/machine/include/arm/arch-arm64.inc | 5 +++++

1 file changed, 5 insertions(+)
meta/conf/machine/include/arm/arch-arm64.inc +0 -0
index 832d0000acb..9639911d33b 100644
@@ -42,3 +42,8 @@ TARGET_FPU = "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', '${TARGET_FPU_64}
 # support these they're meaningless NOP instructions, so there's very little
 # reason not to.

TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', ' -mbranch-protection=standard', '', d)}"

meta/conf/machine/include/arm/arch-arm64.inc TARGET_FPU = "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', '${TARGET_FPU_64}

Quoted 5 lines
meta/conf/machine/include/arm/arch-arm64.inc +5 -0
+
+# Fix qemu-user crashes while building nodejs/chromium/qtwebengine, defaults ISA is max and it generate SIGILLs
+# qemu: uncaught target signal 4 (Illegal instruction) - core dumped
+# Select the superset ISA
+QEMU_EXTRAOPTIONS_armv8a = "-cpu neoverse-v1”

This is definitely the wrong place for this. What machine are you using here? Can you get a gdb to identify what the instruction failing is?

Ross

author
#4 lore raw

Re: [OE-core] [PATCH 2/2] arch-arm64: Use neoverse-v1 ISA for Qemu usermode

Quoted 17 lines · Ross Burton
Quoted 15 lines · Khem Raj via lists.openembedded.org

With latest qemu several places where qemu-usermode is used e.g. nodejs, qtwebengine, chromium, the builds are failing form armv8a tuned machines (e.g. tegra) which is due to qemu crash ( SIGILL ) encoutered when 'max' ISA is used ( which is default ), max seems to use neoverse-n2 equivalent features, which is evident that SIGILL also happens when using -cpu neoverse-v2, therefore explicitly select neoverse-v1 for ISA, which works and covers almost all (if not all) cpu tunes for armv8 we have.

---
meta/conf/machine/include/arm/arch-arm64.inc | 5 +++++

1 file changed, 5 insertions(+)
Quoted 16 lines

meta/conf/machine/include/arm/arch-arm64.inc TARGET_FPU = "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', '${TARGET_FPU_64}

Quoted 13 lines
meta/conf/machine/include/arm/arch-arm64.inc +0 -0
index 832d0000acb..9639911d33b 100644
@@ -42,3 +42,8 @@ TARGET_FPU = "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', '${TARGET_FPU_64}
 # support these they're meaningless NOP instructions, so there's very little
 # reason not to.

TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', ' -mbranch-protection=standard', '', d)}"

meta/conf/machine/include/arm/arch-arm64.inc +5 -0
+
+# Fix qemu-user crashes while building nodejs/chromium/qtwebengine, defaults ISA is max and it generate SIGILLs
+# qemu: uncaught target signal 4 (Illegal instruction) - core dumped
+# Select the superset ISA
+QEMU_EXTRAOPTIONS_armv8a = "-cpu neoverse-v1”

This is definitely the wrong place for this. What machine are you using here? Can you get a gdb to identify what the instruction failing is?

Looked more into it last night. it happens only with clang/trunk seems to work with binaries built with gcc and clang18 , I guess hold on to it, until further triage.

Quoted 2 lines

Ross

#5 lore raw

Patchtest results for [PATCH 1/2] mesa: Add packageconfig knob to control tegra gallium driver

In reply to Khem Raj

Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:

---
Testing patch /home/patchtest/share/mboxes/1-2-mesa-Add-packageconfig-knob-to-control-tegra-gallium-driver.patch

FAIL: test commit message presence: Please include a commit message on your patch explaining the change (test_mbox.TestMbox.test_commit_message_presence)

PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)

SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: pretest src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.pretest_src_uri_left_files)
SKIP: test CVE check ignore: No modified recipes or older target branch, skipping test (test_metadata.TestMetadata.test_cve_check_ignore)
SKIP: test CVE tag format: No new CVE patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new CVE patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new CVE patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum modified not mentioned: No modified recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.test_src_uri_left_files)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)
SKIP: test target mailing list: Series merged, no reason to check other mailing lists (test_mbox.TestMbox.test_target_mailing_list)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!

#6 lore raw
In reply to Khem Raj

meta/recipes-graphics/mesa/mesa.inc GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'lima', ',lima', ' · line 203

Quoted 2 lines · Khem Raj via lists.openembedded.org
meta/recipes-graphics/mesa/mesa.inc +2 -0
+PACKAGECONFIG[tegra] = ""
+GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'tegra', ',tegra,nouveau', '', d)}"

Why nouveau as well? It's already enabled elsewhere.

Alex

author
#7 lore raw
Quoted 7 lines · Alexander Kanavin

meta/recipes-graphics/mesa/mesa.inc GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'lima', ',lima', ' · line 203

Quoted 2 lines · Khem Raj via lists.openembedded.org
meta/recipes-graphics/mesa/mesa.inc +2 -0
+PACKAGECONFIG[tegra] = ""
+GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'tegra', ',tegra,nouveau', '', d)}"

Why nouveau as well? It's already enabled elsewhere.

Its a direct dependency for tegra gallium driver, In its state currently in mesa recipe its enabled when gallium-llvm packageconfig is set.
That's not a prerequisite for tegra driver.

Quoted 2 lines

Alex