-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Pull Request resolved: #100 DCGM conflicts with other NV tools and libraries, adding pause and resume functionality for oss dynolog Reviewed By: bigzachattack Differential Revision: D42753238 Privacy Context Container: L1137347 fbshipit-source-id: 48fb22a6e32e06f41a018191c1b0654e1dd03df7
- Loading branch information
1 parent
7d04a00
commit 740b9c8
Showing
11 changed files
with
213 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright (c) Meta Platforms, Inc. and affiliates. | ||
// | ||
// This source code is licensed under the MIT license found in the | ||
// LICENSE file in the root directory of this source tree. | ||
|
||
use std::net::TcpStream; | ||
|
||
use anyhow::Result; | ||
|
||
#[path = "utils.rs"] | ||
mod utils; | ||
|
||
// This module contains the handling logic for dcgm | ||
|
||
/// Pause dcgm module profiling | ||
pub fn run_dcgm_pause(client: TcpStream, duration_s: i32) -> Result<()> { | ||
let request_json = format!( | ||
r#" | ||
{{ | ||
"fn": "dcgmProfPause", | ||
"duration_s": {} | ||
}}"#, | ||
duration_s | ||
); | ||
|
||
utils::send_msg(&client, &request_json).expect("Error sending message to service"); | ||
|
||
let resp_str = utils::get_resp(&client).expect("Unable to decode output bytes"); | ||
|
||
println!("response = {}", resp_str); | ||
|
||
Ok(()) | ||
} | ||
|
||
/// Resume dcgm module profiling | ||
pub fn run_dcgm_resume(client: TcpStream) -> Result<()> { | ||
utils::send_msg(&client, r#"{"fn":"dcgmProfResume"}"#) | ||
.expect("Error sending message to service"); | ||
|
||
let resp_str = utils::get_resp(&client).expect("Unable to decode output bytes"); | ||
|
||
println!("response = {}", resp_str); | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.