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

Add GPU architectures to the build-info file #1840

Merged
merged 4 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions build/build-info
jlowe marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

#
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2022-2024, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -20,18 +20,21 @@
# Arguments:
# version - The current version of the project
# git_path - The path to the repository
# library_path - The path to the libcudf library
set -e

echo_build_properties() {
version=$1
git_path=$2
shift 2
library_path=$3
shift 3
echo version=$version
echo user=$USER
echo revision=$(cd "$git_path" && git rev-parse HEAD)
echo branch=$(cd "$git_path" && git rev-parse --abbrev-ref HEAD)
echo date=$(date -u +%Y-%m-%dT%H:%M:%SZ)
echo url=$(cd "$git_path" && git config --get remote.origin.url)
echo gpu_architectures=$(cd "$git_path" && cuobjdump "$library_path" 2>/dev/null | grep 'arch = ' | awk -F_ '{print $2}' | sort -n -u | tr '\n' ';')
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: not a git op and no need to cd?

Suggested change
echo gpu_architectures=$(cd "$git_path" && cuobjdump "$library_path" 2>/dev/null | grep 'arch = ' | awk -F_ '{print $2}' | sort -n -u | tr '\n' ';')
echo gpu_architectures=$(cuobjdump "$library_path" 2>/dev/null | grep 'arch = ' | awk -F_ '{print $2}' | sort -n -u | tr '\n' ';')

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It kept it as safety but the build paths are absolute. Refactored as suggested.

for arg in "$@"; do
echo $arg
done
Expand Down
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -476,13 +476,15 @@
<arg value="${project.basedir}/build/build-info"/>
<arg value="${project.version}"/>
<arg value="${cudf.path}"/>
<arg value="${libcudf.build.path}/libcudf.a"/>
</exec>
<exec executable="bash"
output="${project.build.directory}/extra-resources/spark-rapids-jni-version-info.properties"
failonerror="true">
<arg value="${project.basedir}/build/build-info"/>
<arg value="${project.version}"/>
<arg value="${project.basedir}"/>
<arg value="${native.build.path}/libcudf.so"/>
</exec>
</target>
</configuration>
Expand Down
Loading