Giter VIP home page Giter VIP logo

gpudetect's Introduction

GPU Detect

Overview

This short sample demonstrates a way to detect the primary graphics hardware present in a system, and to initialize a game's default fidelity presets based on the found graphics device. The code and accompanying data is meant to be used as a guideline, and should be adapted to the game's specific needs. The sample is specific to Microsoft Windows although some of the information will be applicable on other operating systems.

The API can be used to obtain a default quality setting for the device from the data provided in the vendor specific configuration files. Additionally, the Vendor ID and Device ID of the primary graphics device can be queried. The API works by using the DXGI interface. If the Vendor ID is recognized, the code then looks for a configuration file specific to that vendor. In the example, the configuration file is used to list the expected performance levels (Low / Medium / High) of all relevant devices from that vendor. If the device is not recognized the API returns the lowest quality level as a safe fall-back.

This sample is intended for customers developing graphical applications who wish to target Intel(tm) graphics devices.

File List

  • DeviceId.h -> Header file for device ID code.
  • DeviceId.cpp -> Implementation of functions to convert the device ID into more useful information.
  • GPUDetect.h -> Header file for GPU detection code.
  • GPUDetect.cpp -> Implementation of functions to obtain information about graphics devices.
  • IntelGfx.cfg -> Sample configuration file with list of known Intel GPU devices, their device IDs, and example expected graphics performance levels with regards to the calling game / application.
  • TestMain.cpp -> Simple console based test utility that calls the above functions, and displays the result.

Configuration File

The configuration file is an example of what could be done using information from GPU Detect. It has one line each for a known GPU device. The Vendor ID is repeated for clarity here. In this example file, each graphics device has been categorized as Low, Medium, or High based on the applications tested performance on each of these parts.

;
; Intel Graphics Preset Levels
;
; Format: 
; VendorIDHex, DeviceIDHex, Out of the Box Settings ; Commented name of cards
;
0x8086, 0x1612, Medium; Intel(R) HD Graphics 5600
0x8086, 0x1616, Medium; Intel(R) HD Graphics 5500
0x8086, 0x161E, Low; Intel(R) HD Graphics 5300
0x8086, 0x1622, High; Intel(R) Iris Pro Graphics 6200

Building

This project requires the latest Windows SDK.

Links

gpudetect's People

Contributors

scottlafetra avatar alstonani avatar jeffersonmontgomery-intel avatar seppukuhc avatar qfroemke avatar codergirl42 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.