• Stars
    star
    462
  • Rank 91,192 (Top 2 %)
  • Language
    C
  • Created over 10 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The GL Vendor-Neutral Dispatch library

libglvnd: the GL Vendor-Neutral Dispatch library

Introduction

libglvnd is a vendor-neutral dispatch layer for arbitrating OpenGL API calls between multiple vendors. It allows multiple drivers from different vendors to coexist on the same filesystem, and determines which vendor to dispatch each API call to at runtime.

Both GLX and EGL are supported, in any combination with OpenGL and OpenGL ES.

libglvnd was originally described in Andy Ritger's OpenGL ABI proposal [1].

The official repository for libglvnd is hosted on FreeDesktop.org's GitLab: https://gitlab.freedesktop.org/glvnd/libglvnd

Building the library

libglvnd build-depends on libx11, glproto and libxext. On Debian and derivatives, run:

sudo apt-get install libxext-dev libx11-dev x11proto-gl-dev

Run ./autogen.sh, then run ./configure and make.

Alternatively you can use meson and ninja, which is much faster but should be otherwise the same (You will need packages from above too):

sudo apt-get install ninja-build meson
meson builddir 
ninja -C builddir

Meson 0.48.0 is currently required, if your distro doesn't have meson 0.48 in the repos you can try the methods suggested here.

Code overview

The code in the src/ directory is organized as follows:

  • GLX/ contains code for libGLX, the GLX window-system API library.
  • EGL/ contains code for libEGL, the EGL window-system API library.
  • GLdispatch/ contains code for libGLdispatch, which is responsible for dispatching OpenGL functions to the correct vendor library based on the current EGL or GLX rendering context. This implements the guts of the GL API libraries. Most of the dispatch code is based on Mesa's glapi.
  • OpenGL/, GLESv1/, and GLESv2/ contain code to generate libOpenGL.so, libGLESv1_CM.so, and libGLESv2.so, respectively. All three are merely wrapper libraries for libGLdispatch. Ideally, these could be implemented via ELF symbol filtering, but in practice they need to be implemented manually. See the Issues section for details on why this is the case.
  • GL/ contains code for libGL. This is a wrapper around libGLdispatch and libGLX.
  • util/ contains generic utility code.

In addition, libglvnd uses a GLX extension, GLX_EXT_libglvnd, to determine which vendor library to use for a screen or XID.

There are a few good starting points for familiarizing oneself with the code:

  • Look at the vendor-library to GLX ABI defined in libglxabi.h.
  • Follow the flow of glXGetProcAddress() -> __glDispatchGetProcAddress() -> _glapi_get_proc_address() to see how the dispatch table is updated as new GL stubs are generated, and how GLX looks for vendor-library-implemented dispatchers for GLX extension functions.
  • Follow the flow of glXMakeContextCurrent() -> __glDispatchMakeCurrent() -> _glapi_set_current() to see how the current dispatch table and state is updated by the API library.
  • Look at libglxmapping.c:__glXLookupVendorBy{Name,Screen}() to see how vendor library names are queried.
  • For EGL, follow the flow of eglGetPlatformDisplay() to see how EGL selects a vendor library.

The tests/ directory contains several unit tests which verify that dispatching to different vendors actually works. Run make check to run these unit tests.

Architecture

The library organization differs slightly from that of Andy's original proposal. See the diagram below:

                ┌──────────────────────────────────┐
                │                                  │
          ┌─────┤        Application               │
          │     │                                  │
          │     └─────┬───────────────────┬────────┘
          │           │                   │
          │     ┌─────▾─────┐             │                    ┌──────────────────────┐
          │     │           │             │                    │                      │
          │     │ libOpenGL │             │                    │                      │
          │     │           │             │                    │  X server            │
          │     └─────┬─────┘             │                    │                      │
          │        DT_FILTER              │                    │                      │
          │     ┌─────▾──────────┐ ┌──────▾────────┐           │ ┌──────────────────┐ │
          │     │                │ │               │           └─│GLX_EXT_libglvnd  │─┘
          │     │ [mapi/glapi]   ◂─▸               │             │extension         │
          │     │ libGLdispatch  │ │   libGLX      ├─────────────▸──────────────────┘
          │     │                │ │               ◂──────────┬─────────────────┐
          │     └───────▴────────┘ └──────▴────────┘          │                 │
          │         DT_FILTER         DT_FILTER             ┌─▾─────────┐   ┌───▾────────┐
          │     ┌───────┴─────────────────┴────────┐        │           │   │            │
          │     │                                  │        │           │   │            │
          └─────▸           libGL                  │        │ GLX_vendor│   │ GLX_vendor2│
                └──────────────────────────────────┘        │           │   │            │
                                                            └───────────┘   └────────────┘

In this diagram,

  • A ───▸ B indicates that module A calls into module B.
  • A ── DT_FILTER ──▸ B indicates that DSO A is (logically) a filter library on DSO B. If ELF symbol filtering is enabled, symbols exported by A are resolved to entrypoints in B.

libGLX manages loading GLX vendor libraries and dispatching GLX core and extension functions to the right vendor.

GLX_EXT_libglvnd is a simple GLX extension which allows libGLX to determine the number of the screen belonging to an arbitrary drawable XID, and also the GL vendor to use for a given screen.

libGLdispatch implements core GL dispatching and TLS. It acts as a thin wrapper around glapi which provides some higher-level functionality for managing dispatch tables, requesting vendor proc addresses, and making current to a given context + dispatch table. This is a separate library rather than statically linked into libGLX, since the same dispatching code is used by both GLX and EGL.

libOpenGL is a wrapper library to libGLdispatch which exposes OpenGL 4.5 core and compatibility entry points.

libGLESv{1,2} are wrapper libraries to libGLdispatch which expose OpenGL ES entrypoints.

libGL is a wrapper library to libGLdispatch and libGLX which is provided for backwards-compatibility with applications which link against the old ABI.

Note that since all OpenGL functions are dispatched through the same table in libGLdispatch, it doesn't matter which library is used to find the entrypoint. The same OpenGL function in libGL, libOpenGL, libGLES, and the function pointer returned by glXGetProcAddress are all interchangeable.

OpenGL dispatching

By definition, all OpenGL functions are dispatched based on the current context. OpenGL dispatching is handled in libGLdispatch, which is used by both EGL and GLX.

libGLdispatch uses a per-thread dispatch table to look up the correct vendor library function for every OpenGL function.

When an application calls eglMakeCurrent or glXMakeCurrent, the EGL or GLX library finds the correct dispatch table and then calls into libGLdispatch to set that table for the current thread.

Since they're all dispatched through the common libGLdispatch layer, that also means that all OpenGL entrypoints will work correctly, regardless of whether the current context is from EGL or GLX.

GLX dispatching

Unlike core OpenGL functions, whose vendor can be determined from the current context, many GLX functions are context-independent. In order to successfully map GLX API calls to the right vendor, we use the following strategy:

  • Most GLX entry points specify (either explicitly, or implicitly) an X screen.

  • On a per-entry point basis, dispatch the call to the libGLX_VENDOR.so for that screen.

  • The first time libGLX.so gets called with a unique combination of X Display + screen, do the following:

    • Use the Display connection to query the X server for the GLX vendor of that X screen.

    • Load the corresponding libGLX_VENDOR.so.

    • Read the vendor's GLX dispatch table from the libGLX_VENDOR.so.

    • Cache that Display + screen <=> vendor dispatch table mapping, for use in subsequent dispatching.

  • Some GLX entry points imply an X screen by a GLX object they specify. Such GLX objects are:

    • GLXContext (an opaque pointer)
    • GLXFBConfig (an opaque pointer)
    • GLXPixmap (an XID)
    • GLXDrawable (an XID)
    • GLXWindow (an XID)
    • GLXPbuffer (an XID)

    To map from object to screen, record the corresponding screen when the object is created. This means the current process needs to see a GLX call to create the object. In the case of the opaque pointers, this is reasonable, since the pointer is only meaningful within the current process.

    XIDs, however, can be created by another process, so libGLX may not know in advance which screen they belong to. To deal with that, libGLX queries the server using the GLX extension GLX_EXT_libglvnd.

