cloudcores / CuAssembler

An unofficial cuda assembler, for all generations of SASS, hopefully :)
MIT License
361 stars 66 forks source link

I cannot run CubinFile #1

Closed Shaquille-Wu closed 3 years ago

Shaquille-Wu commented 3 years ago

我的python代码如下:
binname = 'D:\WorkSpace\cuda_workspace\instruction_test\simpletest\x64\Release\kernel.sm_61.cubin'
cf = CubinFile(binname)
asmname = binname.replace('.cubin', '.cuasm')
cf.saveAsCuAsm(asmname)

各种软件版本如下:
python is 3.7.4
cuda tool kit is 10.2
Sympy is 1.4
pyelftools is the latest

总是提示“Exception: The segment range (0x2a4, 0x4fc) doesnot align with sections!”
即便把sm_61.cubin换成相应的sm_50或者sm_75都是类似的错误提示,不知道大神能不能帮忙看看什么原因? 相应的cu文件和cubin文件在附件中 simpletest.zip

cloudcores commented 3 years ago

我也发现有这个问题 -_-bbb

这个是有些cubin版本不一样导致的。有些ELF的segment计算范围时,边界和section对不齐。我这里用的11.1是ok的。我最近有时间check一下~

cloudcores commented 3 years ago

简单做了个workaround~ check out最新版试试吧!

我感觉这说不定是它的bug…… 因为之前算segment边界的时候它可能没算后面的padding的NOP。新版的没有仔细check,应该没有这个问题……

Shaquille-Wu commented 3 years ago

好了,谢谢大佬