From 4daf3f8c8bcd5ebaeff12f77ee99ba45e8e0ed46 Mon Sep 17 00:00:00 2001 From: Partho Sarthi Date: Wed, 6 Mar 2024 07:31:29 +0000 Subject: [PATCH 1/4] Add GPU architectures to the build-info file Signed-off-by: Partho Sarthi --- build/build-info | 1 + 1 file changed, 1 insertion(+) diff --git a/build/build-info b/build/build-info index ff3836ff89..29ef73a902 100755 --- a/build/build-info +++ b/build/build-info @@ -32,6 +32,7 @@ echo_build_properties() { 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" && find . -name libcudfjni.a -o -name libcudf.a | xargs -n 1 bash -c 'cuobjdump $1 || exit 0' _ | grep 'arch = ' | awk -F_ '{print $2}' | sort -n -u) for arg in "$@"; do echo $arg done From 82cfc384fb05bd90db3dc18da2d5d3110ba689e3 Mon Sep 17 00:00:00 2001 From: Partho Sarthi Date: Wed, 6 Mar 2024 22:17:43 +0000 Subject: [PATCH 2/4] Update pom to include libcudf path and use semi-colon as delimiter in build info script Signed-off-by: Partho Sarthi --- build/build-info | 8 +++++--- pom.xml | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/build/build-info b/build/build-info index 29ef73a902..7fb0bd491a 100755 --- a/build/build-info +++ b/build/build-info @@ -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. @@ -20,19 +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" && find . -name libcudfjni.a -o -name libcudf.a | xargs -n 1 bash -c 'cuobjdump $1 || exit 0' _ | grep 'arch = ' | awk -F_ '{print $2}' | sort -n -u) + echo gpu_architectures=$(cd "$git_path" && cuobjdump "$library_path" 2>/dev/null | grep 'arch = ' | awk -F_ '{print $2}' | sort -n -u | tr '\n' ';') for arg in "$@"; do echo $arg done diff --git a/pom.xml b/pom.xml index 14bfa4bd4a..f7a4fcd354 100644 --- a/pom.xml +++ b/pom.xml @@ -476,6 +476,7 @@ + + From 176c5d609caea80e86d35958f79b7f5ce216dec5 Mon Sep 17 00:00:00 2001 From: Partho Sarthi Date: Wed, 6 Mar 2024 23:59:14 +0000 Subject: [PATCH 3/4] Remove git path and rename libcudf_path Signed-off-by: Partho Sarthi --- build/build-info | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/build-info b/build/build-info index 7fb0bd491a..97aaba360d 100755 --- a/build/build-info +++ b/build/build-info @@ -20,13 +20,13 @@ # Arguments: # version - The current version of the project # git_path - The path to the repository -# library_path - The path to the libcudf library +# libcudf_path - The path to the libcudf library set -e echo_build_properties() { version=$1 git_path=$2 - library_path=$3 + libcudf_path=$3 shift 3 echo version=$version echo user=$USER @@ -34,7 +34,7 @@ echo_build_properties() { 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' ';') + echo gpu_architectures=$(cuobjdump "$libcudf_path" 2>/dev/null | grep 'arch = ' | awk -F_ '{print $2}' | sort -n -u | tr '\n' ';') for arg in "$@"; do echo $arg done From 48eb19a748bd00739650f2e0f7b2e740f6c2350e Mon Sep 17 00:00:00 2001 From: Partho Sarthi Date: Thu, 7 Mar 2024 08:03:22 -0800 Subject: [PATCH 4/4] Remove grep and use awk instead --- build/build-info | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/build-info b/build/build-info index 97aaba360d..bc17cf3983 100755 --- a/build/build-info +++ b/build/build-info @@ -34,7 +34,7 @@ echo_build_properties() { 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=$(cuobjdump "$libcudf_path" 2>/dev/null | grep 'arch = ' | awk -F_ '{print $2}' | sort -n -u | tr '\n' ';') + echo gpu_architectures=$(cuobjdump "$libcudf_path" 2>/dev/null | awk -F_ '/arch =/ {print $2}' | sort -n -u | tr '\n' ';') for arg in "$@"; do echo $arg done