EGL dispatching

EGL dispatching works similarly to GLX, but there are fewer object types to deal with. Almost all EGL functions are dispatched based on an EGLDisplay or EGLDeviceEXT parameter.

EGL can't rely on asking an X server for a vendor name like GLX can, so instead, it enumerates and loads every available vendor library. Loading every vendor is also needed to support extensions such as EGL_EXT_device_enumeration.

In order to find the available vendor libraries, each vendor provides a JSON file in a well-known directory, similar to how Vulkan ICD's are loaded. Please see EGL ICD enumeration for more details.

When the application calls eglGetPlatformDisplay, EGL will simply call into each vendor library until it finds one that succeeds. After that, whichever vendor succeeded owns that display.

As with GLX, vendor libraries must provide dispatch stubs for any display or device extensions that they support, so that they can add new extensions without having to modify libglvnd.

Since libglvnd passes eglGetPlatformDisplay calls through to each vendor, a vendor can also add a new platform extension (e.g., EGL_KHR_platform_x11) without changing libglvnd.

Other EGL client extensions, by definition, do require modifying libglvnd. Those are handled on a case-by-case basis.

Issues

  • Ideally, several components of libglvnd (namely, the libGL wrapper library and the libOpenGL, libGLES{v1_CM,v2} interface libraries) could be implemented via ELF symbol filtering (see [2] for a demonstration of this). However, a loader bug (tracked in [3]) makes this mechanism unreliable: dlopen(3)ing a shared library with DT_FILTER fields can crash the application. Instead, for now, ELF symbol filtering is disabled by default, and an alternate approach is used to implement these libraries.

  • The library currently indirectly associates a drawable with a vendor, by first mapping a drawable to its screen, then mapping the screen to its vendor. However, it may make sense in render offload scenarios to allow direct mapping from drawables to vendors, so multiple vendors could potentially operate on drawables in the same screen. The problem with this is that several GLX functions, such as glXChooseFBConfig(), explicitly refer to screens, and so it becomes a gray area which vendor the call should be dispatched to. Given this issue, does it still make more sense to use a direct drawable to vendor mapping? How would this be implemented? Should we add new API calls to "GLX Next"?

    • Note that the (drawable -> screen -> vendor) mapping mainly exists in the GLX_EXT_libglvnd extension. libGLX itself keeps a simple (drawable -> vendor) mapping, and exposes that mapping to the vendor libraries.
  • Along the same lines, would it be useful to include a "glXGetProcAddressFromVendor()" or "glXGetProcAddressFromScreen()" entrypoint in a new GLX version to obviate the need for this library in future applications?

  • Global state is required by both libGLX.so and libGLdispatch.so for various purposes, and needs to be protected by locks in multithreaded environments. Is it reasonable for the vendor-neutral library to depend on pthreads for implementing these locks?

    While there is no harm in having the API libraries link against pthreads even if the application does not, we would like to avoid pthread locking overhead if the application is single-threaded. Hence, this library uses a glvnd_pthread wrapper library which provides single-threaded fallbacks for applications which are not linked against pthreads. It is expected that multi-threaded applications will either statically link against pthreads, or load pthreads prior to loading libGL.

  • Is using a hash table to store GLX extension entrypoints performant enough for dispatching? Should we be using a flat array instead?

  • How should malloc(3) failures be handled?

  • How should forking be handled?

  • The current libGLX implementation stores all GLXContext and GLXFBConfig handles in global hashtables, which means that GLXContext and GLXFBConfig handles must be unique between vendors. That is, two vendor libraries must not come up with the same handle value for a GLXContext or GLXFBConfig. To that end, GLXContext and GLXFBConfig handles must be pointers to memory addresses that the vendor library somehow controls. The values are otherwise opaque.

  • Querying an XID <=> screen mapping without somehow "locking" the XID is inherently racy, since a different process may destroy the drawable, and X may recycle the XID, after the mapping is saved client-side. Is there a mechanism we could use to notify the API library when a mapping is no longer valid?

