Date   

Event: OSL TSC meeting ( every other week ) - 09/02/2021 #cal-reminder

osl-dev@lists.aswf.io Calendar <noreply@...>
 

Reminder: OSL TSC meeting ( every other week )

When:
09/02/2021
2:00pm to 3:00pm
(UTC-07:00) America/Los Angeles

Where:
https://zoom.us/j/100511909

Organizer: Chris Kulla ckulla@...

View Event

Description:

Every other week meeting of the OSL TSC.

Meeting Agenda / Notes: https://docs.google.com/document/d/1yf0bG6eoE2EvKZBNZX3nskdTvu99ADTDTNOknCDJd1I/

Confirm this meeting invite is still valid by finding the meeting at https://lists.aswf.io/calendar.

Join Zoom Meeting https://zoom.us/j/100511909

Meeting ID: 100 511 909

One tap mobile +16465588656,,100511909# US (New York) +13126266799,,100511909# US (Chicago)

Dial by your location +1 646 558 8656 US (New York) +1 312 626 6799 US (Chicago) +1 669 900 6833 US (San Jose) +1 253 215 8782 US +1 301 715 8592 US +1 346 248 7799 US (Houston) 877 369 0926 US Toll-free 855 880 1246 US Toll-free +1 587 328 1099 Canada +1 647 374 4685 Canada +1 647 558 0588 Canada +1 778 907 2071 Canada +1 438 809 7799 Canada 855 703 8985 Canada Toll-free Meeting ID: 100 511 909 Find your local number: https://zoom.us/u/acBVrM6HWR


getattribute() call on GPU

Nicolas Guiard
 

Hi,

We are currently trying to make getattribute() calls work on GPU with OptiX 7.3 and OSL 1.11.9.0 but we are facing an issue.
We've implemented the osl_get_attribute() callback in cuda and it's called properly. But as soon as we try to access the content of the attribute type, we get an illegal memory access.

Here's the implementation of osl_get_attribute for our test:
__device__
int osl_get_attribute(void *sg_, int dest_derivs, void *obj_name_, void *attr_name_, int array_lookup, int index, const void *attr_type, void *attr_dest)
{
    float *f = reinterpret_cast<float *>(attr_dest);
    if (attr_type == nullptr) {
        f[0] = 0.5f;
        f[1] = 0.5f;
        f[2] = 0.5f;
        return 1;
    }
    const OSL::TypeDesc& type = *(const OSL::TypeDesc *)attr_type;
    f[0] = type.basetype;
    f[1] = type.aggregate;
    f[2] = type.vecsemantics;

    return 1;
}

If we remove the lines in bold red and replace them by the following ones, it works just fine:
    f[0] = 1.0f;
    f[1] = 0.5f;
    f[2] = 0.0f;

In our test, we have a simple shader doing this:
surface attrtest()
{
    color c;
    getattribute("foo", c);
    Ci = c * emission();
}

And here's the generated PTX code:
//
// Generated by LLVM NVPTX Back-End
//
.version 5.0
.target sm_35
.address_size 64
// .globl __direct_callable__group_unnamed_group_3_3_init
.extern .func  (.param .b32 func_retval0) osl_get_attribute
(
.param .b64 osl_get_attribute_param_0,
.param .b32 osl_get_attribute_param_1,
.param .b64 osl_get_attribute_param_2,
.param .b64 osl_get_attribute_param_3,
.param .b32 osl_get_attribute_param_4,
.param .b32 osl_get_attribute_param_5,
.param .b64 osl_get_attribute_param_6,
.param .b64 osl_get_attribute_param_7
)
;
.extern .func  (.param .b64 func_retval0) osl_allocate_weighted_closure_component
(
.param .b64 osl_allocate_weighted_closure_component_param_0,
.param .b32 osl_allocate_weighted_closure_component_param_1,
.param .b32 osl_allocate_weighted_closure_component_param_2,
.param .b64 osl_allocate_weighted_closure_component_param_3
)
;
.extern .global .align 8 .u64 ds_555c6f602f9383e3_0003;
.visible .func __direct_callable__group_unnamed_group_3_3_init(
.param .b64 __direct_callable__group_unnamed_group_3_3_init_param_0,
.param .b64 __direct_callable__group_unnamed_group_3_3_init_param_1
)
{

ret;
}
// .globl __direct_callable__unnamed_group_3_build___project_scene_attrtest_4
.visible .func __direct_callable__unnamed_group_3_build___project_scene_attrtest_4(
.param .b64 __direct_callable__unnamed_group_3_build___project_scene_attrtest_4_param_0,
.param .b64 __direct_callable__unnamed_group_3_build___project_scene_attrtest_4_param_1
)
{
.local .align 8 .b8 __local_depot1[16];
.reg .b64 %SP;
.reg .b64 %SPL;
.reg .pred %p<2>;
.reg .b16 %rs<2>;
.reg .b32 %r<6>;
.reg .b64 %rd<8>;
mov.u64 %SPL, __local_depot1;
cvta.local.u64 %SP, %SPL;
ld.param.u64 %rd2, [__direct_callable__unnamed_group_3_build___project_scene_attrtest_4_param_0];
ld.global.u64 %rd3, [ds_555c6f602f9383e3_0003];
mov.u64 %rd4, 0;
mov.u32 %r1, 0;
mov.u64 %rd5, 140457662007856;
add.u64 %rd6, %SP, 0;
{ // callseq 0, 0
.reg .b32 temp_param_reg;
.param .b64 param0;
st.param.b64 [param0+0], %rd2;
.param .b32 param1;
st.param.b32 [param1+0], %r1;
.param .b64 param2;
st.param.b64 [param2+0], %rd4;
.param .b64 param3;
st.param.b64 [param3+0], %rd3;
.param .b32 param4;
st.param.b32 [param4+0], %r1;
.param .b32 param5;
st.param.b32 [param5+0], %r2;
.param .b64 param6;
st.param.b64 [param6+0], %rd5;
.param .b64 param7;
st.param.b64 [param7+0], %rd6;
.param .b32 retval0;
call.uni (retval0),
osl_get_attribute,
(
param0,
param1,
param2,
param3,
param4,
param5,
param6,
param7
);
ld.param.b32 %r3, [retval0+0];
} // callseq 0
mov.u32 %r5, 1;
{ // callseq 1, 0
.reg .b32 temp_param_reg;
.param .b64 param0;
st.param.b64 [param0+0], %rd2;
.param .b32 param1;
st.param.b32 [param1+0], %r5;
.param .b32 param2;
st.param.b32 [param2+0], %r5;
.param .b64 param3;
st.param.b64 [param3+0], %rd6;
.param .b64 retval0;
call.uni (retval0),
osl_allocate_weighted_closure_component,
(
param0,
param1,
param2,
param3
);
ld.param.b64 %rd7, [retval0+0];
} // callseq 1
setp.eq.s64 %p1, %rd7, 0;
@%p1 bra LBB1_2;
mov.u16 %rs1, 0;
st.u8 [%rd7+16], %rs1;
LBB1_2:
st.u64 [%rd2+272], %rd7;
ret;
}

As we can see in bold red in the generated code, the address of the type is a constant value and this value changes at each execution. Is there something we are not configuring properly or is it a bug?

Thanks in advance for any help on this!

Cheers

Face
Nicolas Guiard
Head of R&D
Phone+33 972 452 846
Isotropix
LinkedIn YouTube Facebook Twitter

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed.


Release: OSL 1.11.15.0

Larry Gritz
 

Happy monthly release day!

We have tagged "v1.11.15.0" and moved the "release" branch marker to that position. This is the latest supported production release of OSL. It guarantees API, ABI, and link back-compatibility compared to prior releases in the 1.11 family. Release notes are below:


Release 1.11.15.0 -- 1 Sep 2021 (compared to 1.11.14.2)
-------------------------------------------------------
* Changes for compatibility with OpenImageIO 2.3. #1393 #1388
* Fix potential crashes (or at least undefined behavior) due to missing
virtual destructor of internal Symbol type. #1397

--
Larry Gritz
lg@...


Re: OCIOv2 with OSL native support, part III

Larry Gritz
 

On Aug 31, 2021, at 10:29 AM, Patrick Hodoul <patrick.hodoul@...> wrote:

Does the tag 'v1.11.14.2' represent the last official version?

Yes, and also there is a branch called "release" that at all times points to the latest supported release. (We move the branch marker whenever we tag releases.)


What about the input parameter which is also a color4 ?
Should I have two input parameters (like for the output parameter)?

Yes, exactly. From the point of view of a program using the ShadingSystem API), a struct is really just one variable for each field of the struct.

--
Larry Gritz





Re: OCIOv2 with OSL native support, part III

Patrick Hodoul
 

Thanks for the fast answers.

First, please note that the SymLocation stuff is very hot off the presses, and only is present in OSL master, not yet in any officially supported release.
Does the tag 'v1.11.14.2' represent the last official version?

But anyway, a color4 is not a real type (yet), it's a struct, so the implementation underneath is that there are two variables: "color4 mycolor" really just gets turned into "color mycolor.rgb" and "float mycolor.a". You can from the C++ side treat them as the two individual variables.
What about the input parameter which is also a color4 ?
Should I have two input parameters (like for the output parameter)?

--
Patrick


OCIOv2 with OSL native support, part IV, comment or discussion

Patrick Hodoul
 
Edited

Hi,

The post is not a question but a comment on the current implementation in OSL of the color mgt support.  I faced a problem when developing the OSL unit test framework for OCIO, and I want to share what I found, some comments and perhaps a potential solution.

When run the OCIOv2 OSL unit test, it crashes if the OCIO env. variable is defined.

The problem originates from:
-> my main program creates "OSL::ShadingSystem"
---> creating "OSL::ShadingSystemImpl"
------> creating "OSL::OCIOColorSystem"
---------> creating "OIIO::ColorConfig" which load the config pointed by the OCIO env. variable

The problem is that OIIO is embedding OCIOv1 which cannot read an OCIOv2 config. That's the perfect example to illustrate Larry concerns about cyclic dependencies. I would also say that having an hidden dependency is problematic.

My comments are:
  • Why creating a OSL::OCIOColorSystem instance by default?  The code could delay the creation on the first request.
    • Cons - It will introduce a performance hit somewhere else!
    • Pros - It will do nothing if color mgt is never used.
  • There is no error handling i.e. OCIO throws an exception if the config is faulty, wrong version, etc. The OSL & OIIO layers must handle OCIO exceptions.
  • I think it highlights that the color mgt in OSL must be decoupled from OIIO, and only called on explicit demand.

Hoping it will help to improve OSL and / or OIIO and ultimately the OCIOv2 unit test framework :)
Patrick


Re: OCIOv2 with OSL native support, part III

Larry Gritz
 

First, please note that the SymLocation stuff is very hot off the presses, and only is present in OSL master, not yet in any officially supported release.

It may be better to use the older find_symbol/symbol_address approach -- which you can see commented out in master's osldeformer example. That will work for released versions of OSL.

But anyway, a color4 is not a real type (yet), it's a struct, so the implementation underneath is that there are two variables: "color4 mycolor" really just gets turned into "color mycolor.rgb" and "float mycolor.a". You can from the C++ side treat them as the two individual variables.


On Aug 31, 2021, at 6:48 AM, Patrick Hodoul <patrick.hodoul@...> wrote:

HI,

That's again the OCIOv2 generating an OSL shader code related topic. Now I currently implement the corresponding OSL unit test framework in OCIO, and unfortunately I face some execution problems.

To have some context, the OSL shader declaration is:
shader OSL_OCIOMain(color4 inColor = {color(0), 1}, output color4 outColor = {color(0), 1})

And my framework mainly copies & pastes the [osl]/testsuite/example-deformer/osldeformer.cpp unit test.

The output parameter declaration is causing some trouble. The code snippet is:
<...>
OSL::SymLocationDesc outputs("layer1.outColor", OIIO::TypeFloat4, false,
                                 OSL::SymArena::Outputs,
                                 0 /* output arena offset of "out" */,
                                 sizeof(OSL::Vec4) /* point to point stride */);
    shadsys->add_symlocs(mygroup.get(), outputs);
<...>
    shadsys->optimize_group(mygroup.get(), ctx);
    const OSL::ShaderSymbol * outsym
        = shadsys->find_symbol(*mygroup.get(), OSL::ustring("layer1"), OSL::ustring("outColor"));
When the unit test runs, "shadsys->optimize_group()" generates the following outputs (from llvm_instance.cpp:1138):

No output copy for struct vector4 outColor because of type mismatch vs symloc=float4

There is a mismatch between the OSL C++ declaration and the OSL shader declaration (structure vs. type). As I used the 'color4' for the input and output variables of the shader, I found nothing equivalent in OSL C++ & OIIO C++ types so, I switched to OIIO::TypeFloat4 and OSL::Vec4. But that's clearly not the right choice.

What should be the declared types (for C++ OSL & OIIO) to match the shader 'color4' type (which is a structure containing a color and a float) ?

Thanks,
Patrick <UnitTestOSL.cpp>

--
Larry Gritz





OCIOv2 with OSL native support, part III

Patrick Hodoul
 

HI,

That's again the OCIOv2 generating an OSL shader code related topic. Now I currently implement the corresponding OSL unit test framework in OCIO, and unfortunately I face some execution problems.

To have some context, the OSL shader declaration is:
shader OSL_OCIOMain(color4 inColor = {color(0), 1}, output color4 outColor = {color(0), 1})

And my framework mainly copies & pastes the [osl]/testsuite/example-deformer/osldeformer.cpp unit test.

The output parameter declaration is causing some trouble. The code snippet is:
<...>
OSL::SymLocationDesc outputs("layer1.outColor", OIIO::TypeFloat4, false,
                                 OSL::SymArena::Outputs,
                                 0 /* output arena offset of "out" */,
                                 sizeof(OSL::Vec4) /* point to point stride */);
    shadsys->add_symlocs(mygroup.get(), outputs);
<...>
    shadsys->optimize_group(mygroup.get(), ctx);
    const OSL::ShaderSymbol * outsym
        = shadsys->find_symbol(*mygroup.get(), OSL::ustring("layer1"), OSL::ustring("outColor"));
When the unit test runs, "shadsys->optimize_group()" generates the following outputs (from llvm_instance.cpp:1138):

No output copy for struct vector4 outColor because of type mismatch vs symloc=float4

There is a mismatch between the OSL C++ declaration and the OSL shader declaration (structure vs. type). As I used the 'color4' for the input and output variables of the shader, I found nothing equivalent in OSL C++ & OIIO C++ types so, I switched to OIIO::TypeFloat4 and OSL::Vec4. But that's clearly not the right choice.

What should be the declared types (for C++ OSL & OIIO) to match the shader 'color4' type (which is a structure containing a color and a float) ?

Thanks,
Patrick


Event: OSL TSC meeting ( every other week ) - 09/02/2021 #cal-reminder

osl-dev@lists.aswf.io Calendar <noreply@...>
 

Reminder: OSL TSC meeting ( every other week )

When:
09/02/2021
2:00pm to 3:00pm
(UTC-07:00) America/Los Angeles

Where:
https://zoom.us/j/100511909

Organizer: Chris Kulla ckulla@...

View Event

Description:

Every other week meeting of the OSL TSC.

Meeting Agenda / Notes: https://docs.google.com/document/d/1yf0bG6eoE2EvKZBNZX3nskdTvu99ADTDTNOknCDJd1I/

Confirm this meeting invite is still valid by finding the meeting at https://lists.aswf.io/calendar.

Join Zoom Meeting https://zoom.us/j/100511909

Meeting ID: 100 511 909

One tap mobile +16465588656,,100511909# US (New York) +13126266799,,100511909# US (Chicago)

Dial by your location +1 646 558 8656 US (New York) +1 312 626 6799 US (Chicago) +1 669 900 6833 US (San Jose) +1 253 215 8782 US +1 301 715 8592 US +1 346 248 7799 US (Houston) 877 369 0926 US Toll-free 855 880 1246 US Toll-free +1 587 328 1099 Canada +1 647 374 4685 Canada +1 647 558 0588 Canada +1 778 907 2071 Canada +1 438 809 7799 Canada 855 703 8985 Canada Toll-free Meeting ID: 100 511 909 Find your local number: https://zoom.us/u/acBVrM6HWR


Upcoming Events #cal-summary

osl-dev@lists.aswf.io Calendar <osl-dev@...>
 

Open Shading Language discussion list Upcoming Events

OSL TSC meeting ( every other week )

When:
Thursday, September 2, 2021, 2:00pm to 3:00pm
(GMT-07:00) America/Los Angeles

Where:
https://zoom.us/j/100511909

Organizer: Chris Kulla ckulla@...

Details:

Every other week meeting of the OSL TSC.

Meeting Agenda / Notes: https://docs.google.com/document/d/1yf0bG6eoE2EvKZBNZX3nskdTvu99ADTDTNOknCDJd1I/

Confirm this meeting invite is still valid by finding the meeting at https://lists.aswf.io/calendar.

Join Zoom Meeting https://zoom.us/j/100511909

Meeting ID: 100 511 909

One tap mobile +16465588656,,100511909# US (New York) +13126266799,,100511909# US (Chicago)

Dial by your location +1 646 558 8656 US (New York) +1 312 626 6799 US (Chicago) +1 669 900 6833 US (San Jose) +1 253 215 8782 US +1 301 715 8592 US +1 346 248 7799 US (Houston) 877 369 0926 US Toll-free 855 880 1246 US Toll-free +1 587 328 1099 Canada +1 647 374 4685 Canada +1 647 558 0588 Canada +1 778 907 2071 Canada +1 438 809 7799 Canada 855 703 8985 Canada Toll-free Meeting ID: 100 511 909 Find your local number: https://zoom.us/u/acBVrM6HWR

View Event


OSL TSC meeting ( every other week )

When:
Thursday, September 16, 2021, 2:00pm to 3:00pm
(GMT-07:00) America/Los Angeles

Where:
https://zoom.us/j/100511909

Organizer: Chris Kulla ckulla@...

Details:

Every other week meeting of the OSL TSC.

Meeting Agenda / Notes: https://docs.google.com/document/d/1yf0bG6eoE2EvKZBNZX3nskdTvu99ADTDTNOknCDJd1I/

Confirm this meeting invite is still valid by finding the meeting at https://lists.aswf.io/calendar.

Join Zoom Meeting https://zoom.us/j/100511909

Meeting ID: 100 511 909

One tap mobile +16465588656,,100511909# US (New York) +13126266799,,100511909# US (Chicago)

Dial by your location +1 646 558 8656 US (New York) +1 312 626 6799 US (Chicago) +1 669 900 6833 US (San Jose) +1 253 215 8782 US +1 301 715 8592 US +1 346 248 7799 US (Houston) 877 369 0926 US Toll-free 855 880 1246 US Toll-free +1 587 328 1099 Canada +1 647 374 4685 Canada +1 647 558 0588 Canada +1 778 907 2071 Canada +1 438 809 7799 Canada 855 703 8985 Canada Toll-free Meeting ID: 100 511 909 Find your local number: https://zoom.us/u/acBVrM6HWR

View Event


OSL TSC meeting ( every other week )

When:
Thursday, September 30, 2021, 2:00pm to 3:00pm
(GMT-07:00) America/Los Angeles

Where:
https://zoom.us/j/100511909

Organizer: Chris Kulla ckulla@...

Details:

Every other week meeting of the OSL TSC.

Meeting Agenda / Notes: https://docs.google.com/document/d/1yf0bG6eoE2EvKZBNZX3nskdTvu99ADTDTNOknCDJd1I/

Confirm this meeting invite is still valid by finding the meeting at https://lists.aswf.io/calendar.

Join Zoom Meeting https://zoom.us/j/100511909

Meeting ID: 100 511 909

One tap mobile +16465588656,,100511909# US (New York) +13126266799,,100511909# US (Chicago)

Dial by your location +1 646 558 8656 US (New York) +1 312 626 6799 US (Chicago) +1 669 900 6833 US (San Jose) +1 253 215 8782 US +1 301 715 8592 US +1 346 248 7799 US (Houston) 877 369 0926 US Toll-free 855 880 1246 US Toll-free +1 587 328 1099 Canada +1 647 374 4685 Canada +1 647 558 0588 Canada +1 778 907 2071 Canada +1 438 809 7799 Canada 855 703 8985 Canada Toll-free Meeting ID: 100 511 909 Find your local number: https://zoom.us/u/acBVrM6HWR

View Event


Event: OSL TSC meeting ( every other week ) - 09/02/2021 #cal-reminder

osl-dev@lists.aswf.io Calendar <noreply@...>
 

Reminder: OSL TSC meeting ( every other week )

When:
09/02/2021
2:00pm to 3:00pm
(UTC-07:00) America/Los Angeles

Where:
https://zoom.us/j/100511909

Organizer: Chris Kulla ckulla@...

View Event

Description:

Every other week meeting of the OSL TSC.

Meeting Agenda / Notes: https://docs.google.com/document/d/1yf0bG6eoE2EvKZBNZX3nskdTvu99ADTDTNOknCDJd1I/

Confirm this meeting invite is still valid by finding the meeting at https://lists.aswf.io/calendar.

Join Zoom Meeting https://zoom.us/j/100511909

Meeting ID: 100 511 909

One tap mobile +16465588656,,100511909# US (New York) +13126266799,,100511909# US (Chicago)

Dial by your location +1 646 558 8656 US (New York) +1 312 626 6799 US (Chicago) +1 669 900 6833 US (San Jose) +1 253 215 8782 US +1 301 715 8592 US +1 346 248 7799 US (Houston) 877 369 0926 US Toll-free 855 880 1246 US Toll-free +1 587 328 1099 Canada +1 647 374 4685 Canada +1 647 558 0588 Canada +1 778 907 2071 Canada +1 438 809 7799 Canada 855 703 8985 Canada Toll-free Meeting ID: 100 511 909 Find your local number: https://zoom.us/u/acBVrM6HWR


Re: Cycles in the shader graph

bbannayan@...
 

This definitely can be handled on the DCC end but it's cumbersome to do so since I'm working in a context where I will be making continuous edits and these "utility" nodes may or may not exist or have different types/parameters depending on the context.  I was hoping to find a way to output the graph once but interact with the parameters in only one place (the OSL node that is one-to-one with a Maya node, in this case) and let the OSL graph sort out the rest.

After further reflection and discussion I think this may be related to Zap's request for callable shaders but in a far more constrained form.  What I'm trying to do is offload some small blocks of work to other shaders.  I *could* (currently do) use includes and directly called functions for this work but every time these utility shaders change it requires compiling everything.

What I really want to do is to be able to call my little utility shaders from inside another shader and have the oso loaded and executed at that time.

The big difference with what I'm doing vs what Zap was proposing is that that there's no need of "globals".. everything needed by the shader/function is passed in. (though maybe I'm making undue assumptions about what happens behind the scenes in a "texture()" call?).

 

So my earlier example could be reduced to something like this.

surface

A(float diff = 1,
  string diff_tex = "",
  float st[2] = { 0.0, 0.0 })
)

{

  float diff_value;

  execute("B.oso", value, diff_tex, diff_value, st);

  Ci = diff_value * diffuse(N);

}

 
 

shader

B(float value = 1,

  string tex = "",

  output float out = 1,

  float st[2] = { 0.0, 0.0 })

{

  out = value * texture(tex, st[0], st[1]);

}

Basically a callable shader that's outside the node graph.  Just loaded and executed right there with only the data that's passed in.  The main downside is that now my choice of the "B.oso" to execute is hard coded in my shader rather than my being able to select it at scene translation time, though there are definitely ways around this too.

 

I'm not sure that this side steps any of the technical issues you outline.. but it's definitely a different working method that takes the problem away from the scene graph.

Berj


On Tue, Aug 17, 2021 at 11:21 PM, Larry Gritz wrote:

So, underneath, it's really all flattened to just a simple list of shaders in the group (that's why we sometimes call them "layers"). Connections can only go from outputs of earlier numbered layers to inputs of later numbered layers. Thus, there are no cycles in the graph.
 
