Skip to main content

CheckpointProcess

Struct CheckpointProcess 

Source
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

Source

pub const fn new(pid: ProcessId) -> Self

Creates a CUDA checkpoint target from an operating-system process ID.

Source

pub const fn from_pid(pid: ProcessId) -> Self

Creates a CUDA checkpoint target from an operating-system process ID.

Source

pub fn current() -> Self

Creates a CUDA checkpoint target for the current process.

Source

pub const fn pid(self) -> ProcessId

Returns the operating-system process ID controlled by this value.

Source

pub fn state(self) -> Result<ProcessState>

Returns the current CUDA checkpoint state of the process.

Source

pub fn is_running(self) -> bool

Returns true when this process currently has ProcessState::Running.

Source

pub fn is_locked(self) -> bool

Returns true when this process currently has ProcessState::Locked.

Source

pub fn is_checkpointed(self) -> bool

Returns true when this process currently has ProcessState::Checkpointed.

Source

pub fn wait_for_state( self, expected: ProcessState, timeout: Duration, ) -> Result<ProcessState>

Blocks until the process reaches expected, or returns a timeout error.

Source

pub fn restore_thread_id(self) -> Result<i32>

Returns the CUDA restore thread ID for the process.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn suspend(self, options: LockOptions) -> Result<()>

Locks and checkpoints a running CUDA process.

On success the process enters ProcessState::Checkpointed.

Source

pub fn toggle( self, options: LockOptions, gpu_pairs: impl AsRef<[GpuPair]>, ) -> Result<ProcessState>

Toggles the process between running and checkpointed states.

Source

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.

Source

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.

Source

pub fn resume(self, gpu_pairs: impl AsRef<[GpuPair]>) -> Result<()>

Restores and unlocks a checkpointed CUDA process.

On success the process enters ProcessState::Running.

Source

pub fn unlock(self) -> Result<()>

Unlocks a locked CUDA process so it can resume CUDA API calls.

On success the process enters ProcessState::Running.

Source

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

Source§

fn clone(&self) -> CheckpointProcess

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for CheckpointProcess

Source§

impl Debug for CheckpointProcess

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for CheckpointProcess

Source§

impl Hash for CheckpointProcess

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for CheckpointProcess

Source§

fn eq(&self, other: &CheckpointProcess) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for CheckpointProcess

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.