References

[1] https://github.com/aritger/linux-opengl-abi-proposal/blob/master/linux-opengl-abi-proposal.txt

[2] https://github.com/aritger/libgl-elf-tricks-demo

[3] https://sourceware.org/bugzilla/show_bug.cgi?id=16272

Acknowledgements

Thanks to Andy Ritger for the original libGLX implementation and README documentation.

libglvnd

libglvnd itself (excluding components listed below) is licensed as follows:

Copyright (c) 2013, NVIDIA CORPORATION.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
unaltered in all copies or substantial portions of the Materials.
Any additions, deletions, or changes to the original source files
must be clearly indicated in accompanying documentation.

THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.

X.Org

libglvnd contains list.h, a linked list implementation from the X.Org project. Source code from the X.Org project is available from:

http://cgit.freedesktop.org/xorg/xserver

list.h carries the following license:

Copyright © 2010 Intel Corporation
Copyright © 2010 Francisco Jerez <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice (including the next
paragraph) shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.

Mesa

libglvnd contains code from the Mesa project. Source code from the Mesa project is available from:

http://cgit.freedesktop.org/mesa/mesa

The default Mesa license is as follows:

Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

uthash

libglvnd uses the hash table implementation 'uthash':

http://troydhanson.github.io/uthash/

This library carries the following copyright notice:

Copyright (c) 2005-2013, Troy D. Hanson
http://troydhanson.github.com/uthash/
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

buildconf

libglvnd uses the buildconf autotools bootstrapping script 'autogen.sh':

http://freecode.com/projects/buildconf

This script carries the following copyright notice:

Copyright (c) 2005-2009 United States Government as represented by
the U.S. Army Research Laboratory.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.

3. The name of the author may not be used to endorse or promote
products derived from this software without specific prior written
permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

ax-pthread

libglvnd uses the AX_PTHREAD autoconf macro for detecting pthreads. The implementation of this macro carries the following license:

Copyright (c) 2008 Steven G. Johnson <[email protected]>
Copyright (c) 2011 Daniel Richard G. <[email protected]>

This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the 
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.

This program is distributed in the hope that it will be useful, but 
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.

You should have received a copy of the GNU General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.

As a special exception, the respective Autoconf Macro's copyright owner
gives unlimited permission to copy, distribute and modify the configure
scripts that are the output of Autoconf when processing the Macro. You 
need not follow the terms of the GNU General Public License when using
or distributing such scripts, even though portions of the text of the 
Macro appear in them. The GNU General Public License (GPL) does govern
all other use of the material that constitutes the Autoconf Macro.

This special exception to the GPL applies to versions of the Autoconf
Macro released by the Autoconf Archive. When you make and distribute a
modified version of the Autoconf Macro, you may extend this special
exception to the GPL to apply to your modified version as well.

libglvnd uses the cJSON library for reading JSON files:

https://github.com/DaveGamble/cJSON

This library carries the following copyright notice:

Copyright (c) 2009 Dave Gamble

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

More Repositories

1

nvidia-docker

Build and run Docker containers leveraging NVIDIA GPUs
16,896
star
2

open-gpu-kernel-modules

NVIDIA Linux open GPU kernel module source
C
13,784
star
3

DeepLearningExamples

State-of-the-Art Deep Learning scripts organized by models - easy to train and deploy with reproducible accuracy and performance on enterprise-grade infrastructure.
Jupyter Notebook
12,579
star
4