I think I understand what you're getting at here. You don't need the shader to execute cyclically, you just want to, essentially, make a single value supply both an input to one shader node and also supply the default value of the output of another shader (which happens to be later in the layer list).
 
But you're imaging kind of a special case where it's all simple. In general, there are a lot of complications. For one thing, the value of output parameters (even for their default values) aren't stored in those variables until the node runs. And some parameters get their values in particularly complicated ways (like interpolated vertex values). Also, the order that nodes are evaluated more complex than the flat list implies, because we actually do it lazily (layers are run out of order, if and when only when their results are needed). So it would be a lot of additional logical complexity to allow what you're suggesting -- and ensuring it was correct for all these corner cases.
 
It feels like... maybe your problem can be handled outside of OSL, at the level where you are specifying the shader group to OSL in the first place? You want the same value to end up a few different places, so maybe there's some logic in the material assignment or something where it can ensure that this happens, without needing to explicitly tell OSL that these nodes are connected in that odd way?
 
-- lg


Re: clang: error: cannot find libdevice for sm_75. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.

Brecht Van Lommel
 

I think you hit this issue in clang: https://reviews.llvm.org/D89752

Also note nvidia-smi shows the CUDA driver API version, it's not the CUDA toolkit version. But both seem to be 11.4 in this case.


On Tue, Aug 24, 2021 at 10:11 PM Pei JIA <jiapei@...> wrote:


There is ONLY one version of cuda, from what I can see ....


➜  local pwd
/usr/local
➜  local ll
total 328K
drwxr-xr-x   2 root root 4.0K Jun  9 21:34 assets
drwxr-xr-x   4 root root  36K Aug 23 19:39 bin
-rw-r--r--   1 root root 6.0K Jun  8 20:14 CHANGES
lrwxrwxrwx   1 root root   21 Aug  5 23:00 cuda -> /usr/local/cuda-11.4/
drwxr-xr-x  20 root root 4.0K Aug 23 15:41 cuda-11.4
drwxr-xr-x   2 root root 4.0K Jun  5 12:30 Doc
drwxr-xr-x   3 root root 4.0K Jun  9 21:34 doc
drwxr-xr-x   3 root root 4.0K Jun  9 06:42 docs
drwxr-xr-x   6 root root 4.0K Jun 10 14:48 etc
drwxr-xr-x   5 root root 4.0K Jul 29 19:30 Ext
drwxr-xr-x   2 root root 4.0K Jul 31  2020 games
drwxr-xr-x   9 root root 4.0K Jun  8 20:17 if
drwxr-xr-x 145 root root  12K Aug 23 19:39 include
-rw-r--r--   1 root root  337 Jun  8 20:14 INSTALL
drwxr-xr-x  28 root root 148K Aug 23 19:39 lib
drwxr-xr-x   3 root root 4.0K Jul 13 13:45 lib32
drwxr-xr-x   3 root root 4.0K Jul 13 13:45 lib64
drwxr-xr-x   3 root root 4.0K Aug 23 15:09 libdata
drwxr-xr-x   3 root root 4.0K Aug 23 15:15 libexec
drwxr-xr-x   4 root root 4.0K Jun  5 12:30 library
-rw-r--r--   1 root root 5.4K May  2 04:59 License_ReadMe.txt
drwxr-xr-x   2 root root 4.0K Jun  5 12:30 licenses
drwxr-xr-x   3 root root 4.0K Jun  5 12:30 log
drwxr-xr-x   4 root root 4.0K Jul 25 00:21 magma
lrwxrwxrwx   1 root root    9 Nov  9  2020 man -> share/man
drwxr-xr-x  31 root root 4.0K Jul 29 19:30 Mod
-rw-r--r--   1 root root 5.0K Jun  8 20:14 README
drwxr-xr-x   2 root root 4.0K Jul 31  2020 sbin
drwxr-xr-x   2 root root 4.0K Jun  9 21:34 scripts
drwxr-xr-x 109 root root 4.0K Aug 23 19:39 share
drwxr-xr-x   2 root root 4.0K Jul 31  2020 src
drwxr-xr-x   3 root root 4.0K Jul 19 13:49 var
drwxr-xr-x   3 root root 4.0K Jun  5 12:30 xml
➜  local





On 2021-08-23 10:51 p.m., Larry Gritz wrote:
You say you have Cuda 11.4, but the error message says:

error: GPU arch sm_75 is supported by CUDA versions between 10.0 and 11.0 (inclusive), but installation at /usr/local/cuda is 7.0. 

Maybe you have multiple cuda versions installed?

I think that when you first configure the cmake build, you can use -DCUDA_TOOLKIT_ROOT_DIR=... to point it at a particular Cuda install.
 

On Aug 23, 2021, at 10:28 PM, Pei JIA <jiapei@...> wrote:


Hi, all:


I failed to build current OpenShadingLanguage master branch with the following ERROR messages:



[ 18%] Generating simplexnoise_cuda.bc
cd ....../OpenShadingLanguage/src/liboslexec && /usr/lib/llvm-11/bin/clang++ -I/usr/local/cuda/include -I/usr/local/cuda/include -I....../OpenShadingLanguage/src/liboslexec -I....../OpenShadingLanguage/build/include -I....../OpenShadingLanguage/src/include -I....../OpenShadingLanguage/src/cuda_common -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -DOSL_FAST_MATH=1 -DOSL_USE_OPTIX=1 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DOSL_LLVM_VERSION=110 -DOSL_LLVM_FULL_VERSION="11.0.0" -Dosoparse=OSL_v1_12_3_osoparse -Doslparse=OSL_v1_12_3_oslparse -std=c++14 -DOSL_FAST_MATH=1 -DOSL_USE_OPTIX=1 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DOSL_LLVM_VERSION=110 -DOSL_LLVM_FULL_VERSION="11.0.0" -Dosoparse=OSL_v1_12_3_osoparse -Doslparse=OSL_v1_12_3_oslparse -DOSL_LLVM_CUDA_BITCODE -std=c++14 --cuda-path=/usr/local/cuda -D__CUDACC__ -DOSL_COMPILING_TO_BITCODE=1 -DNDEBUG -DOIIO_NO_SSE -D__CUDADEVRT_INTERNAL__ --language=cuda --cuda-device-only --cuda-gpu-arch=sm_75 -Wno-deprecated-register -Wno-format-security -O3 -fno-math-errno -ffast-math -S -emit-llvm ../liboslnoise/simplexnoise.cpp -o ....../OpenShadingLanguage/build/src/liboslexec/simplexnoise_cuda.s
clang: error: cannot find libdevice for sm_75. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.
clang: error: GPU arch sm_75 is supported by CUDA versions between 10.0 and 11.0 (inclusive), but installation at /usr/local/cuda is 7.0. Use --cuda-path to specify a different CUDA install, pass a different GPU arch with --cuda-gpu-arch, or pass --no-cuda-version-check.
make[2]: *** [src/liboslexec/CMakeFiles/oslexec.dir/build.make:692: src/liboslexec/simplexnoise_cuda.bc] Error 1
make[2]: Leaving directory '....../OpenShadingLanguage/build'
make[1]: *** [CMakeFiles/Makefile2:1307: src/liboslexec/CMakeFiles/oslexec.dir/all] Error 2
make[1]: Leaving directory '....../OpenShadingLanguage/build'
make: *** [Makefile:169: all] Error 2
➜  build git:(master) ccmake ../


Can anybody give me a hand please?


  • My environments:
    • OS: Ubuntu 20.04
    • GCC: 10.3.1
    • GPU: Geforce 2080 Ti
    • NVIDIA Driver: 470.63.01
    • CUDA: 11.4


Thank you...


--
Dr. Pei Jia
CTO of Longer Vision Technology (Canada) Ltd.
Email: jiapei@...
Cell Number: +1 778-863-5816

--
Larry Gritz




--
Dr. Pei Jia
CTO of Longer Vision Technology (Canada) Ltd.
Email: jiapei@...
Cell Number: +1 778-863-5816


Re: clang: error: cannot find libdevice for sm_75. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.

Pei JIA
 


There is ONLY one version of cuda, from what I can see ....


➜  local pwd
/usr/local
➜  local ll
total 328K
drwxr-xr-x   2 root root 4.0K Jun  9 21:34 assets
drwxr-xr-x   4 root root  36K Aug 23 19:39 bin
-rw-r--r--   1 root root 6.0K Jun  8 20:14 CHANGES
lrwxrwxrwx   1 root root   21 Aug  5 23:00 cuda -> /usr/local/cuda-11.4/
drwxr-xr-x  20 root root 4.0K Aug 23 15:41 cuda-11.4
drwxr-xr-x   2 root root 4.0K Jun  5 12:30 Doc
drwxr-xr-x   3 root root 4.0K Jun  9 21:34 doc
drwxr-xr-x   3 root root 4.0K Jun  9 06:42 docs
drwxr-xr-x   6 root root 4.0K Jun 10 14:48 etc
drwxr-xr-x   5 root root 4.0K Jul 29 19:30 Ext
drwxr-xr-x   2 root root 4.0K Jul 31  2020 games
drwxr-xr-x   9 root root 4.0K Jun  8 20:17 if
drwxr-xr-x 145 root root  12K Aug 23 19:39 include
-rw-r--r--   1 root root  337 Jun  8 20:14 INSTALL
drwxr-xr-x  28 root root 148K Aug 23 19:39 lib
drwxr-xr-x   3 root root 4.0K Jul 13 13:45 lib32
drwxr-xr-x   3 root root 4.0K Jul 13 13:45 lib64
drwxr-xr-x   3 root root 4.0K Aug 23 15:09 libdata
drwxr-xr-x   3 root root 4.0K Aug 23 15:15 libexec
drwxr-xr-x   4 root root 4.0K Jun  5 12:30 library
-rw-r--r--   1 root root 5.4K May  2 04:59 License_ReadMe.txt
drwxr-xr-x   2 root root 4.0K Jun  5 12:30 licenses
drwxr-xr-x   3 root root 4.0K Jun  5 12:30 log
drwxr-xr-x   4 root root 4.0K Jul 25 00:21 magma
lrwxrwxrwx   1 root root    9 Nov  9  2020 man -> share/man
drwxr-xr-x  31 root root 4.0K Jul 29 19:30 Mod
-rw-r--r--   1 root root 5.0K Jun  8 20:14 README
drwxr-xr-x   2 root root 4.0K Jul 31  2020 sbin
drwxr-xr-x   2 root root 4.0K Jun  9 21:34 scripts
drwxr-xr-x 109 root root 4.0K Aug 23 19:39 share
drwxr-xr-x   2 root root 4.0K Jul 31  2020 src
drwxr-xr-x   3 root root 4.0K Jul 19 13:49 var
drwxr-xr-x   3 root root 4.0K Jun  5 12:30 xml
➜  local





On 2021-08-23 10:51 p.m., Larry Gritz wrote:
You say you have Cuda 11.4, but the error message says:

error: GPU arch sm_75 is supported by CUDA versions between 10.0 and 11.0 (inclusive), but installation at /usr/local/cuda is 7.0. 

Maybe you have multiple cuda versions installed?

I think that when you first configure the cmake build, you can use -DCUDA_TOOLKIT_ROOT_DIR=... to point it at a particular Cuda install.
 

On Aug 23, 2021, at 10:28 PM, Pei JIA <jiapei@...> wrote:


Hi, all:


I failed to build current OpenShadingLanguage master branch with the following ERROR messages:



[ 18%] Generating simplexnoise_cuda.bc
cd ....../OpenShadingLanguage/src/liboslexec && /usr/lib/llvm-11/bin/clang++ -I/usr/local/cuda/include -I/usr/local/cuda/include -I....../OpenShadingLanguage/src/liboslexec -I....../OpenShadingLanguage/build/include -I....../OpenShadingLanguage/src/include -I....../OpenShadingLanguage/src/cuda_common -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -DOSL_FAST_MATH=1 -DOSL_USE_OPTIX=1 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DOSL_LLVM_VERSION=110 -DOSL_LLVM_FULL_VERSION="11.0.0" -Dosoparse=OSL_v1_12_3_osoparse -Doslparse=OSL_v1_12_3_oslparse -std=c++14 -DOSL_FAST_MATH=1 -DOSL_USE_OPTIX=1 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DOSL_LLVM_VERSION=110 -DOSL_LLVM_FULL_VERSION="11.0.0" -Dosoparse=OSL_v1_12_3_osoparse -Doslparse=OSL_v1_12_3_oslparse -DOSL_LLVM_CUDA_BITCODE -std=c++14 --cuda-path=/usr/local/cuda -D__CUDACC__ -DOSL_COMPILING_TO_BITCODE=1 -DNDEBUG -DOIIO_NO_SSE -D__CUDADEVRT_INTERNAL__ --language=cuda --cuda-device-only --cuda-gpu-arch=sm_75 -Wno-deprecated-register -Wno-format-security -O3 -fno-math-errno -ffast-math -S -emit-llvm ../liboslnoise/simplexnoise.cpp -o ....../OpenShadingLanguage/build/src/liboslexec/simplexnoise_cuda.s
clang: error: cannot find libdevice for sm_75. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.
clang: error: GPU arch sm_75 is supported by CUDA versions between 10.0 and 11.0 (inclusive), but installation at /usr/local/cuda is 7.0. Use --cuda-path to specify a different CUDA install, pass a different GPU arch with --cuda-gpu-arch, or pass --no-cuda-version-check.
make[2]: *** [src/liboslexec/CMakeFiles/oslexec.dir/build.make:692: src/liboslexec/simplexnoise_cuda.bc] Error 1
make[2]: Leaving directory '....../OpenShadingLanguage/build'
make[1]: *** [CMakeFiles/Makefile2:1307: src/liboslexec/CMakeFiles/oslexec.dir/all] Error 2
make[1]: Leaving directory '....../OpenShadingLanguage/build'
make: *** [Makefile:169: all] Error 2
➜  build git:(master) ccmake ../


Can anybody give me a hand please?


  • My environments:
    • OS: Ubuntu 20.04
    • GCC: 10.3.1
    • GPU: Geforce 2080 Ti
    • NVIDIA Driver: 470.63.01
    • CUDA: 11.4


Thank you...


--
Dr. Pei Jia
CTO of Longer Vision Technology (Canada) Ltd.
Email: jiapei@...
Cell Number: +1 778-863-5816

--
Larry Gritz




--
Dr. Pei Jia
CTO of Longer Vision Technology (Canada) Ltd.
Email: jiapei@...
Cell Number: +1 778-863-5816


Re: clang: error: cannot find libdevice for sm_75. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.

Larry Gritz
 

I think all that shows is that the first "nvidia-smi" in your PATH is the one that is from Cuda 11.4, so it's showing you what it knows. I doubt that nvidia-smi comprehensively searches your entire system for all possible Cuda installs.

So I don't think we can conclude from this alone that there is not a second install (and in particular, maybe a second set of header files left over from an old version?) that's making our cmake scripts confused. Did you look in /usr/local/cuda, as the error message indicated? What is there?


On Aug 24, 2021, at 10:57 AM, Pei Jia <jiapei@...> wrote:


Nope... I have ONLY Cuda 11.4 installed. Here is the result of **nvidia-smi**.


➜  ~ nvidia-smi
Tue Aug 24 10:57:12 2021      
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.63.01    Driver Version: 470.63.01    CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| 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 ...  Off  | 00000000:21:00.0  On |                  N/A |
|  0%   43C    P5    35W / 300W |    753MiB / 11016MiB |     26%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                              
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1696      G   /usr/lib/xorg/Xorg                102MiB |
|    0   N/A  N/A      2717      G   /usr/lib/xorg/Xorg                378MiB |
|    0   N/A  N/A      2849      G   /usr/bin/gnome-shell               69MiB |
|    0   N/A  N/A     12356      G   ...AAAAAAAAA= --shared-files       88MiB |
|    0   N/A  N/A     25420      G   obs                                40MiB |
|    0   N/A  N/A    916198      G   ...AAAAAAAAA= --shared-files       24MiB |
|    0   N/A  N/A   2152246      G   /proc/self/exe                      9MiB |
+-----------------------------------------------------------------------------+



On 2021-08-23 10:51 p.m., Larry Gritz wrote:
You say you have Cuda 11.4, but the error message says:

error: GPU arch sm_75 is supported by CUDA versions between 10.0 and 11.0 (inclusive), but installation at /usr/local/cuda is 7.0. 

Maybe you have multiple cuda versions installed?

I think that when you first configure the cmake build, you can use -DCUDA_TOOLKIT_ROOT_DIR=... to point it at a particular Cuda install.
 

On Aug 23, 2021, at 10:28 PM, Pei JIA <jiapei@...> wrote:


Hi, all:


I failed to build current OpenShadingLanguage master branch with the following ERROR messages:



[ 18%] Generating simplexnoise_cuda.bc
cd ....../OpenShadingLanguage/src/liboslexec && /usr/lib/llvm-11/bin/clang++ -I/usr/local/cuda/include -I/usr/local/cuda/include -I....../OpenShadingLanguage/src/liboslexec -I....../OpenShadingLanguage/build/include -I....../OpenShadingLanguage/src/include -I....../OpenShadingLanguage/src/cuda_common -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -DOSL_FAST_MATH=1 -DOSL_USE_OPTIX=1 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DOSL_LLVM_VERSION=110 -DOSL_LLVM_FULL_VERSION="11.0.0" -Dosoparse=OSL_v1_12_3_osoparse -Doslparse=OSL_v1_12_3_oslparse -std=c++14 -DOSL_FAST_MATH=1 -DOSL_USE_OPTIX=1 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DOSL_LLVM_VERSION=110 -DOSL_LLVM_FULL_VERSION="11.0.0" -Dosoparse=OSL_v1_12_3_osoparse -Doslparse=OSL_v1_12_3_oslparse -DOSL_LLVM_CUDA_BITCODE -std=c++14 --cuda-path=/usr/local/cuda -D__CUDACC__ -DOSL_COMPILING_TO_BITCODE=1 -DNDEBUG -DOIIO_NO_SSE -D__CUDADEVRT_INTERNAL__ --language=cuda --cuda-device-only --cuda-gpu-arch=sm_75 -Wno-deprecated-register -Wno-format-security -O3 -fno-math-errno -ffast-math -S -emit-llvm ../liboslnoise/simplexnoise.cpp -o ....../OpenShadingLanguage/build/src/liboslexec/simplexnoise_cuda.s
clang: error: cannot find libdevice for sm_75. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.
clang: error: GPU arch sm_75 is supported by CUDA versions between 10.0 and 11.0 (inclusive), but installation at /usr/local/cuda is 7.0. Use --cuda-path to specify a different CUDA install, pass a different GPU arch with --cuda-gpu-arch, or pass --no-cuda-version-check.
make[2]: *** [src/liboslexec/CMakeFiles/oslexec.dir/build.make:692: src/liboslexec/simplexnoise_cuda.bc] Error 1
make[2]: Leaving directory '....../OpenShadingLanguage/build'
make[1]: *** [CMakeFiles/Makefile2:1307: src/liboslexec/CMakeFiles/oslexec.dir/all] Error 2
make[1]: Leaving directory '....../OpenShadingLanguage/build'
make: *** [Makefile:169: all] Error 2
➜  build git:(master) ccmake ../


Can anybody give me a hand please?


  • My environments:
    • OS: Ubuntu 20.04
    • GCC: 10.3.1
    • GPU: Geforce 2080 Ti
    • NVIDIA Driver: 470.63.01
    • CUDA: 11.4


Thank you...


--
Dr. Pei Jia
CTO of Longer Vision Technology (Canada) Ltd.
Email: jiapei@...
Cell Number: +1 778-863-5816

--
Larry Gritz




--
Dr. Pei Jia
CTO of Longer Vision Technology (Canada) Ltd.
Email: jiapei@...
Cell Number: +1 778-863-5816

--
Larry Gritz





Re: clang: error: cannot find libdevice for sm_75. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.

Pei JIA
 


Nope... I have ONLY Cuda 11.4 installed. Here is the result of **nvidia-smi**.


➜  ~ nvidia-smi
Tue Aug 24 10:57:12 2021      
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.63.01    Driver Version: 470.63.01    CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| 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 ...  Off  | 00000000:21:00.0  On |                  N/A |
|  0%   43C    P5    35W / 300W |    753MiB / 11016MiB |     26%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                              
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1696      G   /usr/lib/xorg/Xorg                102MiB |
|    0   N/A  N/A      2717      G   /usr/lib/xorg/Xorg                378MiB |
|    0   N/A  N/A      2849      G   /usr/bin/gnome-shell               69MiB |
|    0   N/A  N/A     12356      G   ...AAAAAAAAA= --shared-files       88MiB |
|    0   N/A  N/A     25420      G   obs                                40MiB |
|    0   N/A  N/A    916198      G   ...AAAAAAAAA= --shared-files       24MiB |
|    0   N/A  N/A   2152246      G   /proc/self/exe                      9MiB |
+-----------------------------------------------------------------------------+



On 2021-08-23 10:51 p.m., Larry Gritz wrote:
You say you have Cuda 11.4, but the error message says:

error: GPU arch sm_75 is supported by CUDA versions between 10.0 and 11.0 (inclusive), but installation at /usr/local/cuda is 7.0. 

Maybe you have multiple cuda versions installed?

I think that when you first configure the cmake build, you can use -DCUDA_TOOLKIT_ROOT_DIR=... to point it at a particular Cuda install.
 

On Aug 23, 2021, at 10:28 PM, Pei JIA <jiapei@...> wrote:


Hi, all:


I failed to build current OpenShadingLanguage master branch with the following ERROR messages:



[ 18%] Generating simplexnoise_cuda.bc
cd ....../OpenShadingLanguage/src/liboslexec && /usr/lib/llvm-11/bin/clang++ -I/usr/local/cuda/include -I/usr/local/cuda/include -I....../OpenShadingLanguage/src/liboslexec -I....../OpenShadingLanguage/build/include -I....../OpenShadingLanguage/src/include -I....../OpenShadingLanguage/src/cuda_common -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -DOSL_FAST_MATH=1 -DOSL_USE_OPTIX=1 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DOSL_LLVM_VERSION=110 -DOSL_LLVM_FULL_VERSION="11.0.0" -Dosoparse=OSL_v1_12_3_osoparse -Doslparse=OSL_v1_12_3_oslparse -std=c++14 -DOSL_FAST_MATH=1 -DOSL_USE_OPTIX=1 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DOSL_LLVM_VERSION=110 -DOSL_LLVM_FULL_VERSION="11.0.0" -Dosoparse=OSL_v1_12_3_osoparse -Doslparse=OSL_v1_12_3_oslparse -DOSL_LLVM_CUDA_BITCODE -std=c++14 --cuda-path=/usr/local/cuda -D__CUDACC__ -DOSL_COMPILING_TO_BITCODE=1 -DNDEBUG -DOIIO_NO_SSE -D__CUDADEVRT_INTERNAL__ --language=cuda --cuda-device-only --cuda-gpu-arch=sm_75 -Wno-deprecated-register -Wno-format-security -O3 -fno-math-errno -ffast-math -S -emit-llvm ../liboslnoise/simplexnoise.cpp -o ....../OpenShadingLanguage/build/src/liboslexec/simplexnoise_cuda.s
clang: error: cannot find libdevice for sm_75. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.
clang: error: GPU arch sm_75 is supported by CUDA versions between 10.0 and 11.0 (inclusive), but installation at /usr/local/cuda is 7.0. Use --cuda-path to specify a different CUDA install, pass a different GPU arch with --cuda-gpu-arch, or pass --no-cuda-version-check.
make[2]: *** [src/liboslexec/CMakeFiles/oslexec.dir/build.make:692: src/liboslexec/simplexnoise_cuda.bc] Error 1
make[2]: Leaving directory '....../OpenShadingLanguage/build'
make[1]: *** [CMakeFiles/Makefile2:1307: src/liboslexec/CMakeFiles/oslexec.dir/all] Error 2
make[1]: Leaving directory '....../OpenShadingLanguage/build'
make: *** [Makefile:169: all] Error 2
➜  build git:(master) ccmake ../


Can anybody give me a hand please?


  • My environments:
    • OS: Ubuntu 20.04
    • GCC: 10.3.1
    • GPU: Geforce 2080 Ti
    • NVIDIA Driver: 470.63.01
    • CUDA: 11.4


Thank you...


--
Dr. Pei Jia
CTO of Longer Vision Technology (Canada) Ltd.
Email: jiapei@...
Cell Number: +1 778-863-5816

--
Larry Gritz




--
Dr. Pei Jia
CTO of Longer Vision Technology (Canada) Ltd.
Email: jiapei@...
Cell Number: +1 778-863-5816


Re: clang: error: cannot find libdevice for sm_75. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.

Larry Gritz
 

You say you have Cuda 11.4, but the error message says:

error: GPU arch sm_75 is supported by CUDA versions between 10.0 and 11.0 (inclusive), but installation at /usr/local/cuda is 7.0. 

Maybe you have multiple cuda versions installed?

I think that when you first configure the cmake build, you can use -DCUDA_TOOLKIT_ROOT_DIR=... to point it at a particular Cuda install.
 

On Aug 23, 2021, at 10:28 PM, Pei JIA <jiapei@...> wrote:


Hi, all:


I failed to build current OpenShadingLanguage master branch with the following ERROR messages:



[ 18%] Generating simplexnoise_cuda.bc
cd ....../OpenShadingLanguage/src/liboslexec && /usr/lib/llvm-11/bin/clang++ -I/usr/local/cuda/include -I/usr/local/cuda/include -I....../OpenShadingLanguage/src/liboslexec -I....../OpenShadingLanguage/build/include -I....../OpenShadingLanguage/src/include -I....../OpenShadingLanguage/src/cuda_common -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -DOSL_FAST_MATH=1 -DOSL_USE_OPTIX=1 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DOSL_LLVM_VERSION=110 -DOSL_LLVM_FULL_VERSION="11.0.0" -Dosoparse=OSL_v1_12_3_osoparse -Doslparse=OSL_v1_12_3_oslparse -std=c++14 -DOSL_FAST_MATH=1 -DOSL_USE_OPTIX=1 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DOSL_LLVM_VERSION=110 -DOSL_LLVM_FULL_VERSION="11.0.0" -Dosoparse=OSL_v1_12_3_osoparse -Doslparse=OSL_v1_12_3_oslparse -DOSL_LLVM_CUDA_BITCODE -std=c++14 --cuda-path=/usr/local/cuda -D__CUDACC__ -DOSL_COMPILING_TO_BITCODE=1 -DNDEBUG -DOIIO_NO_SSE -D__CUDADEVRT_INTERNAL__ --language=cuda --cuda-device-only --cuda-gpu-arch=sm_75 -Wno-deprecated-register -Wno-format-security -O3 -fno-math-errno -ffast-math -S -emit-llvm ../liboslnoise/simplexnoise.cpp -o ....../OpenShadingLanguage/build/src/liboslexec/simplexnoise_cuda.s
clang: error: cannot find libdevice for sm_75. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.
clang: error: GPU arch sm_75 is supported by CUDA versions between 10.0 and 11.0 (inclusive), but installation at /usr/local/cuda is 7.0. Use --cuda-path to specify a different CUDA install, pass a different GPU arch with --cuda-gpu-arch, or pass --no-cuda-version-check.
make[2]: *** [src/liboslexec/CMakeFiles/oslexec.dir/build.make:692: src/liboslexec/simplexnoise_cuda.bc] Error 1
make[2]: Leaving directory '....../OpenShadingLanguage/build'
make[1]: *** [CMakeFiles/Makefile2:1307: src/liboslexec/CMakeFiles/oslexec.dir/all] Error 2
make[1]: Leaving directory '....../OpenShadingLanguage/build'
make: *** [Makefile:169: all] Error 2
➜  build git:(master) ccmake ../


Can anybody give me a hand please?


  • My environments:
    • OS: Ubuntu 20.04
    • GCC: 10.3.1
    • GPU: Geforce 2080 Ti
    • NVIDIA Driver: 470.63.01
    • CUDA: 11.4


Thank you...


--
Dr. Pei Jia
CTO of Longer Vision Technology (Canada) Ltd.
Email: jiapei@...
Cell Number: +1 778-863-5816

--
Larry Gritz





clang: error: cannot find libdevice for sm_75. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.

Pei JIA
 


Hi, all:


I failed to build current OpenShadingLanguage master branch with the following ERROR messages:



[ 18%] Generating simplexnoise_cuda.bc
cd ....../OpenShadingLanguage/src/liboslexec && /usr/lib/llvm-11/bin/clang++ -I/usr/local/cuda/include -I/usr/local/cuda/include -I....../OpenShadingLanguage/src/liboslexec -I....../OpenShadingLanguage/build/include -I....../OpenShadingLanguage/src/include -I....../OpenShadingLanguage/src/cuda_common -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -DOSL_FAST_MATH=1 -DOSL_USE_OPTIX=1 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DOSL_LLVM_VERSION=110 -DOSL_LLVM_FULL_VERSION="11.0.0" -Dosoparse=OSL_v1_12_3_osoparse -Doslparse=OSL_v1_12_3_oslparse -std=c++14 -DOSL_FAST_MATH=1 -DOSL_USE_OPTIX=1 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DOSL_LLVM_VERSION=110 -DOSL_LLVM_FULL_VERSION="11.0.0" -Dosoparse=OSL_v1_12_3_osoparse -Doslparse=OSL_v1_12_3_oslparse -DOSL_LLVM_CUDA_BITCODE -std=c++14 --cuda-path=/usr/local/cuda -D__CUDACC__ -DOSL_COMPILING_TO_BITCODE=1 -DNDEBUG -DOIIO_NO_SSE -D__CUDADEVRT_INTERNAL__ --language=cuda --cuda-device-only --cuda-gpu-arch=sm_75 -Wno-deprecated-register -Wno-format-security -O3 -fno-math-errno -ffast-math -S -emit-llvm ../liboslnoise/simplexnoise.cpp -o ....../OpenShadingLanguage/build/src/liboslexec/simplexnoise_cuda.s
clang: error: cannot find libdevice for sm_75. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.
clang: error: GPU arch sm_75 is supported by CUDA versions between 10.0 and 11.0 (inclusive), but installation at /usr/local/cuda is 7.0. Use --cuda-path to specify a different CUDA install, pass a different GPU arch with --cuda-gpu-arch, or pass --no-cuda-version-check.
make[2]: *** [src/liboslexec/CMakeFiles/oslexec.dir/build.make:692: src/liboslexec/simplexnoise_cuda.bc] Error 1
make[2]: Leaving directory '....../OpenShadingLanguage/build'
make[1]: *** [CMakeFiles/Makefile2:1307: src/liboslexec/CMakeFiles/oslexec.dir/all] Error 2
make[1]: Leaving directory '....../OpenShadingLanguage/build'
make: *** [Makefile:169: all] Error 2
➜  build git:(master) ccmake ../


Can anybody give me a hand please?


  • My environments:
    • OS: Ubuntu 20.04
    • GCC: 10.3.1
    • GPU: Geforce 2080 Ti
    • NVIDIA Driver: 470.63.01
    • CUDA: 11.4


Thank you...


--
Dr. Pei Jia
CTO of Longer Vision Technology (Canada) Ltd.
Email: jiapei@...
Cell Number: +1 778-863-5816


Re: Crash with shader compiled to memory

Larry Gritz
 

Apologies for the delay. How about this?  https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1397

I tought it would be safe to do what we did -- the derived classes don't in fact override the destructor and they don't add any fields that need nontrivial teardown. But I agree that we've done something odd here, probably illegal or undefined behavior. I think your solution is probably the simplest and most foolproof approach to fixing.



On Aug 5, 2021, at 8:47 AM, Thomas METAIS <thomas.metais@...> wrote:

Hello,

We have a weird crash with a shader, compiled on the fly with a OSLCompiler created on the stack, and loaded with LoadMemoryCompiledShader.
The crash occurs later, when calling optimize_group. The compiled shader itself is very simple ( just does out = in ) and its input is connected to a pre-compiled shader.

/lib64/libc.so.6(+0x36400)[0x7fb729d97400]
/u/opt3production/production.CentOS-7.4/Opt/P-20210519-Opt-21_0002_0004/lib64/liboslexec.so.1.11(_ZN9OSL_v1_113pvt16RuntimeOptimizer19resolve_isconnectedEv+0x1e8)[0x7fb73366f5f8]
/u/opt3production/production.CentOS-7.4/Opt/P-20210519-Opt-21_0002_0004/lib64/liboslexec.so.1.11(_ZN9OSL_v1_113pvt16RuntimeOptimizer3runEv+0x318)[0x7fb7336746e8]
/u/opt3production/production.CentOS-7.4/Opt/P-20210519-Opt-21_0002_0004/lib64/liboslexec.so.1.11(_ZN9OSL_v1_113pvt17ShadingSystemImpl14optimize_groupERNS_11ShaderGroupEPNS_14ShadingContextEb+0x37f)[0x7fb7335a94df]

I ended up using a sanitizer (ASan) and it reports an error during the destruction of the compiler:

==11203==ERROR: AddressSanitizer: new-delete-type-mismatch on 0x60d000064760 in thread T0:
  object passed to delete has wrong type:
  size of the allocated type:   136 bytes;
  size of the deallocated type: 96 bytes.
    #0 0xa82280 in operator delete(void*, unsigned long) (/u/devstuff/releases.CentOS-7.8/mgl/tomtom/dist.21.1.asan/bin/mglr.bin+0xa82280)
    #1 0x7fc55591c2d8 in OSL_v1_11::pvt::SymbolTable::delete_syms() /u/local/imgdev/imgdev_installer/production/workspace/CentOS-7.4/release/build/Opt/P-20210519-Opt-21_0002_0004-r75747/Dist/CentOS-7.4/build/sources/OpenShadingLanguage/sources/OpenShadingLanguage-1.11.13.0/src/liboslcomp/symtab.cpp:278
    #2 0x7fc55590e392 in OSL_v1_11::pvt::SymbolTable::~SymbolTable() /u/local/imgdev/imgdev_installer/production/workspace/CentOS-7.4/release/build/Opt/P-20210519-Opt-21_0002_0004-r75747/Dist/CentOS-7.4/build/sources/OpenShadingLanguage/sources/OpenShadingLanguage-1.11.13.0/src/liboslcomp/symtab.h:208
    #3 0x7fc55590e392 in OSL_v1_11::pvt::OSLCompilerImpl::~OSLCompilerImpl() /u/local/imgdev/imgdev_installer/production/workspace/CentOS-7.4/release/build/Opt/P-20210519-Opt-21_0002_0004-r75747/Dist/CentOS-7.4/build/sources/OpenShadingLanguage/sources/OpenShadingLanguage-1.11.13.0/src/liboslcomp/oslcomp.cpp:120
    #4 0x7fc55590e4b0 in OSL_v1_11::OSLCompiler::~OSLCompiler() /u/local/imgdev/imgdev_installer/production/workspace/CentOS-7.4/release/build/Opt/P-20210519-Opt-21_0002_0004-r75747/Dist/CentOS-7.4/build/sources/OpenShadingLanguage/sources/OpenShadingLanguage-1.11.13.0/src/liboslcomp/oslcomp.cpp:47
    #5 0x1100654 in mg::rt::OslShaderConverter::compileShader(OSL_v1_11::ShadingSystem*, OpenImageIO_v2_2::string_view, std::string&, std::string&) src/rt/shading/src/OslShaderConverter.cpp:1817


It seems that when a FunctionSymbol object in the symbol table is deleted, its destructor is not called.
The FunctionSymbol class (symtab.h) is derived from the Symbol class (osl_pvt.h), but Symbol's destructor is not virtual.

We patched our OSL version (1.11.13), just making Symbol's destructor virtual and it solved our problem, no more crashes.

I hope this will help ( and that I'm not wrong somewhere... )!

Thanks for your work,

Thomas METAIS,
Illumination MacGuff

--
Larry Gritz





Upcoming Events #cal-summary

osl-dev@lists.aswf.io Calendar <osl-dev@...>
 

Open Shading Language discussion list Upcoming Events

OSL TSC meeting ( every other week )

When:
Thursday, September 2, 2021, 2:00pm to 3:00pm
(GMT-07:00) America/Los Angeles

Where:
https://zoom.us/j/100511909

Organizer: Chris Kulla ckulla@...

Details:

Every other week meeting of the OSL TSC.

Meeting Agenda / Notes: https://docs.google.com/document/d/1yf0bG6eoE2EvKZBNZX3nskdTvu99ADTDTNOknCDJd1I/

Confirm this meeting invite is still valid by finding the meeting at https://lists.aswf.io/calendar.

Join Zoom Meeting https://zoom.us/j/100511909

Meeting ID: 100 511 909

One tap mobile +16465588656,,100511909# US (New York) +13126266799,,100511909# US (Chicago)

Dial by your location +1 646 558 8656 US (New York) +1 312 626 6799 US (Chicago) +1 669 900 6833 US (San Jose) +1 253 215 8782 US +1 301 715 8592 US +1 346 248 7799 US (Houston) 877 369 0926 US Toll-free 855 880 1246 US Toll-free +1 587 328 1099 Canada +1 647 374 4685 Canada +1 647 558 0588 Canada +1 778 907 2071 Canada +1 438 809 7799 Canada 855 703 8985 Canada Toll-free Meeting ID: 100 511 909 Find your local number: https://zoom.us/u/acBVrM6HWR

View Event


OSL TSC meeting ( every other week )

When:
Thursday, September 16, 2021, 2:00pm to 3:00pm
(GMT-07:00) America/Los Angeles

Where:
https://zoom.us/j/100511909

Organizer: Chris Kulla ckulla@...

Details:

Every other week meeting of the OSL TSC.

Meeting Agenda / Notes: https://docs.google.com/document/d/1yf0bG6eoE2EvKZBNZX3nskdTvu99ADTDTNOknCDJd1I/

Confirm this meeting invite is still valid by finding the meeting at https://lists.aswf.io/calendar.

Join Zoom Meeting https://zoom.us/j/100511909

Meeting ID: 100 511 909

One tap mobile +16465588656,,100511909# US (New York) +13126266799,,100511909# US (Chicago)

Dial by your location +1 646 558 8656 US (New York) +1 312 626 6799 US (Chicago) +1 669 900 6833 US (San Jose) +1 253 215 8782 US +1 301 715 8592 US +1 346 248 7799 US (Houston) 877 369 0926 US Toll-free 855 880 1246 US Toll-free +1 587 328 1099 Canada +1 647 374 4685 Canada +1 647 558 0588 Canada +1 778 907 2071 Canada +1 438 809 7799 Canada 855 703 8985 Canada Toll-free Meeting ID: 100 511 909 Find your local number: https://zoom.us/u/acBVrM6HWR

View Event


OSL TSC meeting ( every other week )

When:
Thursday, September 30, 2021, 2:00pm to 3:00pm
(GMT-07:00) America/Los Angeles

Where:
https://zoom.us/j/100511909

Organizer: Chris Kulla ckulla@...

Details:

Every other week meeting of the OSL TSC.

Meeting Agenda / Notes: https://docs.google.com/document/d/1yf0bG6eoE2EvKZBNZX3nskdTvu99ADTDTNOknCDJd1I/

Confirm this meeting invite is still valid by finding the meeting at https://lists.aswf.io/calendar.

Join Zoom Meeting https://zoom.us/j/100511909

Meeting ID: 100 511 909

One tap mobile +16465588656,,100511909# US (New York) +13126266799,,100511909# US (Chicago)

Dial by your location +1 646 558 8656 US (New York) +1 312 626 6799 US (Chicago) +1 669 900 6833 US (San Jose) +1 253 215 8782 US +1 301 715 8592 US +1 346 248 7799 US (Houston) 877 369 0926 US Toll-free 855 880 1246 US Toll-free +1 587 328 1099 Canada +1 647 374 4685 Canada +1 647 558 0588 Canada +1 778 907 2071 Canada +1 438 809 7799 Canada 855 703 8985 Canada Toll-free Meeting ID: 100 511 909 Find your local number: https://zoom.us/u/acBVrM6HWR

View Event

321 - 340 of 5060