* [FFmpeg-devel] [PATCH] Add functions to identify devices in more ways
@ 2023-05-09 10:11 rcombs
2023-05-09 10:16 ` Timo Rothenpieler
2023-05-09 10:56 ` Timo Rothenpieler
0 siblings, 2 replies; 4+ messages in thread
From: rcombs @ 2023-05-09 10:11 UTC (permalink / raw)
To: ffmpeg-devel
- cuDeviceGetUuid_v2, giving distinct IDs for different MIG instances
- cuDeviceGetLuid, giving a Win32 LUID to match with DXGI and other APIs
- cuDeviceGetByPCIBusId, retrieving a device that matches a PCI bus ID string
- cuDeviceGetPCIBusId, giving a PCI bus ID string for a device
---
include/ffnvcodec/dynlink_cuda.h | 4 ++++
include/ffnvcodec/dynlink_loader.h | 8 ++++++++
2 files changed, 12 insertions(+)
diff --git a/include/ffnvcodec/dynlink_cuda.h b/include/ffnvcodec/dynlink_cuda.h
index baafa49..d52d793 100644
--- a/include/ffnvcodec/dynlink_cuda.h
+++ b/include/ffnvcodec/dynlink_cuda.h
@@ -355,6 +355,10 @@ typedef CUresult CUDAAPI tcuDeviceGet(CUdevice *device, int ordinal);
typedef CUresult CUDAAPI tcuDeviceGetAttribute(int *pi, CUdevice_attribute attrib, CUdevice dev);
typedef CUresult CUDAAPI tcuDeviceGetName(char *name, int len, CUdevice dev);
typedef CUresult CUDAAPI tcuDeviceGetUuid(CUuuid *uuid, CUdevice dev);
+typedef CUresult CUDAAPI tcuDeviceGetUuid_v2(CUuuid *uuid, CUdevice dev);
+typedef CUresult CUDAAPI tcuDeviceGetLuid(char* luid, unsigned int* deviceNodeMask, CUdevice dev);
+typedef CUresult CUDAAPI tcuDeviceGetByPCIBusId(CUdevice* dev, const char* pciBusId);
+typedef CUresult CUDAAPI tcuDeviceGetPCIBusId(char* pciBusId, int len, CUdevice dev);
typedef CUresult CUDAAPI tcuDeviceComputeCapability(int *major, int *minor, CUdevice dev);
typedef CUresult CUDAAPI tcuCtxCreate_v2(CUcontext *pctx, unsigned int flags, CUdevice dev);
typedef CUresult CUDAAPI tcuCtxSetLimit(CUlimit limit, size_t value);
diff --git a/include/ffnvcodec/dynlink_loader.h b/include/ffnvcodec/dynlink_loader.h
index 85aebf4..14d17e3 100644
--- a/include/ffnvcodec/dynlink_loader.h
+++ b/include/ffnvcodec/dynlink_loader.h
@@ -142,6 +142,10 @@ typedef struct CudaFunctions {
tcuDeviceGetAttribute *cuDeviceGetAttribute;
tcuDeviceGetName *cuDeviceGetName;
tcuDeviceGetUuid *cuDeviceGetUuid;
+ tcuDeviceGetUuid_v2 *cuDeviceGetUuid_v2;
+ tcuDeviceGetLuid *cuDeviceGetLuid;
+ tcuDeviceGetByPCIBusId *cuDeviceGetByPCIBusId;
+ tcuDeviceGetPCIBusId *cuDeviceGetPCIBusId;
tcuDeviceComputeCapability *cuDeviceComputeCapability;
tcuCtxCreate_v2 *cuCtxCreate;
tcuCtxSetLimit *cuCtxSetLimit;
@@ -337,6 +341,10 @@ static inline int cuda_load_functions(CudaFunctions **functions, void *logctx)
LOAD_SYMBOL(cuGraphicsSubResourceGetMappedArray, tcuGraphicsSubResourceGetMappedArray, "cuGraphicsSubResourceGetMappedArray");
LOAD_SYMBOL_OPT(cuDeviceGetUuid, tcuDeviceGetUuid, "cuDeviceGetUuid");
+ LOAD_SYMBOL_OPT(cuDeviceGetUuid_v2, tcuDeviceGetUuid_v2, "cuDeviceGetUuid_v2");
+ LOAD_SYMBOL_OPT(cuDeviceGetLuid, tcuDeviceGetLuid, "cuDeviceGetLuid");
+ LOAD_SYMBOL_OPT(cuDeviceGetByPCIBusId, tcuDeviceGetByPCIBusId, "cuDeviceGetByPCIBusId");
+ LOAD_SYMBOL_OPT(cuDeviceGetPCIBusId, tcuDeviceGetPCIBusId, "cuDeviceGetPCIBusId");
LOAD_SYMBOL_OPT(cuImportExternalMemory, tcuImportExternalMemory, "cuImportExternalMemory");
LOAD_SYMBOL_OPT(cuDestroyExternalMemory, tcuDestroyExternalMemory, "cuDestroyExternalMemory");
LOAD_SYMBOL_OPT(cuExternalMemoryGetMappedBuffer, tcuExternalMemoryGetMappedBuffer, "cuExternalMemoryGetMappedBuffer");
--
2.39.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH] Add functions to identify devices in more ways
2023-05-09 10:11 [FFmpeg-devel] [PATCH] Add functions to identify devices in more ways rcombs
@ 2023-05-09 10:16 ` Timo Rothenpieler
2023-05-09 10:24 ` Ridley Combs
2023-05-09 10:56 ` Timo Rothenpieler
1 sibling, 1 reply; 4+ messages in thread
From: Timo Rothenpieler @ 2023-05-09 10:16 UTC (permalink / raw)
To: ffmpeg-devel
On 09/05/2023 12:11, rcombs wrote:
> - cuDeviceGetUuid_v2, giving distinct IDs for different MIG instances
> - cuDeviceGetLuid, giving a Win32 LUID to match with DXGI and other APIs
> - cuDeviceGetByPCIBusId, retrieving a device that matches a PCI bus ID string
> - cuDeviceGetPCIBusId, giving a PCI bus ID string for a device
Looks good to me. What do you need those for?
Interop with D3D1x/Vulkan?
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH] Add functions to identify devices in more ways
2023-05-09 10:16 ` Timo Rothenpieler
@ 2023-05-09 10:24 ` Ridley Combs
0 siblings, 0 replies; 4+ messages in thread
From: Ridley Combs @ 2023-05-09 10:24 UTC (permalink / raw)
To: ffmpeg-devel
> On May 9, 2023, at 12:16, Timo Rothenpieler <timo@rothenpieler.org> wrote:
>
> On 09/05/2023 12:11, rcombs wrote:
>> - cuDeviceGetUuid_v2, giving distinct IDs for different MIG instances
>> - cuDeviceGetLuid, giving a Win32 LUID to match with DXGI and other APIs
>> - cuDeviceGetByPCIBusId, retrieving a device that matches a PCI bus ID string
>> - cuDeviceGetPCIBusId, giving a PCI bus ID string for a device
>
> Looks good to me. What do you need those for?
> Interop with D3D1x/Vulkan?
I'm fetching device lists with DXGI (windows) or libdrm (linux); these functions seem to be the best way to correlate devices with those APIs. Probably also useful for D3D/Vk interop, though; particularly the v2 UUID function, as my guess is that the Vk interop code is probably broken in MIG mode right now.
Would appreciate seeing this backported to the 11.x branches; it applies cleanly.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH] Add functions to identify devices in more ways
2023-05-09 10:11 [FFmpeg-devel] [PATCH] Add functions to identify devices in more ways rcombs
2023-05-09 10:16 ` Timo Rothenpieler
@ 2023-05-09 10:56 ` Timo Rothenpieler
1 sibling, 0 replies; 4+ messages in thread
From: Timo Rothenpieler @ 2023-05-09 10:56 UTC (permalink / raw)
To: ffmpeg-devel
applied
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-05-09 10:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-09 10:11 [FFmpeg-devel] [PATCH] Add functions to identify devices in more ways rcombs
2023-05-09 10:16 ` Timo Rothenpieler
2023-05-09 10:24 ` Ridley Combs
2023-05-09 10:56 ` Timo Rothenpieler
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git