Skip to content

Commit

Permalink
Display CUDA device information.
Browse files Browse the repository at this point in the history
e.g. NVIDIA GeForce RTX 2070 (capability 7.5, 7979 MiB), CUDA driver
11.7, runtime 11.7

This is displayed in hyperdrive text preambles as well as calibration
solutions.

NVIDIA terms and conditions are now included in the repo and CI outputs,
as the code to determine the device details was derived from an official
NVIDIA example.
  • Loading branch information
cjordan committed Aug 23, 2022
1 parent a8d2e83 commit b9880b6
Show file tree
Hide file tree
Showing 29 changed files with 3,626 additions and 2,001 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/releases-readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ Other licenses are included from the `hdf5` (COPYING-hdf5), `erfa`
because (as per the terms of the licenses) `hdf5`, `erfa` and `cfitsio` are
compiled inside the `hyperdrive` binary.

An NVIDIA license may also be included as, per the terms of the license,
`hyperdrive` utilises code that was modified from an existing CUDA example.

# x86-64-v3?

This is a [microarchitecture
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
curl https://raw.githubusercontent.com/HDFGroup/hdf5/develop/COPYING -o COPYING-hdf5
curl https://raw.githubusercontent.com/liberfa/erfa/master/LICENSE -o LICENSE-erfa
curl https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/License.txt -o LICENSE-cfitsio
cp cuda/LICENSE-NVIDIA README.md
cp .github/workflows/releases-readme.md README.md
cargo build --release --locked --no-default-features --features=hdf5-static,erfa-static,cfitsio-static
Expand All @@ -57,13 +58,13 @@ jobs:
cargo build --release --locked --no-default-features --features=hdf5-static,erfa-static,cfitsio-static,cuda
mv target/release/hyperdrive .
tar -acvf mwa_hyperdrive-$(git describe --tags)-Linux-x86-64-v3-CUDA-double.tar.gz \
LICENSE COPYING-hdf5 LICENSE-erfa LICENSE-cfitsio README.md \
LICENSE COPYING-hdf5 LICENSE-erfa LICENSE-cfitsio LICENSE-NVIDIA README.md \
hyperdrive
cargo build --release --locked --no-default-features --features=hdf5-static,erfa-static,cfitsio-static,cuda-single
mv target/release/hyperdrive .
tar -acvf mwa_hyperdrive-$(git describe --tags)-Linux-x86-64-v3-CUDA-single.tar.gz \
LICENSE COPYING-hdf5 LICENSE-erfa LICENSE-cfitsio README.md \
LICENSE COPYING-hdf5 LICENSE-erfa LICENSE-cfitsio LICENSE-NVIDIA README.md \
hyperdrive
env:
RUSTFLAGS: "-C target-cpu=x86-64-v3"
Expand Down
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions cuda/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ cuda-single = []
# Link the CUDA library statically.
static = []

[dependencies]
cuda-runtime-sys = "0.3.0-alpha.1" # This should match whatever Marlu is using
log = "0.4.0" # This should match whatever mwa_hyperdrive_common is using

[build-dependencies]
cc = { version = "1.0.72", features = ["parallel"] }
cfg-if = "1.0.0"
25 changes: 25 additions & 0 deletions cuda/LICENSE-NVIDIA
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of NVIDIA CORPORATION nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1 change: 1 addition & 0 deletions cuda/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,6 @@ fn main() {

cuda_target
.file("src_cuda/model.cu")
.file("src_cuda/utils.cu")
.compile("hyperdrive_cu");
}
7 changes: 4 additions & 3 deletions cuda/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
// This is needed only because tests inside bindgen-produced files (model_*.rs
// and memory_*.rs) trigger the warning.
#![allow(deref_nullptr)]

mod utils;

pub use utils::{get_device_info, CudaDeviceInfo, CudaDriverInfo};

// Import Rust bindings to the CUDA code specific to the precision we're using,
// and set corresponding compile-time types.
Expand Down
Loading

0 comments on commit b9880b6

Please sign in to comment.