mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-06-24 02:14:17 +00:00
fix CUDA=1 disassembly (VIZ=1) by stripping null terminator (#14046)
* fix ptxas disassembly bug * single ' * move fix to get_bytes * move rstrip --------- Co-authored-by: qazal <77887910+Qazalin@users.noreply.github.com>
This commit is contained in:
parent
13e5d00d0e
commit
c70c112254
1 changed files with 1 additions and 1 deletions
|
|
@ -35,7 +35,7 @@ def pretty_ptx(s):
|
|||
def cuda_disassemble(lib:bytes, arch:str):
|
||||
try:
|
||||
fn = (pathlib.Path(tempfile.gettempdir()) / f"tinycuda_{hashlib.md5(lib).hexdigest()}").as_posix()
|
||||
with open(fn, "wb") as f: f.write(lib)
|
||||
with open(fn, "wb") as f: f.write(lib.rstrip(b'\x00'))
|
||||
subprocess.run(["ptxas", f"-arch={arch}", "-o", fn, fn], check=False, stderr=subprocess.DEVNULL) # optional ptx -> sass step for CUDA=1
|
||||
print(system(f'nvdisasm {fn}'))
|
||||
except Exception as e: print("Failed to generate SASS", str(e), "Make sure your PATH contains ptxas/nvdisasm binary of compatible version.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue