From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 785CD461EB for ; Tue, 9 May 2023 10:11:42 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5DA5768C130; Tue, 9 May 2023 13:11:40 +0300 (EEST) Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 25F6068C0FA for ; Tue, 9 May 2023 13:11:34 +0300 (EEST) Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-9661a1ff1e9so485774266b.1 for ; Tue, 09 May 2023 03:11:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rcombs.me; s=google; t=1683627093; x=1686219093; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=v8su6UlU5wtpgk9M0e+DPzVqKs5SvUjM0yr9T8E4NO0=; b=eT1wq8DVGYYssowisQ7Il+s0VnaSWxtulDlTVlleffpdv8E7aEPRoiF/w7ewvXzLYG QWnoe9E1jBQC07s3KHYqtnNo0Wm0LRaGnaBfwyIyKPW+sPJhUvKlyg+owLakmeLt0oqY QA2QCP3j57aUqxSwe+W3ZXxGgG+pAuDgi7p7BUVktMRK4oaB4a/cD+WMIFwYxCqJlQ0y JSPtUr58cOff6XCpgsprtyLi+4Az2M1rJXX8woJFDcqVJqxmHqx8I8/IbaP0LYVkNX09 q0/0TMlNDW9satXy9XXslPRiinPEx9oM/e5la/Az4n4OcLbalj8n/rMLHZDMELLukvD7 esnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683627093; x=1686219093; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=v8su6UlU5wtpgk9M0e+DPzVqKs5SvUjM0yr9T8E4NO0=; b=Hney53VxzDCwPFFW+pOChwa30KD7Hh5/5n7mtPSSCFv2Pi5PQhkHyVu642AvHm1xkz sWybKU4uI4M7wfViXFUppcGtUh4Cj8X6m6tZhMtdQzh59XDKmxx9Unuv/wBCNJiUtrLt GCu3xyxT+sxgkZORDUX5G7cl9kqmbKh8rFBTeL/ZRuPOV+nXvMEkKXdHz+gvwyD2mYdv Itm6RU3X/AucyBIzDiinDd/uG6FpN2CwXalF2dlmtNelB/04R28clGirByG7eZ2VBkE1 nR+VEAJTfc09hJOwTv/HWTJagkUy6a4pSE01DYUDQ2XIn27UfeW+J8l5g0VeVXBT2P1N U0gA== X-Gm-Message-State: AC+VfDzzcM4uYUiT/BOeZG52YtOokuY8Cozpgr+gUF43K7DK+Ji5rR1g LvsJKrckDUNKaPykJ2qwsjU/e1Pujq7VxzJ1cfIYv4E= X-Google-Smtp-Source: ACHHUZ4MrTSM/Xz2OQ9i6FR5gBxqWLSgV20/roxrmuHvXuzweziMbzlMV2X7vUcrjyuvIYfnuouBhA== X-Received: by 2002:a17:907:961c:b0:94e:98da:ef97 with SMTP id gb28-20020a170907961c00b0094e98daef97mr13724785ejc.27.1683627093142; Tue, 09 May 2023 03:11:33 -0700 (PDT) Received: from localhost.localdomain ([213.61.193.178]) by smtp.gmail.com with ESMTPSA id p1-20020a170906838100b009662b4230cesm1150158ejx.148.2023.05.09.03.11.32 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 09 May 2023 03:11:32 -0700 (PDT) From: rcombs To: ffmpeg-devel@ffmpeg.org Date: Tue, 9 May 2023 12:11:20 +0200 Message-Id: <20230509101120.61759-1-rcombs@rcombs.me> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] Add functions to identify devices in more ways X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: - 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".