[BUG]: cuda-core: attributes.ptx_version() returns .target field, not .version from ptx file
Open
Nobody has claimed this yet.
awaiting-response
bug
cuda.core
- Dominant language
- Cython
- Stars
- 3.4k
- Forks
- 329
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 116
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
Something else
Component
cuda.core
Describe the bug
test.ptx
.version 8.8
.target sm_86
.address_size 64
.visible .entry test_kernel()
{
ret;
}
main.py
from cuda.core.experimental import Device, LaunchConfig, Program, ProgramOptions, launch, ObjectCode
dev = Device()
dev.set_current()
s = dev.create_stream()
mod = ObjectCode.from_ptx('test.ptx')
print(mod.get_kernel('test_kernel').attributes.num_regs())
print(mod.get_kernel('test_kernel').attributes.ptx_version())
print(mod.get_kernel('test_kernel').attributes.binary_version())
Prints
4
86
89
An aside, I am so excited for this library!
How to Reproduce
Run the above code
Expected behavior
I would expect ptx_version() to return the .version field from the ptx source.
Operating System
Ubuntu Linux 24.04
nvidia-smi output
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 575.51.03 Driver Version: 576.28 CUDA Version: 12.9 |
|-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 4090 On | 00000000:01:00.0 On | Off |
| 0% 45C P3 72W / 450W | 2921MiB / 24564MiB | 1% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| No running processes found |
+-----------------------------------------------------------------------------------------+
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided main.py with test.ptx and inspect the cuda.core.experimental ObjectCode.from_ptx and kernel attributes entry points, especially ptx_version(). Done means ptx_version() reports the PTX .version value, 8.8 for this input, while the other reported attributes retain their expected values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- hpc
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 42/100