Ejemplo n.º 1
0
        /// <summary>
        ///     [PRIVATE]
        ///     Gets the current frame buffer width and location for the passed logical GPU handle.
        /// </summary>
        /// <param name="gpuHandle">The handle of the logical GPU to perform the operation on.</param>
        /// <param name="width">The frame buffer width.</param>
        /// <param name="location">The frame buffer location.</param>
        public static void GetLogicalFrameBufferWidthAndLocation(
            LogicalGPUHandle gpuHandle,
            out uint width,
            out uint location)
        {
            var status =
                DelegateFactory.GetDelegate <Delegates.GPU.NvAPI_GPU_GetLogicalFBWidthAndLocation>()(gpuHandle,
                                                                                                     out width, out location);

            if (status != Status.Ok)
            {
                throw new NVIDIAApiException(status);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     This function returns the physical GPU handles associated with the specified logical GPU handle.
        ///     At least one GPU must be present in the system and running an NVIDIA display driver.
        /// </summary>
        /// <param name="gpuHandle">Logical GPU handle to get information about</param>
        /// <returns>An array of physical GPU handles</returns>
        /// <exception cref="NVIDIAApiException">Status.InvalidArgument: gpuHandle is not valid</exception>
        /// <exception cref="NVIDIAApiException">Status.NvidiaDeviceNotFound: No NVIDIA GPU driving a display was found</exception>
        /// <exception cref="NVIDIAApiException">Status.ExpectedLogicalGPUHandle: gpuHandle was not a logical GPU handle</exception>
        public static PhysicalGPUHandle[] GetPhysicalGPUsFromLogicalGPU(LogicalGPUHandle gpuHandle)
        {
            var gpuList =
                typeof(PhysicalGPUHandle).Instantiate <PhysicalGPUHandle>().Repeat(PhysicalGPUHandle.MaxPhysicalGPUs);
            var status = DelegateFactory.GetDelegate <Delegates.GPU.NvAPI_GetPhysicalGPUsFromLogicalGPU>()(gpuHandle,
                                                                                                           gpuList,
                                                                                                           out var count);

            if (status != Status.Ok)
            {
                throw new NVIDIAApiException(status);
            }

            return(gpuList.Take((int)count).ToArray());
        }
Ejemplo n.º 3
0
 /// <summary>
 ///     Creates a new LogicalGPU
 /// </summary>
 /// <param name="handle">Logical GPU handle</param>
 public LogicalGPU(LogicalGPUHandle handle)
 {
     Handle = handle;
 }