Skip to content

embed_ptx macro issues #145

@ingowald

Description

@ingowald

Recent project discovered issues with embed_ptx macro that I think I root-caused to two issues:

a) embedded strings did were not 0-zerminated, which could cause garbage to be passed to optix when reading the embeeded sybols as if they were C-strings. In particular, having multiple embeeded ptx strings right after each other could cause the first symbol to effectively contain all those strings, which caused issues.

b) apparently the embed macro doesn't properly handle source files in subdirectories; at least in my case I got empty ".c" files, even though the ".ptx" files contained the expected code; I couldn't yet root-cause what caused this. Moving the embed_ptx calls into the subdirectories that contained the .cu files fixed the issue.

Suggested todos:
for a), add "--padd 0" to the generated command - that seems to fix the issue (after a complete make clean and make); but my current code is too broken w/ debugging snippets to check in, so this has to be added, re-verified and then committed from a clean repo.

for b) no idea what causes this, but should:

  • b.1) verify that this is indeed the case, and if so
  • b.2) either fix this; or
  • b.3) add a check that throws a clear error if any of the input sources are not in the current directory.

@jeffamstutz for visibility could you take a look at 'b' in partciular? i'm stumped right now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions