Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for consumer hardware #5

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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