pub struct CheckpointProcess { /* private fields */ }Expand description
A CUDA process controlled through the driver checkpoint APIs.
These APIs are intended for an external controller process. Locking a process blocks further CUDA API calls in that process until it is restored and unlocked.
Implementations§
Source§impl CheckpointProcess
impl CheckpointProcess
Sourcepub const fn new(pid: ProcessId) -> Self
pub const fn new(pid: ProcessId) -> Self
Creates a CUDA checkpoint target from an operating-system process ID.
Sourcepub const fn from_pid(pid: ProcessId) -> Self
pub const fn from_pid(pid: ProcessId) -> Self
Creates a CUDA checkpoint target from an operating-system process ID.
Sourcepub const fn pid(self) -> ProcessId
pub const fn pid(self) -> ProcessId
Returns the operating-system process ID controlled by this value.
Sourcepub fn state(self) -> Result<ProcessState>
pub fn state(self) -> Result<ProcessState>
Returns the current CUDA checkpoint state of the process.
Sourcepub fn is_running(self) -> bool
pub fn is_running(self) -> bool
Returns true when this process currently has ProcessState::Running.
Sourcepub fn is_locked(self) -> bool
pub fn is_locked(self) -> bool
Returns true when this process currently has ProcessState::Locked.
Sourcepub fn is_checkpointed(self) -> bool
pub fn is_checkpointed(self) -> bool
Returns true when this process currently has ProcessState::Checkpointed.
Sourcepub fn wait_for_state(
self,
expected: ProcessState,
timeout: Duration,
) -> Result<ProcessState>
pub fn wait_for_state( self, expected: ProcessState, timeout: Duration, ) -> Result<ProcessState>
Blocks until the process reaches expected, or returns a timeout error.
Sourcepub fn restore_thread_id(self) -> Result<i32>
pub fn restore_thread_id(self) -> Result<i32>
Returns the CUDA restore thread ID for the process.
Sourcepub fn lock(self, options: LockOptions) -> Result<()>
pub fn lock(self, options: LockOptions) -> Result<()>
Locks a running CUDA process so further CUDA API calls in that process block.
On success the process enters ProcessState::Locked.
Sourcepub fn try_lock(self, options: LockOptions) -> Result<LockResult>
pub fn try_lock(self, options: LockOptions) -> Result<LockResult>
Attempts to lock a running CUDA process and reports whether the timeout was hit.
On success the process usually enters ProcessState::Locked. If a timeout
is set and reached, this returns LockResult::TimedOut.
Sourcepub fn checkpoint(self) -> Result<()>
pub fn checkpoint(self) -> Result<()>
Moves the locked process’s GPU memory into host memory managed by the driver.
On success the process enters ProcessState::Checkpointed.
Sourcepub fn checkpoint_with_options(self, options: CheckpointOptions) -> Result<()>
pub fn checkpoint_with_options(self, options: CheckpointOptions) -> Result<()>
Moves the locked process’s GPU memory into host memory managed by the driver.
This variant accepts explicit checkpoint options.
Sourcepub fn suspend(self, options: LockOptions) -> Result<()>
pub fn suspend(self, options: LockOptions) -> Result<()>
Locks and checkpoints a running CUDA process.
On success the process enters ProcessState::Checkpointed.
Sourcepub fn toggle(
self,
options: LockOptions,
gpu_pairs: impl AsRef<[GpuPair]>,
) -> Result<ProcessState>
pub fn toggle( self, options: LockOptions, gpu_pairs: impl AsRef<[GpuPair]>, ) -> Result<ProcessState>
Toggles the process between running and checkpointed states.
- From
Running, performsCheckpointProcess::suspend. - From
Checkpointed, performsCheckpointProcess::resume.
Sourcepub fn restore_with_options(self, options: RestoreOptions) -> Result<()>
pub fn restore_with_options(self, options: RestoreOptions) -> Result<()>
Restores a checkpointed process, optionally remapping checkpointed GPUs.
If gpu_pairs is not empty, CUDA requires it to contain every
checkpointed GPU.
On success the process enters ProcessState::Locked.
Sourcepub fn restore(self, gpu_pairs: impl AsRef<[GpuPair]>) -> Result<()>
pub fn restore(self, gpu_pairs: impl AsRef<[GpuPair]>) -> Result<()>
Restores a checkpointed process, optionally remapping checkpointed GPUs.
If gpu_pairs is not empty, CUDA requires it to contain every
checkpointed GPU.
On success the process enters ProcessState::Locked.
Sourcepub fn resume(self, gpu_pairs: impl AsRef<[GpuPair]>) -> Result<()>
pub fn resume(self, gpu_pairs: impl AsRef<[GpuPair]>) -> Result<()>
Restores and unlocks a checkpointed CUDA process.
On success the process enters ProcessState::Running.
Sourcepub fn unlock(self) -> Result<()>
pub fn unlock(self) -> Result<()>
Unlocks a locked CUDA process so it can resume CUDA API calls.
On success the process enters ProcessState::Running.
Sourcepub fn unlock_with_options(self, options: UnlockOptions) -> Result<()>
pub fn unlock_with_options(self, options: UnlockOptions) -> Result<()>
Unlocks a locked CUDA process so it can resume CUDA API calls with options.
On success the process enters ProcessState::Running.
Trait Implementations§
Source§impl Clone for CheckpointProcess
impl Clone for CheckpointProcess
Source§fn clone(&self) -> CheckpointProcess
fn clone(&self) -> CheckpointProcess
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CheckpointProcess
Source§impl Debug for CheckpointProcess
impl Debug for CheckpointProcess
impl Eq for CheckpointProcess
Source§impl Hash for CheckpointProcess
impl Hash for CheckpointProcess
Source§impl PartialEq for CheckpointProcess
impl PartialEq for CheckpointProcess
Source§fn eq(&self, other: &CheckpointProcess) -> bool
fn eq(&self, other: &CheckpointProcess) -> bool
self and other values to be equal, and is used by ==.