FastPhotoStyle

Style transfer, deep learning, feature transform
Python
11,020
star
5

NeMo

A scalable generative AI framework built for researchers and developers working on Large Language Models, Multimodal, and Speech AI (Automatic Speech Recognition and Text-to-Speech)
Python
10,077
star
6

TensorRT

NVIDIA® TensorRT™ is an SDK for high-performance deep learning inference on NVIDIA GPUs. This repository contains the open source components of TensorRT.
C++
9,059
star
7

vid2vid

Pytorch implementation of our method for high-resolution (e.g. 2048x1024) photorealistic video-to-video translation.
Python
8,482
star
8

Megatron-LM

Ongoing research training transformer models at scale
Python
8,169
star
9

apex

A PyTorch Extension: Tools for easy mixed precision and distributed training in Pytorch
Python
7,915
star
10

pix2pixHD

Synthesizing and manipulating 2048x1024 images with conditional GANs
Python
6,488
star
11

TensorRT-LLM

TensorRT-LLM provides users with an easy-to-use Python API to define Large Language Models (LLMs) and build TensorRT engines that contain state-of-the-art optimizations to perform inference efficiently on NVIDIA GPUs. TensorRT-LLM also contains components to create Python and C++ runtimes that execute those TensorRT engines.
C++
6,429
star
12

FasterTransformer

Transformer related optimization, including BERT, GPT
C++
5,313
star
13

cuda-samples

Samples for CUDA Developers which demonstrates features in CUDA Toolkit
C
5,203
star
14

thrust

[ARCHIVED] The C++ parallel algorithms library. See https://github.com/NVIDIA/cccl
C++
4,845
star
15

DALI

A GPU-accelerated library containing highly optimized building blocks and an execution engine for data processing to accelerate deep learning training and inference applications.
C++
4,839
star
16

tacotron2

Tacotron 2 - PyTorch implementation with faster-than-realtime inference
Jupyter Notebook
4,562
star
17

cutlass

CUDA Templates for Linear Algebra Subroutines
C++
4,278
star
18

DIGITS

Deep Learning GPU Training System
HTML
4,105
star
19

NeMo-Guardrails

NeMo Guardrails is an open-source toolkit for easily adding programmable guardrails to LLM-based conversational systems.
Python
3,309
star
20

flownet2-pytorch

Pytorch implementation of FlowNet 2.0: Evolution of Optical Flow Estimation with Deep Networks
Python
2,938
star
21

nccl

Optimized primitives for collective multi-GPU communication
C++
2,786
star
22

libcudacxx

[ARCHIVED] The C++ Standard Library for your entire system. See https://github.com/NVIDIA/cccl
C++
2,286
star
23

k8s-device-plugin

NVIDIA device plugin for Kubernetes
Go
2,269
star
24

waveglow

A Flow-based Generative Network for Speech Synthesis
Python
2,133
star
25

trt-llm-rag-windows

A developer reference project for creating Retrieval Augmented Generation (RAG) chatbots on Windows using TensorRT-LLM
Python
2,011
star
26

MinkowskiEngine

Minkowski Engine is an auto-diff neural network library for high-dimensional sparse tensors
Python
2,007
star
27

semantic-segmentation

Nvidia Semantic Segmentation monorepo
Python
1,746
star
28

DeepRecommender

Deep learning for recommender systems
Python
1,662
star
29

Stable-Diffusion-WebUI-TensorRT

TensorRT Extension for Stable Diffusion Web UI
Python
1,660
star
30

cub

[ARCHIVED] Cooperative primitives for CUDA C++. See https://github.com/NVIDIA/cccl
Cuda
1,645
star
31

warp

A Python framework for high performance GPU simulation and graphics
Python
1,573
star
32

OpenSeq2Seq

Toolkit for efficient experimentation with Speech Recognition, Text2Speech and NLP
Python
1,511
star
33

