Skip to content
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

ecs-gpu-init: clean up linker flags #3920

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

yeazelm
Copy link
Contributor

@yeazelm yeazelm commented Apr 26, 2024

This commit was cherry picked from #3887 since we took the SDK where the change was needed. This avoids building ecs-gpu-init with broken symbols which show up with these errors in the system log:

[   14.946273] ecs-gpu-init[1868]: /usr/bin/ecs-gpu-init: symbol lookup error: /usr/bin/ecs-gpu-init: undefined symbol: nvmlGpuInstanceGetComputeInstanceProfileInfoV
[FAILED] Failed to start Initialize ECS GPU config.
See 'systemctl status ecs-gpu-init.service' for details.
[DEPEND] Dependency failed for Bottlerocket initial configuration complete.
[DEPEND] Dependency failed for Isolates configured.target.

From the original commit:
--export-dynamic is a separate option, independent of -z, so pass it as its own -Wl flag.

For consistency, pass the same flags to the external linker.

Thanks for @bcressey for having this fix already under review!

Testing done:
Built an aws-ecs-2-nvidia image and it boots correctly and uses the GPU

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

`--export-dynamic` is a separate option, independent of `-z`, so pass
it as its own `-Wl` flag.

For consistency, pass the same flags to the external linker.

Signed-off-by: Ben Cressey <bcressey@amazon.com>
(cherry picked from commit 182a188)
@yeazelm yeazelm requested a review from bcressey April 26, 2024 21:26
@bcressey
Copy link
Contributor

I wrote the commit so I'm not going to click "Approve", but I approve in spirit!

@yeazelm
Copy link
Contributor Author

yeazelm commented Apr 26, 2024

I wrote the commit so I'm not going to click "Approve", but I approve in spirit!

I figured but wanted to make sure you knew it was happening :)

@yeazelm yeazelm merged commit 5f1d42b into bottlerocket-os:develop Apr 26, 2024
33 checks passed
@yeazelm yeazelm deleted the ecs-gpu-init-from-ben branch April 26, 2024 21:59
Copy link
Member

@larvacea larvacea left a comment

Choose a reason for hiding this comment

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

LDFLAGS are the worst. Just saying. Because of course -Wl,-z,relro -Wl

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.

None yet

5 participants