Title: [BUG]: Compiling PTX with undefined extern succeeds and produces empty kernel · Issue #920 · NVIDIA/cuda-python · GitHub
Open Graph Title: [BUG]: Compiling PTX with undefined extern succeeds and produces empty kernel · Issue #920 · NVIDIA/cuda-python
X Title: [BUG]: Compiling PTX with undefined extern succeeds and produces empty kernel · Issue #920 · NVIDIA/cuda-python
Description: Is this a duplicate? I confirmed there appear to be no duplicate issues for this bug and that I agree to the Code of Conduct Type of Bug Silent Failure Component cuda.core Describe the bug Attempting to compile PTX with an undefined exte...
Open Graph Description: Is this a duplicate? I confirmed there appear to be no duplicate issues for this bug and that I agree to the Code of Conduct Type of Bug Silent Failure Component cuda.core Describe the bug Attempti...
X Description: Is this a duplicate? I confirmed there appear to be no duplicate issues for this bug and that I agree to the Code of Conduct Type of Bug Silent Failure Component cuda.core Describe the bug Attempti...
Opengraph URL: https://github.com/NVIDIA/cuda-python/issues/920
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[BUG]: Compiling PTX with undefined extern succeeds and produces empty kernel","articleBody":"### Is this a duplicate?\n\n- [x] I confirmed there appear to be no [duplicate issues](https://github.com/NVIDIA/cuda-python/issues) for this bug and that I agree to the [Code of Conduct](CODE_OF_CONDUCT.md)\n\n### Type of Bug\n\nSilent Failure\n\n### Component\n\ncuda.core\n\n### Describe the bug\n\nAttempting to compile PTX with an undefined extern function seems to succeed and produce a cubin with an empty kernel. I am doing this like:\n\n```python\nfrom cuda.core.experimental import Program, ProgramOptions\n\noptions = ProgramOptions(arch=\"sm_75\")\nprogram = Program(code, code_type=\"ptx\", options=options)\ncubin = program.compile(\"cubin\")\n```\n\nThe same PTX compiled with ptxas results in a failure to compile:\n\n```\n$ ptxas -arch sm_75 add_float16.ptx \nptxas fatal : Unresolved extern function '_ZplRK6__halfS1__1'\n```\n\nAm I using the `Program.compile()` interface incorrectly?\n\n### How to Reproduce\n\nRun the attached file:\n\n```\npython cudapy.py\n```\n\nThis will produce a cubin with an empty kernel, and show `ptxas` raises an error for the same PTX.\n\n[cudapy.py](https://github.com/user-attachments/files/22028945/cudapy.py)\n\n### Expected behavior\n\nAn exception or some other error raised by `Program.compile()`\n\n### Operating System\n\nUbuntu Linux\n\n### nvidia-smi output\n\n_No response_","author":{"url":"https://github.com/gmarkall","@type":"Person","name":"gmarkall"},"datePublished":"2025-08-28T16:00:43Z","url":"https://github.com/NVIDIA/cuda-python/issues/920"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0e61a5fd-0a60-be92-fac3-91b12d9bf2d5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D744:383F61:1247DA0:186D3B0:6AF88D09 |
| html-safe-nonce | 1dc88a14830ac8acf2269312b39fd9ce691dd4d1085f0250cbd0c59ec51df37c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENzQ0OjM4M0Y2MToxMjQ3REEwOjE4NkQzQjA6NkFGODhEMDkiLCJ2aXNpdG9yX2lkIjoiNjEwMTI1MjA2NTEyNjI4ODY1MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2e8765cb6a2639da5f6ce50d0a87622ea0de05578e3ba7ccefb6f00ebcae9218 |
| hovercard-subject-tag | issue:3363876759 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NVIDIA/cuda-python/920/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b580a1ea510a88e568e889f02f47b86c73960303a12f5c30abd346a409e1297b/NVIDIA/cuda-python/issues/920 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b580a1ea510a88e568e889f02f47b86c73960303a12f5c30abd346a409e1297b/NVIDIA/cuda-python/issues/920 |
| og:image:alt | Is this a duplicate? I confirmed there appear to be no duplicate issues for this bug and that I agree to the Code of Conduct Type of Bug Silent Failure Component cuda.core Describe the bug Attempti... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gmarkall |
| hostname | github.com |
| expected-hostname | github.com |
| None | 612d3e6ffd693e7ea8d9fcf452370995872baef31d825b1fedef704cd3d24ac7 |
| turbo-cache-control | no-preview |
| go-import | github.com/NVIDIA/cuda-python git https://github.com/NVIDIA/cuda-python.git |
| octolytics-dimension-user_id | 1728152 |
| octolytics-dimension-user_login | NVIDIA |
| octolytics-dimension-repository_id | 381173759 |
| octolytics-dimension-repository_nwo | NVIDIA/cuda-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 381173759 |
| octolytics-dimension-repository_network_root_nwo | NVIDIA/cuda-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 072e34035c13c31543fba9f025cbbbda4210dae4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width