[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-6290":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":9,"rankLanguage":9,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":9,"pushedAt":9,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":15,"starSnapshotCount":15,"syncStatus":33,"lastSyncTime":34,"discoverSource":35},6290,"cuda-samples","NVIDIA\u002Fcuda-samples","NVIDIA","Samples for CUDA Developers which demonstrates features in CUDA Toolkit",null,"C++",9279,2358,126,75,0,15,43,129,45,41,"Other",false,"master",true,[26,27,28,29],"cuda","cuda-driver-api","cuda-kernels","cuda-opengl","2026-06-12 02:01:17","# CUDA Samples\n\nSamples for CUDA Developers which demonstrates features in CUDA Toolkit. This version supports [CUDA Toolkit 13.2](https:\u002F\u002Fdeveloper.nvidia.com\u002Fcuda-downloads).\n\n## Release Notes\n\nThis section describes the release notes for the CUDA Samples on GitHub only.\n\n### Change Log\n\n### [Revision History](.\u002FCHANGELOG.md)\n\n## Getting Started\n\n### Prerequisites\n\nDownload and install the [CUDA Toolkit](https:\u002F\u002Fdeveloper.nvidia.com\u002Fcuda-downloads) for your corresponding platform.\nFor system requirements and installation instructions of cuda toolkit, please refer to the [Linux Installation Guide](http:\u002F\u002Fdocs.nvidia.com\u002Fcuda\u002Fcuda-installation-guide-linux\u002F), and the [Windows Installation Guide](http:\u002F\u002Fdocs.nvidia.com\u002Fcuda\u002Fcuda-installation-guide-microsoft-windows\u002Findex.html).\n\n### Getting the CUDA Samples\n\nUsing git clone the repository of CUDA Samples using the command below.\n```\ngit clone https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fcuda-samples.git\n```\n\nWithout using git the easiest way to use these samples is to download the zip file containing the current version by clicking the \"Download ZIP\" button on the repo page. You can then unzip the entire archive and use the samples.\n\n## Building CUDA Samples\n\n### Building CUDA Samples\n\nThe CUDA Samples are built using CMake. Follow the instructions below for building on Linux, Windows, and for cross-compilation to Tegra devices.\n\n### Linux\n\nEnsure that CMake (version 3.20 or later) is installed. Install it using your package manager if necessary:\n\ne.g.\n```sudo apt install cmake```\n\nNavigate to the root of the cloned repository and create a build directory:\n```\nmkdir build && cd build\n```\nConfigure the project with CMake:\n```\ncmake ..\n```\nBuild the samples:\n```\nmake -j$(nproc)\n```\nRun the samples from their respective directories in the build folder. You can also follow this process from and subdirectory of the samples repo, or from within any individual sample.\n\n### Windows\n\nLanguage services for CMake are available in Visual Studio 2019 version 16.5 or later, and you can directly import the CUDA samples repository from either the root level or from any\nsubdirectory or individual sample.\n\nTo build from the command line, open the `x64 Native Tools Command Prompt for VS` provided with your Visual Studio installation.\n\nNavigate to the root of the cloned repository and create a build directory:\n```\nmkdir build && cd build\n```\nConfigure the project with CMake - for example:\n```\ncmake .. -G \"Visual Studio 16 2019\" -A x64\n```\nOpen the generated solution file CUDA_Samples.sln in Visual Studio. Build the samples by selecting the desired configuration (e.g., Debug or Release) and pressing F7 (Build Solution).\n\nRun the samples from the output directories specified in Visual Studio.\n\n### Enabling On-GPU Debugging\n\nNVIDIA GPUs support on-GPU debugging through cuda-gdb. Enabling this may significantly affect application performance as certain compiler optimizations are disabled\nin this configuration, hence it's not on by default. Enablement of on-device debugging is controlled via the `-G` switch to nvcc.\n\nTo enable cuda-gdb for samples builds, define the `ENABLE_CUDA_DEBUG` flag on the CMake command line. For example:\n\n```\ncmake -DENABLE_CUDA_DEBUG=True ...\n```\n\n### Platform-Specific Samples\n\nSome CUDA samples are specific to certain platforms, and require passing flags into CMake to enable. In particular, we define the following platform-specific flags:\n\n* `BUILD_TEGRA` - for Tegra-specific samples\n\nTo build these samples, set the variables either on the command line or through your CMake GUI. For example:\n\n```\ncmake -DBUILD_TEGRA=True ..\n```\n\n### Cross-Compilation for Tegra Platforms\n\nInstall the NVIDIA toolchain and cross-compilation environment for Tegra devices as described in the Tegra Development Guide.\n\nEnsure that CMake (version 3.20 or later) is installed.\n\nNavigate to the root of the cloned repository and create a build directory:\n```\nmkdir build && cd build\n```\nConfigure the project with CMake, specifying the Tegra toolchain file. And you can use -DTARGET_FS to point to the target file system root path for necessary include and library files:\n```\ncmake .. -DCMAKE_TOOLCHAIN_FILE=..\u002Fcmake\u002Ftoolchains\u002Ftoolchain-aarch64-linux.cmake -DTARGET_FS=\u002Fpath\u002Fto\u002Ftarget\u002Fsystem\u002Ffile\u002Fsystem\n```\nBuild the samples:\n```\nmake -j$(nproc)\n```\nTransfer the built binaries to the Tegra device and execute them there.\n\n\n### Cross Building for Automotive Linux Platforms from the DriveOS Docker containers\n\nTo build CUDA samples to the target platform from the DriveOS Docker containers, use the following instructions.\n\nMount the target Root Filesystem (RFS) in the container so that the CUDA cmake process has the correct paths to CUDA and other system libraries required to build the samples.\n\nCreate a temporary directory, `\u003Ctemp>` is any temporary directory of your choosing, for example, you can use `\u002Fdrive\u002Ftemp`:\n\n```\n$ mkdir \u002Fdrive\u002F\u003Ctemp>\n```\n\nMount the filesystem by running the following command:\n\n```\n$ mount \u002Fdrive\u002Fdrive-linux\u002Ffilesystem\u002Ftargetfs-images\u002Fdev_nsr_desktop_ubuntu-24.04_thor_rfs.img \u002Fdrive\u002Ftemp\n```\n\nConfigure the project by running the following cmake command:\n\n```\n$ mkdir build && cd build\n$ cmake .. -DBUILD_TEGRA=True \\\n  -DCMAKE_CUDA_COMPILER=\u002Fusr\u002Flocal\u002Fcuda\u002Fbin\u002Fnvcc \\\n  -DCMAKE_TOOLCHAIN_FILE=..\u002Fcmake\u002Ftoolchains\u002Ftoolchain-aarch64-linux.cmake \\\n  -DTARGET_FS=\u002Fdrive\u002Ftemp \\\n  -DCMAKE_LIBRARY_PATH=\u002Fdrive\u002Ftemp\u002Fusr\u002Flocal\u002Fcuda-13.1\u002Fthor\u002Flib64\u002F \\\n  -DCMAKE_INCLUDE_PATH=\u002Fdrive\u002Ftemp\u002Fusr\u002Flocal\u002Fcuda-13.1\u002Fthor\u002Finclude\u002F\n```\n\nPlease note that the following libraries are not pre-installed in the DriveOS dev-nsr target filesystem:\n* libdrm-dev\n* Vulkan\n\nThis causes the cmake command to throw errors related to the missing files, and as a result, the related samples will not build in later steps. This issue will be addressed in a future DriveOS release.\n\nTo build the samples with ignore the error mentioned above, you can use `--ignore-errors`\u002F`--keep-going` or comment out the comment out the corresponding `add_subdirectory` command in the CMakeLists.txt in the parent folder for the samples requiring Vulkan and libdrm_dev:\n\n```\n$ make -j$(nproc) --ignore-errors # or --keep-going\n```\n\n```\n# In Samples\u002F5_Domain_Specific\u002FCMakeList.txt\n# add_subdirectory(simpleGL)\n# add_subdirectory(simpleVulkan)\n# add_subdirectory(simpleVulkanMMAP)\n\n# In Samples\u002F8_Platform_Specific\u002FTegra\u002FCMakeList.txt\n# add_subdirectory(simpleGLES_EGLOutput)\n```\n\n### QNX\n\nCross-compilation for QNX with CMake is supported in the CUDA 13.0 samples release and newer. An example build for\nthe Tegra Thor QNX platform might look like this:\n\n```\n$ mkdir build\n$ cd build\n\nQNX_HOST=\u002Fpath\u002Fto\u002Fqnx\u002Fhost \\\nQNX_TARGET=\u002Fpath\u002Fto\u002Fqnx\u002Ftarget \\\ncmake .. \\\n-DBUILD_TEGRA=True \\\n-DCMAKE_CUDA_COMPILER=\u002Fusr\u002Flocal\u002Fcuda-safe-13.0\u002Fbin\u002Fnvcc \\\n-DCMAKE_TOOLCHAIN_FILE=..\u002Fcmake\u002Ftoolchains\u002Ftoolchain-aarch64-qnx.cmake \\\n-DCMAKE_LIBRARY_PATH=\u002Fusr\u002Flocal\u002Fcuda-safe-13.0\u002Fthor\u002Ftargets\u002Faarch64-qnx\u002Flib\u002Fstubs\u002F \\\n-DCMAKE_INCLUDE_PATH=\u002Fusr\u002Flocal\u002Fcuda-safe-13.0\u002Fthor\u002Ftargets\u002Faarch64-qnx\u002Finclude\u002F\n```\n\n### Forward Compatibility\n\nTo build samples with new CUDA Toolkit(CUDA 13.0 or later) and UMD(Version 580 or later) and old KMD(Version 550 or earlier)，you need to set the `CMAKE_PREFIX_PATH` for using new driver library, the command might like this:\n\n```\ncmake -DCMAKE_PREFIX_PATH=\u002Fusr\u002Flocal\u002Fcuda\u002Flib64\u002Fstubs\u002F ..\n```\n\n## Install Samples\n\n### Installation Path Structure\n\nThe installation system automatically organizes samples into a structured directory layout based on:\n- **Target Architecture**: ${CMAKE_SYSTEM_PROCESSOR}, e.g. `x64`, `aarch64`, `amd64`, etc.\n- **Target OS**: `linux`, `windows`, `darwin`, `qnx`\n- **Build Type**: `release`, `debug`, etc.\n\nThe default installation path is: `build\u002Fbin\u002F${TARGET_ARCH}\u002F${TARGET_OS}\u002F${BUILD_TYPE}`\n\n**Examples:**\n- Linux x86_64 Release: `build\u002Fbin\u002Fx64\u002Flinux\u002Frelease`\n- Linux aarch64 Release: `build\u002Fbin\u002Faarch64\u002Flinux\u002Frelease`\n- Windows amd64 Release: `build\u002Fbin\u002Famd64\u002Fwindows\u002Frelease`\n\n### Customizing Installation Paths\n\nYou can customize the installation location using CMake variables during the configuration step:\n\n- `CMAKE_INSTALL_PREFIX`: Changes the root installation directory (default: `build\u002Fbin`)\n  ```\n  cmake -DCMAKE_INSTALL_PREFIX=\u002Fcustom\u002Fpath ..\n  ```\n  This will install to: `\u002Fcustom\u002Fpath\u002F${TARGET_ARCH}\u002F${TARGET_OS}\u002F${BUILD_TYPE}`\n\n- `CUDA_SAMPLES_INSTALL_DIR`: Specifies the exact final installation directory (overrides the structured path)\n  ```\n  cmake -DCUDA_SAMPLES_INSTALL_DIR=\u002Fexact\u002Finstall\u002Fpath ..\n  ```\n\n### Install Samples on Linux\n\n**Prerequisites:** You must first configure the project with CMake as described in the [Building CUDA Samples - Linux](#linux) or [Building]section.\n\nAfter configuring and building, install the samples:\n\n```\ncd build\u002F\nmake install\n```\n\n### Install Samples on Windows\n\n**Prerequisites:** You must first configure the project with CMake as described in the [Building CUDA Samples - Windows](#windows) section.\n\n#### Using Command Line\n\nAfter configuring with CMake, build and install from the `x64 Native Tools Command Prompt for VS`:\n\n```cmd\ncd build\ncmake --build . --config Release\ncmake --install . --config Release\n```\n\n**Note:** Replace `Release` with `Debug` if you want to install debug builds. For multi-configuration generators (like Visual Studio), the `--config` flag determines which build type to install.\n\n#### Using Visual Studio IDE\n\nAlternatively, open the generated solution file `CUDA_Samples.sln` in Visual Studio:\n1. Select the desired configuration (`Release` or `Debug`)\n2. Build the solution (F7 or Build > Build Solution)\n3. Right-click on the `INSTALL` target under `CMakePredefinedTargets` in Solution Explorer\n4. Select \"Build\"\n\n## Running All Samples as Tests\n\nIt's important to note that the CUDA samples are _not_ intended as a validation suite for CUDA. They do not cover corner cases, they do not completely cover the\nruntime and driver APIs, are not intended for performance benchmarking, etc. That said, it can sometimes be useful to run all of the samples as a quick sanity check and\nwe provide a script to do so, `run_tests.py`.\n\nThis Python3 script finds all executables in a subdirectory you choose, matching application names with command line arguments specified in `test_args.json`. It accepts\nthe following command line arguments:\n\n| Switch     | Purpose                                                                                                        | Example                 |\n| ---------- | -------------------------------------------------------------------------------------------------------------- | ----------------------- |\n| --dir      | Specify the root directory to search for executables (recursively)                                             | --dir .\u002Fbuild\u002FSamples   |\n| --config   | JSON configuration file for executable arguments                                                               | --config test_args.json |\n| --output   | Output directory for test results (stdout saved to .txt files - directory will be created if it doesn't exist) | --output .\u002Ftest         |\n| --args     | Global arguments to pass to all executables (not currently used)                                               | --args arg_1 arg_2 ...  |\n| --parallel | Number of applications to execute in parallel.                                                                 | --parallel 8            |\n\n\nApplication configurations are loaded from `test_args.json` and matched against executable names (discarding the `.exe` extension on Windows).\n\nThe script returns 0 on success, or the first non-zero error code encountered during testing on failure. It will also print a condensed list of samples that failed, if any.\n\nThere are three primary modes of configuration:\n\n**Skip**\n\nAn executable configured with \"skip\" will not be executed. These generally rely on having attached graphical displays and are not suited to this kind of automation.\n\nConfiguration example:\n```json\n\"fluidsGL\": {\n    \"skip\": true\n}\n```\n\nYou will see:\n```\nSkipping fluidsGL (marked as skip in config)\n```\n\n**Single Run**\n\nFor executables to run one time only with arguments, specify each argument as a list entry. Each entry in the JSON file will be appended to the command line, separated\nby a space.\n\nAll applications execute from their current directory, so all paths are relative to the application's location.\n\nNote that if an application needs no arguments, this entry is optional. An executable found without a matching entry in the JSON will just run as `.\u002Fapplication` from its\ncurrent directory.\n\nConfiguration example:\n```json\n\"ptxgen\": {\n    \"args\": [\n        \"test.ll\",\n        \"-arch=compute_75\"\n    ]\n}\n```\n\nYou will see:\n```\nRunning ptxgen\n    Command: .\u002Fptxgen test.ll -arch=compute_75\n    Test completed with return code 0\n```\n\n**Multiple Runs**\n\nFor executables to run multiple times with different command line arguments, specify any number of sets of args within a \"runs\" list.\n\nAs with single runs, all applications execute from their current directory, so all paths are relative to the application's location.\n\nConfiguration example:\n```json\n\"recursiveGaussian\": {\n    \"runs\": [\n        {\n            \"args\": [\n                \"-sigma=10\",\n                \"-file=data\u002Fref_10.ppm\"\n            ]\n        },\n        {\n            \"args\": [\n                \"-sigma=14\",\n                \"-file=data\u002Fref_14.ppm\"\n            ]\n        },\n        {\n            \"args\": [\n                \"-sigma=18\",\n                \"-file=data\u002Fref_18.ppm\"\n            ]\n        },\n        {\n            \"args\": [\n                \"-sigma=22\",\n                \"-file=data\u002Fref_22.ppm\"\n            ]\n        }\n    ]\n}\n```\n\nYou will see:\n```\nRunning recursiveGaussian (run 1\u002F4)\n    Command: .\u002FrecursiveGaussian -sigma=10 -file=data\u002Fref_10.ppm\n    Test completed with return code 0\nRunning recursiveGaussian (run 2\u002F4)\n    Command: .\u002FrecursiveGaussian -sigma=14 -file=data\u002Fref_14.ppm\n    Test completed with return code 0\nRunning recursiveGaussian (run 3\u002F4)\n    Command: .\u002FrecursiveGaussian -sigma=18 -file=data\u002Fref_18.ppm\n    Test completed with return code 0\nRunning recursiveGaussian (run 4\u002F4)\n    Command: .\u002FrecursiveGaussian -sigma=22 -file=data\u002Fref_22.ppm\n    Test completed with return code 0\n```\n\n### Example Usage\n\nHere is an example set of commands to build and test all of the samples.\n\nFirst, build:\n```bash\nmkdir build\ncd build\ncmake ..\nmake -j$(nproc)\n```\n\nNow, return to the samples root directory and run the test script:\n```bash\ncd ..\npython3 run_tests.py --output .\u002Ftest --dir .\u002Fbuild\u002FSamples --config test_args.json\n```\n\nIf all applications run successfully, you will see something similar to this (the specific number of samples will depend on your build type\nand system configuration):\n\n```\nTest Summary:\nRan 199 test runs for 180 executables.\nAll test runs passed!\n```\n\nIf some samples fail, you will see something like this:\n\n```\nTest Summary:\nRan 199 test runs for 180 executables.\nFailed runs (2):\n  bicubicTexture (run 1\u002F5): Failed (code 1)\n  Mandelbrot (run 1\u002F2): Failed (code 1)\n```\n\nYou can inspect the stdout logs in the output directory (generally `APM_\u003Capplication_name>.txt` or `APM_\u003Capplication_name>.run\u003Cn>.txt`) to help\ndetermine what may have gone wrong from the output logs. Please file issues against the samples repository if you believe a sample is failing\nincorrectly on your system.\n\n## Samples list\n\n### [0. Introduction](.\u002FSamples\u002F0_Introduction\u002FREADME.md)\nBasic CUDA samples for beginners that illustrate key concepts with using CUDA and CUDA runtime APIs.\n\n### [1. Utilities](.\u002FSamples\u002F1_Utilities\u002FREADME.md)\nUtility samples that demonstrate how to query device capabilities and measure GPU\u002FCPU bandwidth.\n\n### [2. Concepts and Techniques](.\u002FSamples\u002F2_Concepts_and_Techniques\u002FREADME.md)\nSamples that demonstrate CUDA related concepts and common problem solving techniques.\n\n### [3. CUDA Features](.\u002FSamples\u002F3_CUDA_Features\u002FREADME.md)\nSamples that demonstrate CUDA Features (Cooperative Groups, CUDA Dynamic Parallelism, CUDA Graphs etc).\n\n### [4. CUDA Libraries](.\u002FSamples\u002F4_CUDA_Libraries\u002FREADME.md)\nSamples that demonstrate how to use CUDA platform libraries (NPP, NVJPEG, NVGRAPH cuBLAS, cuFFT, cuSPARSE, cuSOLVER and cuRAND).\n\n### [5. Domain Specific](.\u002FSamples\u002F5_Domain_Specific\u002FREADME.md)\nSamples that are specific to domain (Graphics, Finance, Image Processing).\n\n### [6. Performance](.\u002FSamples\u002F6_Performance\u002FREADME.md)\nSamples that demonstrate performance optimization.\n\n### [7. libNVVM](.\u002FSamples\u002F7_libNVVM\u002FREADME.md)\nSamples that demonstrate the use of libNVVVM and NVVM IR.\n\n### [8. Platform Specific](.\u002FSamples\u002F8_Platform_Specific\u002FTegra\u002FREADME.md)\nSamples that are specific to certain platforms (Tegra, cuDLA, NvMedia, NvSci, OpenGL ES).\n\n## Dependencies\n\nSome CUDA Samples rely on third-party applications and\u002For libraries, or features provided by the CUDA Toolkit and Driver, to either build or execute. These dependencies are listed below.\n\nIf a sample has a third-party dependency that is available on the system, but is not installed, the sample will waive itself at build time.\n\nEach sample's dependencies are listed in its README's Dependencies section.\n\n### Third-Party Dependencies\n\nThese third-party dependencies are required by some CUDA samples. If available, these dependencies are either installed on your system automatically, or are installable via your system's package manager (Linux) or a third-party website.\n\n#### FreeImage\n\nFreeImage is an open source imaging library. FreeImage can usually be installed on Linux using your distribution's package manager system. FreeImage can also be downloaded from the FreeImage website.\n\nTo set up FreeImage on a Windows system, extract the FreeImage DLL distribution into the folder `.\u002FCommon\u002FFreeImage\u002FDist\u002Fx64` such that it contains the .h and .lib files. Copy the .dll file to the Release\u002F Debug\u002F execution folder or pass the FreeImage folder when cmake configuring with the `-DFreeImage_INCLUDE_DIR` and `-DFreeImage_LIBRARY` options.\n\n#### Message Passing Interface\n\nMPI (Message Passing Interface) is an API for communicating data between distributed processes. A MPI compiler can be installed using your Linux distribution's package manager system. It is also available on some online resources, such as [Open MPI](http:\u002F\u002Fwww.open-mpi.org\u002F). On Windows, to build and run MPI-CUDA applications one can install [MS-MPI SDK](https:\u002F\u002Fmsdn.microsoft.com\u002Fen-us\u002Flibrary\u002Fbb524831(v=vs.85).aspx).\n\n#### Only 64-Bit\n\nSome samples can only be run on a 64-bit operating system.\n\n#### DirectX\n\nDirectX is a collection of APIs designed to allow development of multimedia applications on Microsoft platforms. For Microsoft platforms, NVIDIA's CUDA Driver supports DirectX. Several CUDA Samples for Windows demonstrates CUDA-DirectX Interoperability, for building such samples one needs to install Microsoft Visual Studio 2012 or higher which provides Microsoft Windows SDK for Windows 8.\n\n#### DirectX12\n\nDirectX 12 is a collection of advanced low-level programming APIs which can reduce driver overhead, designed to allow development of multimedia applications on Microsoft platforms starting with Windows 10 OS onwards. For Microsoft platforms, NVIDIA's CUDA Driver supports DirectX. Few CUDA Samples for Windows demonstrates CUDA-DirectX12 Interoperability, for building such samples one needs to install [Windows 10 SDK or higher](https:\u002F\u002Fdeveloper.microsoft.com\u002Fen-us\u002Fwindows\u002Fdownloads\u002Fwindows-10-sdk), with VS 2015 or VS 2017.\n\n#### OpenGL\n\nOpenGL is a graphics library used for 2D and 3D rendering. On systems which support OpenGL, NVIDIA's OpenGL implementation is provided with the CUDA Driver.\n\n#### OpenGL ES\n\nOpenGL ES is an embedded systems graphics library used for 2D and 3D rendering. On systems which support OpenGL ES, NVIDIA's OpenGL ES implementation is provided with the CUDA Driver.\n\n#### Freeglut\n\nFreeglut is an open-source software library that serves as a replacement for the original OpenGL Utility Toolkit (GLUT). Its primary purpose is to make it easier for developers to create and manage windows containing OpenGL contexts, as well as handle input from devices like the mouse, keyboard, and joystick, across a wide range of platforms. To set up Freeglut on a Windowson on ARM system, you need to download the source from [Freeglut website](https:\u002F\u002Ffreeglut.sourceforge.net\u002F), build freeglut on your system, and copy the freeglut.lib into the folder `.\u002FCommon\u002Flib\u002Fx64` and copy the freeglut.dll file into the `.\u002Fbin\u002Fwin64\u002F${BUILD_TYPE}` execution folder.\n\n#### Vulkan\n\nVulkan is a low-overhead, cross-platform 3D graphics and compute API. Vulkan targets high-performance realtime 3D graphics applications such as video games and interactive media across all platforms. On systems which support Vulkan, NVIDIA's Vulkan implementation is provided with the CUDA Driver. For building and running Vulkan applications one needs to install the [Vulkan SDK](https:\u002F\u002Fwww.lunarg.com\u002Fvulkan-sdk\u002F).\n\n#### GLEW\n\nGLEW (OpenGL Extension Wrangler Library) is a cross-platform, open-source C\u002FC++ library designed to simplify the process of using modern OpenGL features and extensions. Its main function is to dynamically load OpenGL function pointers at runtime, allowing developers to access both core OpenGL functions and additional features provided by hardware vendors, known as extensions. To set up GLEW on a Windows on ARM system, you need to download the source from [GLEW website](https:\u002F\u002Fglew.sourceforge.net\u002F), build GLEW on your system, and copy the glew32.lib into the folder `.\u002FCommon\u002Flib\u002Fx64` and the glew32.dll into the `.\u002Fbin\u002Fwin64\u002F${BUILD_TYPE}` execution folder.\n\n#### GLFW\n\nGLFW is a lightweight, open-source library designed for managing OpenGL, OpenGL ES, and Vulkan contexts. It simplifies the process of creating and managing windows, handling user input (keyboard, mouse, and joystick), and working with multiple monitors in a cross-platform manner.\n\nTo set up GLFW on a Windows system, Download the pre-built binaries from [GLFW website](https:\u002F\u002Fwww.glfw.org\u002Fdownload.html) and extract the zip file into the folder, pass the GLFW include header folder as `-DGLFW_INCLUDE_DIR` and lib folder as `-DGLFW_LIB_DIR` for cmake configuring.\n\n#### OpenMP\n\nOpenMP is an API for multiprocessing programming. OpenMP can be installed using your Linux distribution's package manager system. It usually comes preinstalled with GCC. It can also be found at the [OpenMP website](http:\u002F\u002Fopenmp.org\u002F). For compilers such as clang, `libomp.so` and other components for LLVM must be installed separated. You will also need to set additional flags in your CMake configuration files, such as: `-DOpenMP_CXX_FLAGS=\"-fopenmp=libomp\" -DOpenMP_CXX_LIB_NAMES=\"omp\" -DOpenMP_omp_LIBRARY=\"\u002Fpath\u002Fto\u002Flibomp.so\"`.\n\n#### Screen\n\nScreen is a windowing system found on the QNX operating system. Screen is usually found as part of the root filesystem.\n\n#### X11\n\nX11 is a windowing system commonly found on *-nix style operating systems. X11 can be installed using your Linux distribution's package manager, and comes preinstalled on Mac OS X systems.\n\n#### EGL\n\nEGL is an interface between Khronos rendering APIs (such as OpenGL, OpenGL ES or OpenVG) and the underlying native platform windowing system.\n\n#### EGLOutput\n\nEGLOutput is a set of EGL extensions which allow EGL to render directly to the display.\n\n#### EGLSync\n\nEGLSync is a set of EGL extensions which provides sync objects that are synchronization primitive, representing events whose completion can be tested or waited upon.\n\n#### NVSCI\n\nNvSci is a set of communication interface libraries out of which CUDA interops with NvSciBuf and NvSciSync. NvSciBuf allows applications to allocate and exchange buffers in memory. NvSciSync allows applications to manage synchronization objects which coordinate when sequences of operations begin and end.\n\n#### NvMedia\n\nNvMedia provides powerful processing of multimedia data for true hardware acceleration across NVIDIA Tegra devices. Applications leverage the NvMedia Application Programming Interface (API) to process the image and video data.\n\n### CUDA Features\n\nThese CUDA features are needed by some CUDA samples. They are provided by either the CUDA Toolkit or CUDA Driver. Some features may not be available on your system.\n\n#### CUFFT Callback Routines\n\nCUFFT Callback Routines are user-supplied kernel routines that CUFFT will call when loading or storing data. These callback routines are only available on Linux x86_64 and ppc64le systems.\n\n#### CUDA Dynamic Parallellism\n\nCDP (CUDA Dynamic Parallellism) allows kernels to be launched from threads running on the GPU. CDP is only available on GPUs with SM architecture of 3.5 or above.\n\n#### Multi-block Cooperative Groups\n\nMulti Block Cooperative Groups(MBCG) extends Cooperative Groups and the CUDA programming model to express inter-thread-block synchronization. MBCG is available on GPUs with Pascal and higher architecture.\n\n#### Multi-Device Cooperative Groups\n\n Multi Device Cooperative Groups extends Cooperative Groups and the CUDA programming model enabling thread blocks executing on multiple GPUs to cooperate and synchronize as they execute. This feature is available on GPUs with Pascal and higher architecture.\n\n#### CUBLAS\n\nCUBLAS (CUDA Basic Linear Algebra Subroutines) is a GPU-accelerated version of the BLAS library.\n\n#### CUDA Interprocess Communication\n\nIPC (Interprocess Communication) allows processes to share device pointers.\n\n#### CUFFT\n\nCUFFT (CUDA Fast Fourier Transform) is a GPU-accelerated FFT library.\n\n#### CURAND\n\nCURAND (CUDA Random Number Generation) is a GPU-accelerated RNG library.\n\n#### CUSPARSE\n\nCUSPARSE (CUDA Sparse Matrix) provides linear algebra subroutines used for sparse matrix calculations.\n\n#### CUSOLVER\n\nCUSOLVER library is a high-level package based on the CUBLAS and CUSPARSE libraries. It combines three separate libraries under a single umbrella, each of which can be used independently or in concert with other toolkit libraries. The intent ofCUSOLVER is to provide useful LAPACK-like features, such as common matrix factorization and triangular solve routines for dense matrices, a sparse least-squares solver and an eigenvalue solver. In addition cuSolver provides a new refactorization library useful for solving sequences of matrices with a shared sparsity pattern.\n\n#### NPP\n\nNPP (NVIDIA Performance Primitives) provides GPU-accelerated image, video, and signal processing functions.\n\n#### NVGRAPH\n\nNVGRAPH is a GPU-accelerated graph analytics library.\n\n#### NVJPEG\n\nNVJPEG library provides high-performance, GPU accelerated JPEG decoding functionality for image formats commonly used in deep learning and hyperscale multimedia applications.\n\n#### NVRTC\n\nNVRTC (CUDA RunTime Compilation) is a runtime compilation library for CUDA C++.\n\n#### NVJITLINK\n\nNVJITLINK is a CUDA runtime library that links multiple GPU device code objects at runtime and enables just‑in‑time link‑time optimization (JIT LTO).\nIt can take device code from tools such as NVCC and NVRTC, link and optimize it on the fly, and produce the final GPU binary.For more details, see: https:\u002F\u002Fdocs.nvidia.com\u002Fcuda\u002Fnvjitlink\u002Findex.html\n\n#### Stream Priorities\n\nStream Priorities allows the creation of streams with specified priorities. Stream Priorities is only available on GPUs with SM architecture of 3.5 or above.\n\n#### Unified Virtual Memory\n\nUVM (Unified Virtual Memory) enables memory that can be accessed by both the CPU and GPU without explicit copying between the two. UVM is only available on Linux and Windows systems.\n\n#### 16-bit Floating Point\n\nFP16 is a 16-bit floating-point format. One bit is used for the sign, five bits for the exponent, and ten bits for the mantissa.\n\n#### C++11 CUDA\n\nNVCC support of [C++11 features](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FC++11).\n\n#### CMake\n\nThe libNVVM samples are built using [CMake](https:\u002F\u002Fcmake.org\u002F) 3.10 or later.\n\n## Contributors Guide\n\nWe welcome your input on issues and suggestions for samples. At this time we are not accepting contributions from the public, check back here as we evolve our contribution model.\n\nWe use Google C++ Style Guide for all the sources https:\u002F\u002Fgoogle.github.io\u002Fstyleguide\u002Fcppguide.html\n\n## Frequently Asked Questions\n\nAnswers to frequently asked questions about CUDA can be found at http:\u002F\u002Fdeveloper.nvidia.com\u002Fcuda-faq and in the [CUDA Toolkit Release Notes](http:\u002F\u002Fdocs.nvidia.com\u002Fcuda\u002Fcuda-toolkit-release-notes\u002Findex.html).\n\n## References\n\n*   [CUDA Programming Guide](https:\u002F\u002Fdocs.nvidia.com\u002Fcuda\u002Fcuda-programming-guide\u002Findex.html)\n*   [Accelerated Computing Blog](https:\u002F\u002Fdeveloper.nvidia.com\u002Fblog\u002F?tags=accelerated-computing)\n\n## Attributions\n\n*   Teapot image is obtained from [Wikimedia](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FFile:Original_Utah_Teapot.jpg) and is licensed under the Creative Commons [Attribution-Share Alike 2.0](https:\u002F\u002Fcreativecommons.org\u002Flicenses\u002Fby-sa\u002F2.0\u002Fdeed.en) Generic license. The image is modified for samples use cases.\n","NVIDIA\u002Fcuda-samples 是一个为 CUDA 开发者提供的示例项目，展示了 CUDA 工具包中的各种功能。该项目主要使用 C 语言编写，通过一系列精心设计的代码片段来演示如何利用 CUDA 驱动 API、CUDA 内核以及 CUDA-OpenGL 互操作等技术特性进行高效并行计算。这些样例非常适合需要在 NVIDIA GPU 上加速计算密集型任务的应用场景，如图像处理、物理模拟或机器学习等领域。此外，该项目支持多种操作系统，并且提供了详细的构建指南和调试方法，方便开发者快速上手并深入理解 CUDA 编程模型。",2,"2026-06-11 03:06:19","top_language"]