Question

Hi I am trying to install nVidia OptiX SDK version 3.0.0 für linux64 on Ubuntu.

I have downloaded the .run file. When the execution was finished I got a folder called ~/NVIDIA-OptiX-SDK-3.0.0-linux64/

It is in my home folder.

The precompiled examples work fine but when I try to compile my own code the compiler seems to handle the .cu files as CUDA files and tries to compile them to .cu.o. One output of my program's error was :

Building NVCC (Device) object CMakeFiles/RayTracerExec.dir/src/Tracy/ObjectLoader/optixcu/./RayTracerExec_generated_triangle_mesh_target.cu.o

Normally the files should compile to some kind of ptx files?

The error following is:

ptxas /tmp/tmpxft_00000eef_00000000-5_triangle_mesh_target.ptx, line 94; error   : Label expected for argument 0 of instruction 'call'
ptxas /tmp/tmpxft_00000eef_00000000-5_triangle_mesh_target.ptx, line 94; error   : Call target not recognized
ptxas /tmp/tmpxft_00000eef_00000000-5_triangle_mesh_target.ptx, line 94; error   : Function '_rt_buffer_get_64' not declared in this scope

The not finding of the function _rt_buffer_get_64 makes me feel that something is not installed properly.

In the folder are subfolders named doc include lib64 SDK SDK-precompiled-samples What I did was to copy the content of include into /usr/local/include and the content of lib64 into /usr/local/lib

Any Ideas? Regards

No correct solution

OTHER TIPS

It looks like you are using CMake to build your sample judging from the text in the output. It looks like the build system thinks you want to compile object files instead of PTX files. The error messages you are seeing are also indicative of this symptom.

There are several methods of compiling CUDA code from within CMake.

If you are using the CUDA run time, then you typically do the following:

cuda_add_executable(myprogram main.cpp mycuda.cu myheader.h)

This creates an executable called myprogram that is composed of two object files: main.cpp.o and mycuda.cu.o. The CUDA runtime expects the code inside the cuda file to conform to the CUDA runtime API.

In addition to cuda_add_executable there is also cuda_add_library which compiles a library instead of an executable. Both of these macros use another macro called cuda_wrap_srcs that does most of the heavy lifting as far as generating the build commands to compile CUDA code. Among other things this macro has an argument for specifying if you want to use the CUDA run time or to target only PTX (the arguments are OBJ or PTX).

In order to get OptiX shaders to compile you must target PTX. In our SDK we ship, this is handled through a CMake functions called OPTIX_add_sample_executable which can be found in <install>/SDK/CMakeLists.txt. Mostly what this function does is call cuda_wrap_srcs with the PTX option specified. I've included the function here for reference as well.

#########################################################
# OPTIX_add_sample_executable
#
# Convenience function for adding samples to the code.  You can copy the contents of this
# function into your individual project if you wish to customize the behavior.  Note that
# in CMake, functions have their own scope, whereas macros use the scope of the caller.
function(OPTIX_add_sample_executable target_name)

  # These calls will group PTX and CUDA files into their own directories in the Visual
  # Studio projects.
  source_group("PTX Files"  REGULAR_EXPRESSION ".+\\.ptx$")
  source_group("CUDA Files" REGULAR_EXPRESSION ".+\\.cu$")

  # Separate the sources from the CMake and CUDA options fed to the macro.  This code
  # comes from the CUDA_COMPILE_PTX macro found in FindCUDA.cmake.  We are copying the
  # code here, so that we can use our own name for the target.  target_name is used in the
  # creation of the output file names, and we want this to be unique for each target in
  # the SDK.
  CUDA_GET_SOURCES_AND_OPTIONS(source_files cmake_options options ${ARGN})

  # Create the rules to build the PTX from the CUDA files.
  CUDA_WRAP_SRCS( ${target_name} PTX generated_files ${source_files} ${cmake_options}
    OPTIONS ${options} )

  # Here is where we create the rule to make the executable.  We define a target name and
  # list all the source files used to create the target.  In addition we also pass along
  # the cmake_options parsed out of the arguments.
  add_executable(${target_name}
    ${source_files}
    ${generated_files}
    ${cmake_options}
    )

  # Most of the samples link against the sutil library and the optix library.  Here is the
  # rule that specifies this linkage.
  target_link_libraries( ${target_name}
    sutil
    optix
    ${optix_rpath}
    )
endfunction()
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top