Skip to content

Add discovery of arch-specific vulkan ICD #1125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 5, 2025

Conversation

elezar
Copy link
Member

@elezar elezar commented Jun 2, 2025

On some RPM-based platforms, the path of the Vulkan ICD file include an architecture-specific infix to distinguish it from other architectures. (Most notably x86_64 vs i686). This change attempts to discover the arch-specific ICD file in addition to the standard nvidia_icd.json.

See:

Copy link

@debarshiray debarshiray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this, @elezar !

archSpecificICD = "vulkan/icd.d/nvidia_icd.x86_64.json"
case "arm64":
// TODO: Validate whether the aarch64 infix is correct.
archSpecificICD = "vulkan/icd.d/nvidia_icd.aarch64.json"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think aarch64 is correct. The sources of the RPM Fusion build for the proprietary NVIDIA driver uses %{_target_cpu}, and I expect that to evaluate to aarch64.

See: https://bugzilla.rpmfusion.org/show_bug.cgi?id=7167

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Let's keep it as is and we can follow-up again before the final v1.18.0 release if we have a chance to test on an arm64-based system.

Copy link
Collaborator

@ArangoGutierrez ArangoGutierrez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
thanks for the issues and references

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds architecture-specific Vulkan ICD discovery for RPM-based platforms by importing runtime and including an arch-qualified JSON path alongside the standard ICD file.

  • Import the Go runtime package
  • Determine an arch-specific ICD filename based on runtime.GOARCH
  • Append the arch-specific path to the list of required Vulkan ICD files

Comment on lines 99 to 104
required: []string{
"vulkan/icd.d/nvidia_icd.json",
archSpecificICD,
"vulkan/icd.d/nvidia_layers.json",
"vulkan/implicit_layer.d/nvidia_layers.json",
},
Copy link
Preview

Copilot AI Jun 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If runtime.GOARCH isn't "amd64" or "arm64", archSpecificICD will be an empty string and end up in required, causing an invalid path. Consider appending archSpecificICD only when it's non-empty or adding a default case to the switch.

Suggested change
required: []string{
"vulkan/icd.d/nvidia_icd.json",
archSpecificICD,
"vulkan/icd.d/nvidia_layers.json",
"vulkan/implicit_layer.d/nvidia_layers.json",
},
required: func() []string {
required := []string{
"vulkan/icd.d/nvidia_icd.json",
"vulkan/icd.d/nvidia_layers.json",
"vulkan/implicit_layer.d/nvidia_layers.json",
}
if archSpecificICD != "" {
required = append(required, archSpecificICD)
}
return required
}(),

Copilot uses AI. Check for mistakes.

@coveralls
Copy link

coveralls commented Jun 3, 2025

Pull Request Test Coverage Report for Build 15452754611

Details

  • 0 of 17 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.02%) to 33.247%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/discover/graphics.go 0 17 0.0%
Totals Coverage Status
Change from base Build 15437228265: -0.02%
Covered Lines: 4215
Relevant Lines: 12678

💛 - Coveralls

On some RPM-based platforms, the path of the Vulkan ICD file
include an architecture-specific infix to distinguish it from
other architectures. (Most notably x86_64 vs i686). This change
attempts to discover the arch-specific ICD file in addition to
the standard nvidia_icd.json.

Signed-off-by: Evan Lezar <[email protected]>
@elezar elezar force-pushed the vulkan-target-cpu branch from acbea4f to 2de997e Compare June 4, 2025 21:06
@elezar elezar merged commit 27f5ec8 into NVIDIA:main Jun 5, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants