Optix-7.0 has a conflict with 'libcuda.so'?

  • When I linked the lib ‘libcuda.so’ in CMakeLists.txt, the context created failed. Here is the result.
  • But it’s ok, when I comment the libcuda.so

I’m not a Linux user, but isn’t the libcuda.so the actual CUDA driver executable library and not the application link library?

For applications linking against the CUDA Driver API you would normally use CMake’s FindCUDA.cmake and add the ${CUDA_CUDA_LIBRARY} to the target_link_libraries of your application.

This is how I’m doing it in my examples which work under Windows and Linux.
https://github.com/NVIDIA/OptiX_Apps/blob/master/apps/intro_driver/CMakeLists.txt#L167
Print that value with a message instruction and see what CMake picked.

Compare that with the target_link_libraries used in the CUDA Runtime API case which additionally links against ${CUDA_LIBRARIES}.
https://github.com/NVIDIA/OptiX_Apps/blob/master/apps/intro_runtime/CMakeLists.txt#L168

Start looking at the top-most CMakeLists.txt in that repository for Linux specific settings.

Yeah, it’s the CUDA driver executable library. And I got that about cmake.
But I have other module, for example nvcloth and libtorch, which need the libcuda.so
I need solve the crash anyway.
So, any idea about the error info ?

Thank you all the same!

So you say your OptiX 7.0.0 program works fine when not linking against the CUDA driver library and fails if you do.
That would require more information about what exactly you did.

Please always specify at least the following system configuration information for any OptiX issue:
OS version, installed GPU(s), display driver version (this is mandatory!), OptiX version (major.minor.micro), CUDA version (major.minor) used to compile the input PTX code, host compiler version.

The first link above contains an OptiX 7.0.0 application named intro_driver which only uses the CUDA Driver API and works under Windows and Linux.
You might want to try if you can get that to work on your system and if yes, check what you did differently in your sources.

Note that the CUDA Context initialization differs between the CUDA Runtime API and CUDA Driver API versions of this example.
(The intro_runtime example links against both the CUDA runtime and driver library because it uses driver API to get the current CUDA context.)

Compare these two Application::initOptiX() functions:
https://github.com/NVIDIA/OptiX_Apps/blob/master/apps/intro_runtime/src/Application.cpp#L734
https://github.com/NVIDIA/OptiX_Apps/blob/master/apps/intro_driver/src/Application.cpp#L752

Thank you for your patience and guidance. I will try it later.
The configuration info:

  • Ubuntu 16.04
  • GPU: GTX 1070
  • Optix: 7.0.0
  • cuda version : 10.2