Skip to content
Back to search

ptx-isa-markdown

PTX ISA 9.1 documentation converted to searchable markdown. Includes Claude Code skill for CUDA development.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/technillogue--ptx-isa-markdown/badge.svg)](/listings/technillogue--ptx-isa-markdown)

HTML

<a href="/listings/technillogue--ptx-isa-markdown"><img src="/api/listings/technillogue--ptx-isa-markdown/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 312 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # NVIDIA CUDA Documentation + Claude Code Skill
  2. NVIDIA's PTX ISA 9.1, CUDA Runtime API 13.1, and CUDA Driver API 13.1 documentation converted to searchable markdown, with a Claude Code skill for GPU development.
  3. ## What's Here
  4. 1. **PTX ISA 9.1 Documentation** (405 markdown files, 2.3MB)
  5. - Complete instruction set reference
  6. - All tables, code blocks, and mathematical notation preserved
  7. - Organized by chapter with section numbers
  8. - Images linked to NVIDIA's CDN
  9. 2. **CUDA Runtime API 13.1 Documentation** (107 markdown files, 0.9MB)
  10. - Complete function and data structure reference
  11. - 41 API modules (device, memory, streams, events, graphs, etc.)
  12. - 66 data structures (cudaDeviceProp, cudaMemcpy3DParms, etc.)
  13. - All parameters, return values, and detailed descriptions
  14. - Navigation, duplicate content, redundant URLs, and boilerplate removed (83% size reduction)
  15. 3. **CUDA Driver API 13.1 Documentation** (128 markdown files, 0.8MB)
  16. - Complete low-level driver API reference
  17. - 50 API modules (context, module loading, virtual memory, graphs, etc.)
  18. - 80 data structures (CUdevice, CUcontext, launch parameters, etc.)
  19. - All parameters, return values, and detailed descriptions
  20. - Navigation, duplicate TOC, cross-references, and redundant URLs removed (76% size reduction)
  21. 4. **CUDA Development Skill** for Claude Code
  22. - PTX instruction lookup and examples
  23. - CUDA Runtime & Driver API function reference
  24. - Profiling workflows (nsys, ncu)
  25. - Debugging patterns (compute-sanitizer, cuda-gdb)
  26. - TensorCore operation reference (WMMA, WGMMA, TMA)
  27. ## Why
  28. NVIDIA's official documentation is:
  29. - **PTX ISA**: A single 5MB HTML page requiring Ctrl+F through megabytes
  30. - **CUDA Runtime API**: 75+ separate HTML pages requiring multiple clicks
  31. - **CUDA Driver API**: 130+ separate HTML pages requiring multiple clicks
  32. This conversion enables:
  33. - `grep -r "register fragment" ptx-docs/` instead of Ctrl+F
  34. - `grep -r "cudaErrorInvalidValue" cuda-runtime-docs/` instead of clicking through modules
  35. - `grep -r "cuCtxCreate" cuda-driver-docs/` for low-level API lookup
  36. - Direct file access for AI tools (Claude, Copilot)
  37. - Offline reference with proper organization
  38. **Example 1**: Find how to disable TMA swizzling:
  39. ```bash
  40. $ grep -r "swizzle_mode.*no swizzling" cuda_skill/references/ptx-docs/
  41. 9.7.9.28-data-movement-and-conversion-instructionstensormapreplace.md:
  42. 0 | `.u8` | No interleave | No swizzling | 16B | Zero fill
  43. ```
  44. Answer: use `tensormap.replace` with `.swizzle_mode = 0`.
  45. **Example 2**: Look up what cudaErrorInvalidValue means:
  46. ```bash
  47. $ grep -A 5 "cudaErrorInvalidValue" cuda_skill/references/cuda-runtime-docs/
  48. ```
  49. Answer: Instantly find error code documentation with description and related errors.
  50. **Example 3**: Understand context management in Driver API:
  51. ```bash
  52. $ grep -A 20 "cuCtxCreate" cuda_skill/references/cuda-driver-docs/modules/group__cuda__ctx.md
  53. ```
  54. Answer: Full cuCtxCreate parameters, return values, and context behavior.
  55. ## Structure
  56. ```
  57. cuda_skill/ # Portable Claude Code skill (~4.2MB)
  58. ├── SKILL.md # Main skill definition
  59. └── references/
  60. ├── ptx-docs/ # 405 markdown files (2.3MB)
  61. │ ├── 9-instruction-set/ # 186 instruction files
  62. │ │ ├── 9.7.15.5-*.md # WGMMA register layouts
  63. │ │ └── 9.7.16-*.md # TensorCore Gen5 (Blackwell)
  64. │ ├── 5-state-spaces-types-and-variables/
  65. │ ├── 8-memory-consistency-model/
  66. │ └── INDEX.md
  67. ├── cuda-runtime-docs/ # 107 markdown files (0.9MB)
  68. │ ├── modules/ # 41 API modules
  69. │ │ ├── group__cudart__device.md
  70. │ │ ├── group__cudart__memory.md
  71. │ │ ├── group__cudart__stream.md
  72. │ │ └── ...
  73. │ ├── data-structures/ # 66 structs/unions
  74. │ │ ├── structcudadeviceprop.md
  75. │ │ ├── structcudamemcpy3dparms.md
  76. │ │ └── ...
  77. │ └── INDEX.md
  78. ├── cuda-driver-docs/ # 128 markdown files (0.8MB)
  79. │ ├── modules/ # 50 API modules
  80. │ │ ├── group__cuda__ctx.md
  81. │ │ ├── group__cuda__mem.md
  82. │ │ ├── group__cuda__stream.md
  83. │ │ ├── group__cuda__module.md
  84. │ │ ├── group__cuda__va.md
  85. │ │ └── ...
  86. │ ├── data-structures/ # 80 structs
  87. │ │ ├── structcudevprop__v1.md
  88. │ │ ├── structcuda__memcpy3d__v2.md
  89. │ │ └── ...
  90. │ └── INDEX.md
  91. ├── ptx-isa.md # PTX search guide and examples
  92. ├── cuda-runtime.md # Runtime API search guide
  93. ├── cuda-driver.md # Driver API search guide
  94. ├── nsys-guide.md # Nsight Systems patterns
  95. ├── ncu-guide.md # Nsight Compute metrics
  96. └── debugging-tools.md # compute-sanitizer, cuda-gdb
  97. scrape_ptx_docs.py # Regenerate PTX docs (uv script)
  98. scrape_cuda_runtime.py # Regenerate Runtime docs (uv script)
  99. scrape_cuda_driver.py # Regenerate Driver docs (uv script)
  100. ```
  101. ## Using the Skill
  102. Install:
  103. ```bash
  104. cp -r cuda_skill ~/.claude/skills/cuda
  105. ```
  106. The skill activates automatically for CUDA work. Ask Claude:
  107. - "What's the register fragment layout for WGMMA m64n16k16?"
  108. - "How do I disable TMA swizzling?"
  109. - "What does cudaErrorInvalidValue mean?"
  110. - "What fields are in cudaDeviceProp?"
  111. - "How do I create a CUDA context with the Driver API?"
  112. - "What's the difference between cuMemAlloc and cudaMalloc?"
  113. - "Profile this kernel with nsys"
  114. Claude searches the local documentation and provides answers with section references.
  115. ## Search Examples
  116. ### PTX ISA
  117. Find WGMMA register fragments:
  118. ```bash
  119. grep -r "register fragment" cuda_skill/references/ptx-docs/9-instruction-set/ | grep -i wgmma
  120. ```
  121. Find all swizzling modes:
  122. ```bash
  123. find cuda_skill/references/ptx-docs -name "*swizzl*"
  124. ```
  125. Search for any instruction:
  126. ```bash
  127. grep -r "mbarrier.init" cuda_skill/references/ptx-docs/
  128. ```
  129. ### CUDA Runtime API
  130. Look up error code:
  131. ```bash
  132. grep -A 10 "cudaErrorInvalidValue" cuda_skill/references/cuda-runtime-docs/
  133. ```
  134. Find device properties:
  135. ```bash
  136. cat cuda_skill/references/cuda-runtime-docs/data-structures/structcudadeviceprop.md
  137. ```
  138. ### CUDA Driver API
  139. Look up context creation:
  140. ```bash
  141. grep -A 20 "cuCtxCreate" cuda_skill/references/cuda-driver-docs/modules/group__cuda__ctx.md
  142. ```
  143. Find virtual memory management:
  144. ```bash
  145. ls cuda_skill/references/cuda-driver-docs/modules/*va*.md
  146. cat cuda_skill/references/cuda-driver-docs/modules/group__cuda__va.md
  147. ```
  148. Understand module loading:
  149. ```bash
  150. grep -A 15 "cuModuleLoad" cuda_skill/references/cuda-driver-docs/modules/group__cuda__module.md
  151. ```
  152. Search for stream functions:
  153. ```bash
  154. grep -r "cudaStreamSynchronize" cuda_skill/references/cuda-runtime-docs/
  155. ```
  156. ## Regenerating
  157. Run the scrapers to update from NVIDIA's latest docs:
  158. ```bash
  159. # Update PTX ISA docs
  160. ./scrape_ptx_docs.py
  161. # Update CUDA Runtime API docs (2-step process for backward compatibility)
  162. ./scrape_cuda_runtime.py # 1. Download and convert
  163. python3 cleanup_cuda_docs.py # 2. Remove redundant content
  164. # Update CUDA Driver API docs (integrated pipeline with caching)
  165. ./scrape_cuda_driver.py # Download, cache, and cleanup automatically
  166. # Fast iteration on cleanup (uses cached raw files):
  167. ./scrape_cuda_driver.py --skip-download
  168. ```
  169. All scrapers use uv for dependency management (beautifulsoup4, html2text, requests).
  170. **PTX scraper**:
  171. - Parses single-page HTML documentation
  172. - Splits by section into individual markdown files
  173. - Preserves tables using markdown syntax
  174. - Converts image references to absolute URLs
  175. - Maintains section hierarchy
  176. **Runtime API scraper**:
  177. - Crawls 75+ module and data structure pages
  178. - Organizes into modules/ and data-structures/ directories
  179. - Preserves function signatures, parameters, return values
  180. - Maintains cross-references between functions
  181. - Requires separate cleanup step for backward compatibility
  182. **Driver API scraper**:
  183. - Crawls 130+ module and data structure pages
  184. - Caches raw files to `cuda-driver-docs-raw/` for fast iteration
  185. - Automatically runs cleanup to produce final docs
  186. - Use `--skip-download` to re-run cleanup without re-downloading
  187. - Results in 76% size reduction (3.6MB → 0.8MB)
  188. **API cleanup process**:
  189. - Removes duplicate function TOC (detailed docs remain)
  190. - Removes verbose "See also:" cross-references (grep provides same discoverability)
  191. - Removes anchor links, `[inherited]` tags, zero-width spaces
  192. - Removes footer (Privacy Policy, Copyright, NVIDIA logo)
  193. - Removes redundant URLs from markdown links (type/function names preserved)
  194. - Removes generic boilerplate notes (async errors, initialization errors, callback restrictions)
  195. - Cleans up excessive whitespace
  196. - Runtime API: 83% reduction, Driver API: 77% reduction
  197. ## Quality
  198. **PTX ISA**: Tables verified against HTML source. Mathematical notation preserved. 1049 images accessible via NVIDIA CDN links. See `docs/QUALITY_REPORT.md` for detailed verification results.
  199. **CUDA Runtime API**: All 107 pages successfully converted. Function signatures, parameters, return values, and descriptions fully preserved. Type and function names preserved for grep-based navigation. Navigation, duplicate content, redundant URLs, generic boilerplate notes, and formatting noise removed for cleaner, more focused documentation (83% size reduction).
  200. **CUDA Driver API**: All 128 pages (130 total minus 2 404 errors) successfully converted. Function signatures, parameters, return values, and descriptions fully preserved. Type and function names preserved for grep-based navigation. Duplicate function TOC, verbose "See also" sections, redundant URLs, navigation, footer, and formatting noise removed (76% size reduction).
  201. Verification:
  202. - All function parameters documented
  203. - All return values documented
  204. - Data structure fields accessible
  205. - Real-world queries tested and working
  206. Known limitations:
  207. - Cross-file anchor links don't resolve (use grep instead)
  208. - Images not downloaded locally (fetch from NVIDIA CDN as needed)
  209. ## Technical Details
  210. **PTX ISA**:
  211. - Version: 9.1
  212. - Files: 405 markdown files
  213. - Size: 2.3 MB
  214. - Source: https://docs.nvidia.com/cuda/parallel-thread-execution/
  215. **CUDA Runtime API**:
  216. - Version: 13.1
  217. - Files: 107 markdown files (41 modules + 66 data structures)
  218. - Size: 0.9 MB (83% reduction from cleaning)
  219. - Source: https://docs.nvidia.com/cuda/cuda-runtime-api/
  220. **CUDA Driver API**:
  221. - Version: 13.1
  222. - Files: 128 markdown files (50 modules + 80 data structures)
  223. - Size: 0.8 MB (76% reduction from cleaning)
  224. - Source: https://docs.nvidia.com/cuda/cuda-driver-api/
  225. **License**: Documentation © NVIDIA Corporation
  226. The skill uses Claude Code's progressive disclosure: `SKILL.md` is always loaded (~13KB), reference files load on-demand, and documentation is searched rather than loaded into context.
  227. **Total skill size**: ~4.2MB (2.3MB PTX + 0.9MB Runtime + 0.8MB Driver + guides)
  228. **Note**: After scraping, the raw cache directory `cuda-driver-docs-raw/` (3.7MB) can be removed from the skill if space is a concern. It's only needed for iterating on cleanup logic.
  229. ## Use Cases
  230. - **Low-level CUDA optimization** — Inline PTX, instruction selection
  231. - **Compiler output understanding** — `cuobjdump -ptx` analysis
  232. - **TensorCore programming** — WMMA/WGMMA/TMA operations
  233. - **Runtime API reference** — Error codes, function parameters, struct fields
  234. - **Driver API reference** — Context management, module loading, virtual memory
  235. - **Multi-context applications** — Explicit context control with Driver API
  236. - **PTX/CUBIN module loading** — Dynamic kernel loading at runtime
  237. - **Advanced memory features** — Virtual memory, multicast, tensor maps
  238. - **Context and stream debugging** — Understanding CUDA Runtime behavior
  239. - **Memory management** — Choosing between malloc variants
  240. - **GPU architecture research**
  241. - **Training AI models** on CUDA/PTX/Runtime API
  242. ---
  243. Unofficial conversion for convenience. Refer to NVIDIA's official documentation for authoritative reference:
  244. - [PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/)
  245. - [CUDA Runtime API](https://docs.nvidia.com/cuda/cuda-runtime-api/)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.