Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix problem with unresolved symbols when multiple shaders call certain #1401

Merged

Conversation

cmstein
Copy link
Collaborator

@cmstein cmstein commented Sep 2, 2021

functions on the GPU (ie. osl_printf()).

Description

Tests

Checklist:

  • I have read the contribution guidelines.
  • I have previously submitted a Contributor License Agreement.
  • I have updated the documentation, if applicable.
  • I have ensured that the change is tested somewhere in the testsuite (adding new test cases if necessary).
  • My code follows the prevailing code style of this project.

functions on the GPU (ie. osl_printf()).

Signed-off-by: Clifford Stein <[email protected]>
@cmstein cmstein force-pushed the remove_weak_attributes branch from c404cde to fa6c736 Compare September 2, 2021 23:49
Copy link
Collaborator

@lgritz lgritz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, will merge after CI results are complete.

@cmstein
Copy link
Collaborator Author

cmstein commented Sep 2, 2021

This fixes a problem I was seeingon the GPU: if I had two shaders that contained a printf(), then the second shader group would report osl_printf as being an unresolved function (the first shader group was fine). If I looked at the PTX for the second shader group, osl_printf was tagged as a "weak" function. Removing the "weak" attribute resolves the problem.

I'm not sure why osl_printf and rend_get_userdata should be different from the other functions in rend_lib.cu.

This is easily reproduced in testsuite/testoptix by adding a printf() to checkerboard.osl and microfacet_test.osl.

@lgritz lgritz merged commit 1b05f9a into AcademySoftwareFoundation:master Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants