From cafd195fa615e454ba696f7a2f6ca82d4b7eabb6 Mon Sep 17 00:00:00 2001 From: Carl Pearson Date: Tue, 24 Oct 2023 09:28:09 -0600 Subject: [PATCH] output CSV --- README.md | 1 + v11.sh | 204 +++++++++++++++++++++++++++++++++++++++++++++++------ v12.sh | 205 ++++++++++++++++++++++++++++++++++++++++++++++++------ 3 files changed, 370 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 744b599..d84922b 100644 --- a/README.md +++ b/README.md @@ -3,4 +3,5 @@ ## Prerequisites * GNU parallel +* bc diff --git a/v11.sh b/v11.sh index e949fe1..227d2b1 100755 --- a/v11.sh +++ b/v11.sh @@ -43,14 +43,6 @@ function cuda_release { } function download { - version_re='/([0-9]+\.[0-9]+\.[0-9]+)/' - if [[ $1 =~ $version_re ]]; then - echo ${BASH_REMATCH[1]} - version=${BASH_REMATCH[1]} - else - echo "no match" - exit 1 - fi wget --no-check-certificate -c $1 } export -f download # export to subshells @@ -72,6 +64,13 @@ function cuda_version { echo CUDA_VERSION '(CUDA API Version)' $version } +function dir_size { + fname=$(basename $1) + dirname="${fname%.*}" + size=$(du -s $dirname/$2 | cut -f1) + echo $size +} + function cusparse_version { fname=$(basename $1) dirname="${fname%.*}" @@ -83,10 +82,7 @@ function cusparse_version { } function cusparse_size { - fname=$(basename $1) - dirname="${fname%.*}" - size=$(du -s $dirname/libcusparse | cut -f1) - echo $size B + dir_size $1 libcusparse } function cublas_version { @@ -99,11 +95,75 @@ function cublas_version { echo $major.$minor.$patch.$build } + function cublas_size { + dir_size $1 libcublas +} + +function cuda_size { fname=$(basename $1) dirname="${fname%.*}" - size=$(du -s $dirname/libcublas | cut -f1) - echo $size B + size=$(du -s $dirname | cut -f1) + echo $size +} + +function nvcc_size { + dir_size $1 cuda_nvcc/bin/nvcc +} + +function cufft_size { + dir_size $1 libcufft +} + +function curand_size { + dir_size $1 libcurand +} + +function cusolver_size { + dir_size $1 libcusolver +} + +function npp_size { + dir_size $1 libnpp +} + +function nsight_compute_size { + dir_size $1 nsight_compute +} + +function nsight_systems_size { + dir_size $1 nsight_systems +} + +function cupti_size { + dir_size $1 cuda_cupti +} + +function gdb_size { + dir_size $1 cuda_gdb +} + +function cudart_size { + dir_size $1 cuda_cudart +} + +function nvrtc_size { + dir_size $1 cuda_nvrtc +} + +function nsight_size { + dir_size $1 cuda_nsight +} + +function driver_size { + fname=$(basename $1) + dirname="${fname%.*}" + size=$(du -s $dirname/NVIDIA-* | cut -f1) + echo $size +} + +function pct { + echo "x=$1 / $2 * 100; scale=2; x/1" | bc -l } # echo "downloading" @@ -113,22 +173,126 @@ function cublas_size { # nice -n20 parallel -j${SIMULTANEOUS_EXTRACTS} extract {} ::: ${URLS[*]} echo "" -echo "" +echo "" for url in ${URLS[*]}; do _r=$(cuda_release "$url") _cs_v=$(cusparse_version "$url") - _cs_s=$(cusparse_size "$url") - echo "" + _cb_v=$(cublas_version "$url") + echo "" done echo "
CUDA Release cuSPARSE Version cuSPARSE Size (B)
CUDA Release cuSPARSE Version cuBLAS Version
$_r $_cs_v $_cs_s
$_r $_cs_v $_cb_v
" echo "" -echo "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo "" for url in ${URLS[*]}; do _r=$(cuda_release "$url") - _cb_v=$(cublas_version "$url") + _c_s=$(cuda_size "$url") + _cs_s=$(cusparse_size "$url") _cb_s=$(cublas_size "$url") - echo "" + _nvcc_s=$(nvcc_size "$url") + _cufft_s=$(cufft_size "$url") + _curand_s=$(curand_size "$url") + _cusolver_s=$(cusolver_size "$url") + _npp_s=$(npp_size "$url") + _nsight_compute_s=$(nsight_compute_size "$url") + _nsight_systems_s=$(nsight_systems_size "$url") + _cupti_s=$(cupti_size "$url") + _gdb_s=$(gdb_size "$url") + _cudart_s=$(cudart_size "$url") + _nvrtc_s=$(nvrtc_size "$url") + _nsight_s=$(nsight_size "$url") + _driver_s=$(driver_size "$url") + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo "" done echo "
CUDA Release cuBLAS Version cuBLAS Size (B)
CUDA Release Size (K) cuSPARSE Size cuBLAS Size nvcc Size cuFFT Size cuRAND Size cuSOLVER Size npp Size Nsight Compute Nsight Systems cuPTI Size CUDA GDB Size cudart Size nvrtc Size nsight Size driver Size
$_r $_cb_v $_cb_s
$_r $_c_s $_cs_s ("$(pct $_cs_s $_c_s)"%) $_cb_s ("$(pct $_cb_s $_c_s)"%) $_nvcc_s ("$(pct $_nvcc_s $_c_s)"%) $_cufft_s ("$(pct $_cufft_s $_c_s)"%) $_curand_s ("$(pct $_curand_s $_c_s)"%) $_cusolver_s ("$(pct $_cusolver_s $_c_s)"%) $_npp_s ("$(pct $_npp_s $_c_s)"%) $_nsight_compute_s ("$(pct $_nsight_systems_s $_c_s)"%) $_nsight_systems_s ("$(pct $_nsight_compute_s $_c_s)"%) $_cupti_s ("$(pct $_cupti_s $_c_s)"%) $_gdb_s ("$(pct $_gdb_s $_c_s)"%) $_cudart_s ("$(pct $_cudart_s $_c_s)"%) $_nvrtc_s ("$(pct $_nvrtc_s $_c_s)"%) $_nsight_s ("$(pct $_nsight_s $_c_s)"%) $_driver_s ("$(pct $_driver_s $_c_s)"%)
" + + +echo -n "CUDA Release," +echo -n "cuSPARSE," +echo -n "cuBLAS," +echo -n "nvcc," +echo -n "cuFFT," +echo -n "cuRAND," +echo -n "cuSOLVER," +echo -n "npp," +echo -n "Nsight Compute," +echo -n "Nsight Systems," +echo -n "cuPTI," +echo -n "CUDA GDB," +echo -n "cudart," +echo -n "nvrtc," +echo -n "nsight," +echo -n "driver," +echo "" +for url in ${URLS[*]}; do + _r=$(cuda_release "$url") + _c_s=$(cuda_size "$url") + _cs_s=$(cusparse_size "$url") + _cb_s=$(cublas_size "$url") + _nvcc_s=$(nvcc_size "$url") + _cufft_s=$(cufft_size "$url") + _curand_s=$(curand_size "$url") + _cusolver_s=$(cusolver_size "$url") + _npp_s=$(npp_size "$url") + _nsight_compute_s=$(nsight_compute_size "$url") + _nsight_systems_s=$(nsight_systems_size "$url") + _cupti_s=$(cupti_size "$url") + _gdb_s=$(gdb_size "$url") + _cudart_s=$(cudart_size "$url") + _nvrtc_s=$(nvrtc_size "$url") + _nsight_s=$(nsight_size "$url") + _driver_s=$(driver_size "$url") + echo -n "$_r," + echo -n "$_cs_s," + echo -n "$_cb_s," + echo -n "$_nvcc_s," + echo -n "$_cufft_s," + echo -n "$_curand_s," + echo -n "$_cusolver_s," + echo -n "$_npp_s," + echo -n "$_nsight_compute_s," + echo -n "$_nsight_systems_s," + echo -n "$_cupti_s," + echo -n "$_gdb_s," + echo -n "$_cudart_s," + echo -n "$_nvrtc_s," + echo -n "$_nsight_s," + echo -n "$_driver_s," + echo "" +done \ No newline at end of file diff --git a/v12.sh b/v12.sh index 5bac6d4..27ffe9b 100755 --- a/v12.sh +++ b/v12.sh @@ -24,14 +24,6 @@ function cuda_release { } function download { - version_re='/([0-9]+\.[0-9]+\.[0-9]+)/' - if [[ $1 =~ $version_re ]]; then - echo ${BASH_REMATCH[1]} - version=${BASH_REMATCH[1]} - else - echo "no match" - exit 1 - fi wget --no-check-certificate -c $1 } export -f download # export to subshells @@ -53,6 +45,13 @@ function cuda_version { echo CUDA_VERSION '(CUDA API Version)' $version } +function dir_size { + fname=$(basename $1) + dirname="${fname%.*}" + size=$(du -s $dirname/$2 | cut -f1) + echo $size +} + function cusparse_version { fname=$(basename $1) dirname="${fname%.*}" @@ -64,10 +63,7 @@ function cusparse_version { } function cusparse_size { - fname=$(basename $1) - dirname="${fname%.*}" - size=$(du -s $dirname/libcusparse | cut -f1) - echo $size B + dir_size $1 libcusparse } function cublas_version { @@ -80,11 +76,75 @@ function cublas_version { echo $major.$minor.$patch.$build } + function cublas_size { + dir_size $1 libcublas +} + +function cuda_size { fname=$(basename $1) dirname="${fname%.*}" - size=$(du -s $dirname/libcublas | cut -f1) - echo $size B + size=$(du -s $dirname | cut -f1) + echo $size +} + +function nvcc_size { + dir_size $1 cuda_nvcc/bin/nvcc +} + +function cufft_size { + dir_size $1 libcufft +} + +function curand_size { + dir_size $1 libcurand +} + +function cusolver_size { + dir_size $1 libcusolver +} + +function npp_size { + dir_size $1 libnpp +} + +function nsight_compute_size { + dir_size $1 nsight_compute +} + +function nsight_systems_size { + dir_size $1 nsight_systems +} + +function cupti_size { + dir_size $1 cuda_cupti +} + +function gdb_size { + dir_size $1 cuda_gdb +} + +function cudart_size { + dir_size $1 cuda_cudart +} + +function nvrtc_size { + dir_size $1 cuda_nvrtc +} + +function nsight_size { + dir_size $1 cuda_nsight +} + +function driver_size { + fname=$(basename $1) + dirname="${fname%.*}" + size=$(du -s $dirname/NVIDIA-* | cut -f1) + echo $size +} + +function pct { + echo "x=$1 / $2 * 100; scale=2; x/1" | bc -l } # echo "downloading" @@ -94,21 +154,126 @@ function cublas_size { # nice -n20 parallel -j${SIMULTANEOUS_EXTRACTS} extract {} ::: ${URLS[*]} echo "" -echo "" +echo "" for url in ${URLS[*]}; do _r=$(cuda_release "$url") _cs_v=$(cusparse_version "$url") - _cs_s=$(cusparse_size "$url") - echo "" + _cb_v=$(cublas_version "$url") + echo "" done echo "
CUDA Release cuSPARSE Version cuSPARSE Size (B)
CUDA Release cuSPARSE Version cuBLAS Version
$_r $_cs_v $_cs_s
$_r $_cs_v $_cb_v
" echo "" -echo "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo -n "" +echo "" for url in ${URLS[*]}; do _r=$(cuda_release "$url") - _cb_v=$(cublas_version "$url") + _c_s=$(cuda_size "$url") + _cs_s=$(cusparse_size "$url") _cb_s=$(cublas_size "$url") - echo "" + _nvcc_s=$(nvcc_size "$url") + _cufft_s=$(cufft_size "$url") + _curand_s=$(curand_size "$url") + _cusolver_s=$(cusolver_size "$url") + _npp_s=$(npp_size "$url") + _nsight_compute_s=$(nsight_compute_size "$url") + _nsight_systems_s=$(nsight_systems_size "$url") + _cupti_s=$(cupti_size "$url") + _gdb_s=$(gdb_size "$url") + _cudart_s=$(cudart_size "$url") + _nvrtc_s=$(nvrtc_size "$url") + _nsight_s=$(nsight_size "$url") + _driver_s=$(driver_size "$url") + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo -n "" + echo "" done echo "
CUDA Release cuBLAS Version cuBLAS Size (B)
CUDA Release Size (K) cuSPARSE Size cuBLAS Size nvcc Size cuFFT Size cuRAND Size cuSOLVER Size npp Size Nsight Compute Nsight Systems cuPTI Size CUDA GDB Size cudart Size nvrtc Size nsight Size driver Size
$_r $_cb_v $_cb_s
$_r $_c_s $_cs_s ("$(pct $_cs_s $_c_s)"%) $_cb_s ("$(pct $_cb_s $_c_s)"%) $_nvcc_s ("$(pct $_nvcc_s $_c_s)"%) $_cufft_s ("$(pct $_cufft_s $_c_s)"%) $_curand_s ("$(pct $_curand_s $_c_s)"%) $_cusolver_s ("$(pct $_cusolver_s $_c_s)"%) $_npp_s ("$(pct $_npp_s $_c_s)"%) $_nsight_compute_s ("$(pct $_nsight_systems_s $_c_s)"%) $_nsight_systems_s ("$(pct $_nsight_compute_s $_c_s)"%) $_cupti_s ("$(pct $_cupti_s $_c_s)"%) $_gdb_s ("$(pct $_gdb_s $_c_s)"%) $_cudart_s ("$(pct $_cudart_s $_c_s)"%) $_nvrtc_s ("$(pct $_nvrtc_s $_c_s)"%) $_nsight_s ("$(pct $_nsight_s $_c_s)"%) $_driver_s ("$(pct $_driver_s $_c_s)"%)
" + + + +echo -n "CUDA Release," +echo -n "cuSPARSE," +echo -n "cuBLAS," +echo -n "nvcc," +echo -n "cuFFT," +echo -n "cuRAND," +echo -n "cuSOLVER," +echo -n "npp," +echo -n "Nsight Compute," +echo -n "Nsight Systems," +echo -n "cuPTI," +echo -n "CUDA GDB," +echo -n "cudart," +echo -n "nvrtc," +echo -n "nsight," +echo -n "driver," +echo "" +for url in ${URLS[*]}; do + _r=$(cuda_release "$url") + _c_s=$(cuda_size "$url") + _cs_s=$(cusparse_size "$url") + _cb_s=$(cublas_size "$url") + _nvcc_s=$(nvcc_size "$url") + _cufft_s=$(cufft_size "$url") + _curand_s=$(curand_size "$url") + _cusolver_s=$(cusolver_size "$url") + _npp_s=$(npp_size "$url") + _nsight_compute_s=$(nsight_compute_size "$url") + _nsight_systems_s=$(nsight_systems_size "$url") + _cupti_s=$(cupti_size "$url") + _gdb_s=$(gdb_size "$url") + _cudart_s=$(cudart_size "$url") + _nvrtc_s=$(nvrtc_size "$url") + _nsight_s=$(nsight_size "$url") + _driver_s=$(driver_size "$url") + echo -n "$_r," + echo -n "$_cs_s," + echo -n "$_cb_s," + echo -n "$_nvcc_s," + echo -n "$_cufft_s," + echo -n "$_curand_s," + echo -n "$_cusolver_s," + echo -n "$_npp_s," + echo -n "$_nsight_compute_s," + echo -n "$_nsight_systems_s," + echo -n "$_cupti_s," + echo -n "$_gdb_s," + echo -n "$_cudart_s," + echo -n "$_nvrtc_s," + echo -n "$_nsight_s," + echo -n "$_driver_s," + echo "" +done \ No newline at end of file