{"id":20513401,"url":"https://github.com/bruce-lee-ly/cuda_hook","last_synced_at":"2025-08-21T03:32:13.860Z","repository":{"id":41411773,"uuid":"497355797","full_name":"Bruce-Lee-LY/cuda_hook","owner":"Bruce-Lee-LY","description":"Hooked CUDA-related dynamic libraries by using automated code generation tools.","archived":false,"fork":false,"pushed_at":"2023-12-12T00:48:07.000Z","size":734,"stargazers_count":150,"open_issues_count":0,"forks_count":41,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T03:30:36.745Z","etag":null,"topics":["auto-generate","code-generate","cublas","cublaslt","cuda-driver","cuda-hijack","cuda-hook","cudart","cudnn","cufft","curand","cusolver","cusparse","gpu","nvblas","nvidia","nvjpeg","nvml","nvrtc","nvtx"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Bruce-Lee-LY.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-28T15:26:17.000Z","updated_at":"2025-03-20T14:25:26.000Z","dependencies_parsed_at":"2024-11-15T21:10:57.339Z","dependency_job_id":"16b11486-6110-4819-a6e0-07f77951b0eb","html_url":"https://github.com/Bruce-Lee-LY/cuda_hook","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Bruce-Lee-LY/cuda_hook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bruce-Lee-LY%2Fcuda_hook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bruce-Lee-LY%2Fcuda_hook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bruce-Lee-LY%2Fcuda_hook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bruce-Lee-LY%2Fcuda_hook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bruce-Lee-LY","download_url":"https://codeload.github.com/Bruce-Lee-LY/cuda_hook/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bruce-Lee-LY%2Fcuda_hook/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271420490,"owners_count":24756574,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["auto-generate","code-generate","cublas","cublaslt","cuda-driver","cuda-hijack","cuda-hook","cudart","cudnn","cufft","curand","cusolver","cusparse","gpu","nvblas","nvidia","nvjpeg","nvml","nvrtc","nvtx"],"created_at":"2024-11-15T21:10:51.254Z","updated_at":"2025-08-21T03:32:13.371Z","avatar_url":"https://github.com/Bruce-Lee-LY.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CUDA Hook\nHooked 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.\n\nIt implements an ingenious tool to automatically generate code that hooks the CUDA api with CUDA native header files, and is extremely practical and extensible.\n\nAt 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.\n\n# Support Dynamic Libraries\n- CUDA Driver: libcuda.so\n- NVML: libnvidia-ml.so\n- CUDA Runtime: libcudart.so\n- CUDNN: libcudnn.so\n- CUBLAS: libcublas.so\n- CUBLASLT: libcublasLt.so\n- CUFFT: libcufft.so\n- NVTX: libnvToolsExt.so\n- NVRTC: libnvrtc.so\n- CURAND: libcurand.so\n- CUSPARSE: libcusparse.so\n- CUSOLVER: libcusolver.so\n- NVJPEG: libnvjpeg.so\n- NVBLAS: libnvblas.so\n\n# Compile\n## Environment\n- OS: Linux\n- Cmake Version: \u003e= 3.12\n- GCC Version: \u003e= 4.8\n- CUDA Version: 11.4 (best)\n- CUDA Driver Version: 470.129.06 (best)\n- CUDNN Version: 7.6.5 (best)\n\n## Clone\n```\ngit clone https://github.com/Bruce-Lee-LY/cuda_hook.git\n```\n\n## Build\n### GTX1080Ti\n```\ncd cuda_hook\n./build.sh -a 61 -t Release -s ON -b OFF\n./build.sh -a 61 -t Debug -s OFF -b ON\n```\n\n### Tesla V100\n```\ncd cuda_hook\n./build.sh -a 70 -t Release -s ON -b OFF\n./build.sh -a 70 -t Debug -s OFF -b ON\n```\n\n### RTX2080Ti\n```\ncd cuda_hook\n./build.sh -a 75 -t Release -s ON -b OFF\n./build.sh -a 75 -t Debug -s OFF -b ON\n```\n\n### NVIDIA A100\n```\ncd cuda_hook\n./build.sh -a 80 -t Release -s ON -b OFF\n./build.sh -a 80 -t Debug -s OFF -b ON\n```\n\n### RTX3080Ti / RTX3090 / RTX A6000\n```\ncd cuda_hook\n./build.sh -a 86 -t Release -s ON -b OFF\n./build.sh -a 86 -t Debug -s OFF -b ON\n```\n\n# Run Sample\n```\n./run_sample.sh\n```\n\n# Tools\n## Code Generate\nUse CUDA native header files to automatically generate code that hooks CUDA API.\n```\ncd tools/code_generate\n./code_generate.sh\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbruce-lee-ly%2Fcuda_hook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbruce-lee-ly%2Fcuda_hook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbruce-lee-ly%2Fcuda_hook/lists"}