GenerativeAIExamples

Generative AI reference workflows optimized for accelerated infrastructure and microservice architecture.
Python
1,450
star
34

TransformerEngine

A library for accelerating Transformer models on NVIDIA GPUs, including using 8-bit floating point (FP8) precision on Hopper and Ada GPUs, to provide better performance with lower memory utilization in both training and inference.
Python
1,400
star
35

VideoProcessingFramework

Set of Python bindings to C++ libraries which provides full HW acceleration for video decoding, encoding and GPU-accelerated color space and pixel format conversions
C++
1,253
star
36

nvidia-container-toolkit

Build and run containers leveraging NVIDIA GPUs
Go
1,239
star
37

trt-samples-for-hackathon-cn

Simple samples for TensorRT programming
Python
1,211
star
38

Q2RTX

NVIDIA’s implementation of RTX ray-tracing in Quake II
C
1,201
star
39

open-gpu-doc

Documentation of NVIDIA chip/hardware interfaces
C
1,193
star
40

stdexec

`std::execution`, the proposed C++ framework for asynchronous and parallel programming.
C++
1,182
star
41

deepops

Tools for building GPU clusters
Shell
1,165
star
42

partialconv

A New Padding Scheme: Partial Convolution based Padding
Python
1,145
star
43

CUDALibrarySamples

CUDA Library Samples
Cuda
1,122
star
44

gpu-operator

NVIDIA GPU Operator creates/configures/manages GPUs atop Kubernetes
Go
1,117
star
45

MatX

An efficient C++17 GPU numerical computing library with Python-like syntax
C++
1,104
star
46

aistore

AIStore: scalable storage for AI applications
Go
1,074
star
47

sentiment-discovery

Unsupervised Language Modeling at scale for robust sentiment classification
Python
1,055
star
48

nvidia-container-runtime

NVIDIA container runtime
Makefile
1,035
star
49

gpu-monitoring-tools

Tools for monitoring NVIDIA GPUs on Linux
C
974
star
50

retinanet-examples

Fast and accurate object detection with end-to-end GPU optimization
Python
876
star
51

flowtron

Flowtron is an auto-regressive flow-based generative network for text to speech synthesis with control over speech variation and style transfer
Jupyter Notebook
867
star
52

mellotron

Mellotron: a multispeaker voice synthesis model based on Tacotron 2 GST that can make a voice emote and sing without emotive or singing training data
Jupyter Notebook
842
star
53

jetson-gpio

A Python library that enables the use of Jetson's GPIOs
Python
834
star
54

gdrcopy

A fast GPU memory copy library based on NVIDIA GPUDirect RDMA technology
C++
766
star
55

nv-wavenet

Reference implementation of real-time autoregressive wavenet inference
Cuda
728
star
56

libnvidia-container

NVIDIA container runtime library
C
722
star
57

tensorflow

An Open Source Machine Learning Framework for Everyone
C++
719
star
58

spark-rapids

Spark RAPIDS plugin - accelerate Apache Spark with GPUs
Scala
717
star
59

cuda-python

CUDA Python Low-level Bindings
Python
695
star
60

cccl

CUDA C++ Core Libraries
C++
676
star
61

MAXINE-AR-SDK

NVIDIA AR SDK - API headers and sample applications
C
671
star
62

nvvl

A library that uses hardware acceleration to load sequences of video frames to facilitate machine learning training
C++
665
star
63

nccl-tests

NCCL Tests
Cuda
648
star
64

gvdb-voxels

Sparse volume compute and rendering on NVIDIA GPUs
C
643
star
65

modulus

Open-source deep-learning framework for building, training, and fine-tuning deep learning models using state-of-the-art Physics-ML methods
Python
636
star
66

BigVGAN

Official PyTorch implementation of BigVGAN (ICLR 2023)
Python
633
star
67

runx

Deep Learning Experiment Management
Python
630
star
68

