Skip to content

Commit

Permalink
Add support for consumer hardware
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-joruk committed Jan 7, 2024
1 parent 4d43df5 commit 0db2690
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nvfbc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This library contains a safe FFI for [NVFBC](https://developer.nvidia.com/captur
## Supported GPUs
As this uses a proprietary NVIDIA API, the supported devices are limited to NVIDIA GPUs.
Additionally, the NVFBC API is only officially supported on GRID, Tesla, or Quadro X2000+ GPUs.
Unofficial support is possible by applying a [patch](https://github.com/illnyang/nvlax/) to the NVFBC library.
Unofficial support is provided for other GPUs.

## Supported capture types
Currently only CUDA and system (RAM) capture types are supported.
Expand Down
5 changes: 5 additions & 0 deletions nvfbc/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@ pub(crate) fn check_ret(handle: Handle, ret: nvfbc_sys::_NVFBCSTATUS) -> Result<
}

pub(crate) fn create_handle() -> Result<nvfbc_sys::NVFBC_SESSION_HANDLE, Error> {
const MAGIC_PRIVATE_DATA: [u32; 4] = [0xAEF57AC5, 0x401D1A39, 0x1B856BBE, 0x9ED0CEBA];

let mut params: nvfbc_sys::_NVFBC_CREATE_HANDLE_PARAMS = unsafe { MaybeUninit::zeroed().assume_init() };
params.dwVersion = nvfbc_sys::NVFBC_CREATE_HANDLE_PARAMS_VER;
params.privateData = MAGIC_PRIVATE_DATA.as_ptr() as _;
params.privateDataSize = std::mem::size_of_val(&MAGIC_PRIVATE_DATA) as u32;

let mut handle = 0;
let ret = unsafe { nvfbc_sys::NvFBCCreateHandle(
&mut handle,
Expand Down
2 changes: 1 addition & 1 deletion nvfbc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! # Supported GPUs
//! As this uses a proprietary NVIDIA API, the supported devices are limited to NVIDIA GPUs.
//! Additionally, the NVFBC API is only officially supported on GRID, Tesla, or Quadro X2000+ GPUs.
//! Unofficial support is possible by applying a [patch](https://github.com/illnyang/nvlax/) to the NVFBC library.
//! Unofficial support is provided for other GPUs.
//!
//! # Supported capture types
//! Currently only CUDA and system (RAM) capture types are supported.
Expand Down

0 comments on commit 0db2690

Please sign in to comment.