Coder Social home page Coder Social logo

nooblyh / cuda_hook Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bruce-lee-ly/cuda_hook

0.0 0.0 0.0 668 KB

Hooked CUDA-related dynamic libraries by using automated code generation tools.

License: MIT License

Shell 0.14% C++ 39.73% Python 0.09% C 59.98% CMake 0.07%

cuda_hook's Introduction

CUDA Hook

Hooked CUDA-related dynamic libraries by using automated code generation tools. Based on this, you can easily obtain the CUDA API called by the CUDA program, and you can also hijack the CUDA API to insert custom logic.

It implements an ingenious tool to automatically generate code that hooks the CUDA api with CUDA native header files, and is extremely practical and extensible.

At present, the hooking of dynamic libraries such as cuda driver, nvml, cuda runtime, cudnn, cublas, cublasLt, cufft, nvtx, nvrtc, curand, cusparse, cusolver, nvjpeg and nvblas has been completed, and it can also be easily extended to the hooking of other cuda dynamic libraries.

Support Dynamic Libraries

  • CUDA Driver: libcuda.so
  • NVML: libnvidia-ml.so
  • CUDA Runtime: libcudart.so
  • CUDNN: libcudnn.so
  • CUBLAS: libcublas.so
  • CUBLASLT: libcublasLt.so
  • CUFFT: libcufft.so
  • NVTX: libnvToolsExt.so
  • NVRTC: libnvrtc.so
  • CURAND: libcurand.so
  • CUSPARSE: libcusparse.so
  • CUSOLVER: libcusolver.so
  • NVJPEG: libnvjpeg.so
  • NVBLAS: libnvblas.so

Compile

Environment

  • OS: Linux
  • Cmake Version: >= 3.12
  • GCC Version: >= 4.8
  • CUDA Version: 11.4 (best)
  • CUDA Driver Version: 470.129.06 (best)
  • CUDNN Version: 7.6.5 (best)

Clone

git clone https://github.com/Bruce-Lee-LY/cuda_hook.git

Build

GTX1080Ti

cd cuda_hook
./build.sh -a 61 -t Release -s ON -b OFF
./build.sh -a 61 -t Debug -s OFF -b ON

Tesla V100

cd cuda_hook
./build.sh -a 70 -t Release -s ON -b OFF
./build.sh -a 70 -t Debug -s OFF -b ON

RTX2080Ti

cd cuda_hook
./build.sh -a 75 -t Release -s ON -b OFF
./build.sh -a 75 -t Debug -s OFF -b ON

NVIDIA A100

cd cuda_hook
./build.sh -a 80 -t Release -s ON -b OFF
./build.sh -a 80 -t Debug -s OFF -b ON

RTX3080Ti / RTX3090 / RTX A6000

cd cuda_hook
./build.sh -a 86 -t Release -s ON -b OFF
./build.sh -a 86 -t Debug -s OFF -b ON

Run Sample

./run_sample.sh

Tools

Code Generate

Use CUDA native header files to automatically generate code that hooks CUDA API.

cd tools/code_generate
./code_generate.sh

cuda_hook's People

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.