DLSS

NVIDIA DLSS is a new and improved deep learning neural network that boosts frame rates and generates beautiful, sharp images for your games
C
588
star
69

dcgm-exporter

NVIDIA GPU metrics exporter for Prometheus leveraging DCGM
Go
551
star
70

Dataset_Synthesizer

NVIDIA Deep learning Dataset Synthesizer (NDDS)
C++
530
star
71

NVFlare

NVIDIA Federated Learning Application Runtime Environment
Python
528
star
72

nvcomp

Repository for nvCOMP docs and examples. nvCOMP is a library for fast lossless compression/decompression on the GPU that can be downloaded from https://developer.nvidia.com/nvcomp.
C++
510
star
73

jitify

A single-header C++ library for simplifying the use of CUDA Runtime Compilation (NVRTC).
C++
495
star
74

enroot

A simple yet powerful tool to turn traditional container/OS images into unprivileged sandboxes.
Shell
459
star
75

multi-gpu-programming-models

Examples demonstrating available options to program multiple GPUs in a single node or a cluster
Cuda
438
star
76

MDL-SDK

NVIDIA Material Definition Language SDK
C++
438
star
77

PyProf

A GPU performance profiling tool for PyTorch models
Python
437
star
78

AMGX

Distributed multigrid linear solver library on GPU
Cuda
434
star
79

gpu-rest-engine

A REST API for Caffe using Docker and Go
C++
421
star
80

nvbench

CUDA Kernel Benchmarking Library
Cuda
413
star
81

framework-reproducibility

Providing reproducibility in deep learning frameworks
Python
412
star
82

cuCollections

C++
410
star
83

hpc-container-maker

HPC Container Maker
Python
404
star
84

NeMo-Framework-Launcher

NeMo Megatron launcher and tools
Python
391
star
85

NvPipe

NVIDIA-accelerated zero latency video compression library for interactive remoting applications
Cuda
384
star
86

cuda-quantum

C++ and Python support for the CUDA Quantum programming model for heterogeneous quantum-classical workflows
C++
363
star
87

data-science-stack

NVIDIA Data Science stack tools
Shell
317
star
88

cuQuantum

Home for cuQuantum Python & NVIDIA cuQuantum SDK C++ samples
Jupyter Notebook
305
star
89

ai-assisted-annotation-client

Client side integration example source code and libraries for AI-Assisted Annotation SDK
C++
302
star
90

video-sdk-samples

Samples demonstrating how to use various APIs of NVIDIA Video Codec SDK
C++
301
star
91

nvidia-settings

NVIDIA driver control panel
C
284
star
92

DCGM

NVIDIA Data Center GPU Manager (DCGM) is a project for gathering telemetry and measuring the health of NVIDIA GPUs
C++
282
star
93

cnmem

A simple memory manager for CUDA designed to help Deep Learning frameworks manage memory
C++
280
star
94

radtts

Provides training, inference and voice conversion recipes for RADTTS and RADTTS++: Flow-based TTS models with Robust Alignment Learning, Diverse Synthesis, and Generative Modeling and Fine-Grained Control over of Low Dimensional (F0 and Energy) Speech Attributes.
Roff
269
star
95

fsi-samples

A collection of open-source GPU accelerated Python tools and examples for quantitative analyst tasks and leverages RAPIDS AI project, Numba, cuDF, and Dask.
Jupyter Notebook
265
star
96

tensorrt-laboratory

Explore the Capabilities of the TensorRT Platform
C++
259
star
97

CleanUNet

Official PyTorch Implementation of CleanUNet (ICASSP 2022)
Python
258
star
98

gpu-feature-discovery

GPU plugin to the node feature discovery for Kubernetes
Go
255
star
99

torch-harmonics

Differentiable spherical harmonic transforms and spherical convolutions in PyTorch
Jupyter Notebook
246
star
100

egl-wayland

The EGLStream-based Wayland external platform
C
243
star