Skip to content

Commit

Permalink
Add some notes in the gpu_info implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
CSpyridakis committed Nov 26, 2024
1 parent 7b4f1fb commit 0367950
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion edgeless_node/src/gpu_info/jetson.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ pub fn jetson_get_mem_size_gpu() -> i32 {
/// # Returns
/// * `i32` - The number of available GPUs or a negative number if the operation fails
pub fn jetson_get_num_gpus() -> i32 {
1 // TODO: implement this
// Jetson boards only contain a single GPU
// see: https://forums.developer.nvidia.com/t/detect-number-of-gpus/314622
1
}

/// Determines if the system is a Jetson board by checking `/sys/firmware/devicetree/base/model`.
Expand Down
11 changes: 11 additions & 0 deletions edgeless_node/src/gpu_info/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@

pub mod jetson;

// =====================================================================================
// *** IMPORTANT ***
// To support an additional GPU in the future, follow these steps:
//
// 1. Create a new .rs file in the same directory for the newly supported GPU.
// 2. Update `enum BoardType` to accommodate the new hardware.
// 3. Implement accessors (getters) for the newly supported hardware in its .rs file,
// e.g., is_nvidia_board(), nvidia::nvidia_get_gpu_temp(), etc.
// 4. Update this source code's API calls to handle the new hardware if it is detected.
// =====================================================================================

/// Enum to represent different board types.
/// If you need to support more board types, add them here.
#[derive(Debug, PartialEq)]
Expand Down

0 comments on commit 0367950

Please sign in to comment.