mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-23 20:05:11 +00:00
nvidia/cuda/context: Log the current device name, UUId und LUId
This commit is contained in:
parent
1a5dad8d97
commit
6ba51efceb
1 changed files with 23 additions and 0 deletions
|
@ -90,6 +90,29 @@ streamfx::nvidia::cuda::context::context(ID3D11Device* device) : context()
|
|||
throw std::runtime_error("Failed to acquire primary device context.");
|
||||
}
|
||||
|
||||
// Log some information.
|
||||
std::string device_name;
|
||||
uuid_t device_uuid;
|
||||
luid_t device_luid;
|
||||
uint32_t device_luid_mask;
|
||||
{
|
||||
// Device Name
|
||||
std::vector<char> name(256, 0);
|
||||
_cuda->cuDeviceGetName(name.data(), name.size() - 1, _device);
|
||||
device_name = std::string(name.data(), name.data() + strlen(name.data()));
|
||||
|
||||
// Device LUID
|
||||
_cuda->cuDeviceGetLuid(&device_luid, &device_luid_mask, _device);
|
||||
|
||||
// Device UUID
|
||||
_cuda->cuDeviceGetUuid(&device_uuid, _device);
|
||||
}
|
||||
|
||||
D_LOG_INFO("Initialized CUDA on device '%s' (%08" PRIx32 "-%04" PRIx16 "-%04" PRIx16 "-%04" PRIx16 "-%04" PRIx16
|
||||
"%08" PRIx32 ", %08" PRIx64 ", %" PRIu32 ").",
|
||||
device_name.c_str(), device_uuid.uuid.a, device_uuid.uuid.b, device_uuid.uuid.c, device_uuid.uuid.d,
|
||||
device_uuid.uuid.e, device_uuid.uuid.f, device_luid.luid, device_luid_mask);
|
||||
|
||||
_has_device = true;
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue