-
Notifications
You must be signed in to change notification settings - Fork 135
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
[BUG]: OptiX linker failure caused by EmptyKernel<void>
in cub/util_device.cuh
#1923
Comments
The definition of template <typename T>
__global__ __attribute__((__visibility__("hidden"))) void EmptyKernel()
{} which is the same for many other kernels with have inside CUB. The kernel being a template makes the function I am not familiar with "the OptiX linker" so here is some speculation: maybe it fails to mark the kernel template <typename T>
CUB_DETAIL_KERNEL_ATTRIBUTES void EmptyKernel(T*)
{} and the later definition of using EmptyKernelPtr = void (*)(void*); and report whether this fixes the issue? |
Thank you for your patient reply! I've tried your suggested approach, but unfortunately, the renderer still reports the same error: Error: Symbol '_ZN3cub17CUB_200400_860_NS11EmptyKernelIvEEvPT_' was defined multiple times. First seen in: '0x71864e8064b77f71__closesthit__radiance-and-6-more' I'd like to provide some additional information that might be helpful:
[7/10] Building CUDA object flux/CMakeFiles/flux.dir/src/film.cu.o
/home/krr/.cache/CPM/cccl/6b735c39125bb1ca2f7ad9b8fbf6b135f24dd2ed/cub/cub/cmake/../../cub/util_device.cuh:117:88: warning: ‘visibility’ attribute ignored [-Wattributes]
117 | __global__ __attribute__((__visibility__("hidden"))) void EmptyKernel(void) { }
| ^
In file included from tmpxft_001ac178_00000000-6_film.cudafe1.stub.c:1:
/tmp/tmpxft_001ac178_00000000-6_film.cudafe1.stub.c:1:115: warning: ‘visibility’ attribute ignored [-Wattributes]
1 | #pragma GCC diagnostic push
| ^
[8/10] Building CUDA object flux/CMakeFiles/flux.dir/src/light.cu.o
/home/krr/.cache/CPM/cccl/6b735c39125bb1ca2f7ad9b8fbf6b135f24dd2ed/cub/cub/cmake/../../cub/util_device.cuh:117:88: warning: ‘visibility’ attribute ignored [-Wattributes]
117 | __global__ __attribute__((__visibility__("hidden"))) void EmptyKernel(void) { } The two files are not related to OptiX kernel. In any case, we do have a workaround, and it doesn't affect our development (hopefully?). Thank you again for your reply. |
The
If I demangle that, I get So I guess that's your workaround for now. Anonymous namespace or mark as
If you can, please report this issue to the OptiX team. Thank you! |
I've already been in touch with the internal OptiX team and they are looking into it. Early indications make it sound like this is indeed an OptiX issue setting the wrong linkage. |
Thank you for your explanation and help, hope to see the issue gets figured out and fixed! |
Hey @kririae, I heard from the internal OptiX team that this issue has been fixed in the development branch for the OptiX linker. They weren't sure on exact dates of when the fix will be public, but it should be relatively soon! |
Happy to see that! Again thank you for your patience and help. |
Is this a duplicate?
Type of Bug
Runtime Error
Component
CUB
Describe the bug
When more than one TU is compiled with CUB's
cub/util_device.cuh
header included, the OptiX linker will report an error upon the invocation of optixPipelineCreate, which reports the following:How to Reproduce
The reproduction of this error(?) requires a complete OptiX environment, I forked the official OptiX_Apps as an example.
I can only use the PTX variant(instead of the OptiX IR variant) of OptiX because of this issue, so I slightly modified the code as an alignment.
When executing the example renderer like:
The issue appears
Expected behavior
I temporarily worked around this issue by adding an anonymous namespace around, and the issue disappeared.
Reproduction link
kririae/OptiX_Apps@8ee4178
Operating System
Arch Linux
nvidia-smi output
NVCC version
$ nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2024 NVIDIA Corporation Built on Wed_Apr_17_19:19:55_PDT_2024 Cuda compilation tools, release 12.5, V12.5.40 Build cuda_12.5.r12.5/compiler.34177558_0
The text was updated successfully, but these errors were encountered: