Optix7 optixHello

Good morning,

I am trying to compile the optix7 sample ‘optixHello’ and am getting the following errors:
ptxas /tmp/tmpxft_00009e0b_00000000-5_draw_solid_color.ptx, line 27; error : Label expected for argument 0 of instruction ‘call’
ptxas /tmp/tmpxft_00009e0b_00000000-5_draw_solid_color.ptx, line 27; fatal : Call target not recognized
ptxas fatal : Ptx assembly aborted due to errors

Can anyone point me in the direction of what could be causing this?

Thank you in advanced for any help/hints.

Would you please add the usual system configuration information:
OS version, installed GPU(s), display driver version (mandatory), OptiX version (major.minor.micro), CUDA toolkit version used to generate the OptiX input PTX code, host compiler version.

I’m assuming OptiX 7.1.0 and CUDA 10.x or CUDA 11.0.
(I would not use CUDA 11.1 with OptiX 7.1.0 because that predates CUDA 11.1.)

If you say the problem happens during OptiX SDK 7.x optixHello compile time, there is likely something wrong with your build environment.
There shouldn’t be any PTX assembler invoked during the compilation process from CUDA device code source in *.h and *.cu files to *.ptx OptiX input source modules.
The PTX assembler from the CUDA driver is invoked at application runtime after OptiX built the final kernels from your input PTX code.

Please make sure you use the OptiX SDK top-level CMakeLists.txt inside the SDK sub-folder when configuring the solution. The one next to the INSTALL-LINUX.txt and INSTALL-WIN.txt files which explain that.
Do not use the CMakeLists.txt files inside the individual examples’ sub-directories as root for the CMake configuration. Those will miss the necessary settings done in the root level CMakeLists.txt file.

@droettger, thank you for the reply.

Maybe I should back up. Can you point me to a good beginning code using Optix that can be easily built with Optix 7.0 using CUDA 9.0 ?

Thanks again.

The OptiX SDK examples should also build with CUDA 9.0 when using the right CMakeLists.txt as root.

The OptiX Release Notes lists the supported CUDA versions.
Below are the relevant excerpts from the OptiX SDK 7.1.0 release notes.

Development Environment Requirements (for compiling with OptiX)
● CUDA Toolkit 7, 8, 9, 10, 11
The OptiX 7.1.0 prebuilt samples on Windows have been built with CUDA 11, but any specified toolkit should work when compiling PTX for OptiX. OptiX uses the CUDA device API, but the CUDA runtime API objects can be cast to device API objects.

For running OptiX applications, the display driver needs to support the CUDA version a specific OptiX version has been built with.

Graphics Driver:
● OptiX 7.1.0 requires that you install a r450+ driver.
● Windows 7/8.1/10 64-bit; Linux RHEL 4.8+ or Ubuntu 10.10+ 64-bit

For OptiX 7.0.0 it’s the following:
Graphics Driver:
● OptiX 7.0.0 requires that you install the 435.80 driver on Windows or the 435.12 Driver for linux… Note
OptiX dll from the SDK are no longer needed since the symbols are loaded from the driver.
● Windows 7/8.1/10 64-bit; Linux RHEL 4.8+ or Ubuntu 10.10+ 64-bit
CUDA Toolkit
● It is not required to have any CUDA toolkit installed to be able to run OptiX-based applications.
Development Environment Requirements (for compiling with OptiX)
● CUDA Toolkit 7, 8, 9, 10
OptiX 7.0.0 has been built with CUDA 10.1, but any specified toolkit should work when compiling PTX for OptiX.
OptiX uses the CUDA device API, but the CUDA runtime API objects can be cast to device API objects.

The examples inside the SDK are beginner level examples and try to show individual features of the OptiX API.
There isn’t a simpler example than optixHello which isn’t even shooting a single ray.

For additional OptiX 7 examples from beginner to advanced level please have a look into the resources linked in the following sticky posts at the top of the OptiX sub-forum:
https://forums.developer.nvidia.com/t/optix-7-1-release/139962
https://forums.developer.nvidia.com/t/optix-advanced-samples-on-github/48410/4

Mind that OptiX 7 only supports Maxwell and newer GPU architectures.
CUDA 11.0 dropped support for SM 3.0 and SM 3.2 (Kepler) and deprecated SM 3.5, SM 3.7 (Kepler) and SM 5.0 (first Maxwell). That should all not be an issue with CUDA 9 or 10.
The OptiX 7.1 examples build their PTX code with SM 6.0 (Pascal) to avoid the CUDA 11 deprecation warnings.
When targeting Maxwell GPUs, you’d need to set the SM version back to 5.0.
https://forums.developer.nvidia.com/t/optix-7-1-issue-with-running-samples-on-a-maxwell-card/140118/2