arcadelab / deepdrr

Code for "DeepDRR: A Catalyst for Machine Learning in Fluoroscopy-guided Procedures". https://arxiv.org/abs/1803.08606
GNU General Public License v3.0
206 stars 59 forks source link

Error when trying out the main branch #112

Open YassinAbdelrahman opened 9 months ago

YassinAbdelrahman commented 9 months ago

Hi all,

Whenever I try to run any kind of DRR generation with the main branch, I get this error:

CompileError: nvcc compilation of /tmp/tmpvqiw8grx/kernel.cu failed
[command: nvcc --cubin -D NUM_VOLUMES=1 -D NUM_MATERIALS=3 -D ATTENUATE_OUTSIDE_VOLUME=0 -D AIR_INDEX=0 -arch sm_75 -I/autofs/isis10/user/yassin/deepdrr/deepdrr/projector/cubic -I/autofs/isis10/user/yassin/deepdrr/deepdrr/projector -I/user/yassin/miniconda3/envs/deepdrr/lib/python3.8/site-packages/pycuda/cuda kernel.cu]
[stderr:
/autofs/isis10/user/yassin/deepdrr/deepdrr/projector/cubic/cubicTex3D.cu(54): error: identifier "texture" is undefined
  __attribute__((device)) float linearTex3D(texture<T, 3, mode> tex, float3 coord)
                                            ^

/autofs/isis10/user/yassin/deepdrr/deepdrr/projector/cubic/cubicTex3D.cu(54): error: type name is not allowed
  __attribute__((device)) float linearTex3D(texture<T, 3, mode> tex, float3 coord)
                                                    ^

/autofs/isis10/user/yassin/deepdrr/deepdrr/projector/cubic/cubicTex3D.cu(54): error: identifier "tex" is undefined
  __attribute__((device)) float linearTex3D(texture<T, 3, mode> tex, float3 coord)
                                                                ^

/autofs/isis10/user/yassin/deepdrr/deepdrr/projector/cubic/cubicTex3D.cu(54): error: type name is not allowed
  __attribute__((device)) float linearTex3D(texture<T, 3, mode> tex, float3 coord)
                                                                     ^

/autofs/isis10/user/yassin/deepdrr/deepdrr/projector/cubic/cubicTex3D.cu(54): error: too many initializer values
  __attribute__((device)) float linearTex3D(texture<T, 3, mode> tex, float3 coord)
                                                       ^

/autofs/isis10/user/yassin/deepdrr/deepdrr/projector/cubic/cubicTex3D.cu(54): error: expected a ")"
  __attribute__((device)) float linearTex3D(texture<T, 3, mode> tex, float3 coord)
                                                                            ^

/autofs/isis10/user/yassin/deepdrr/deepdrr/projector/cubic/cubicTex3D.cu(55): error: expected a ";"
  {
  ^

kernel.cu(2358): error: identifier "cubicTex3D" is undefined
      do { if (do_trace[0]) { do { px[0] = sx_ijk[0] + alpha * rx_ijk[0] - 0.5; py[0] = sy_ijk[0] + alpha * ry_ijk[0] - 0.5; pz[0] = sz_ijk[0] + alpha * rz_ijk[0] - 0.5; } while (0); do { do { seg_at_alpha[0][0] = round( cubicTex3D(seg_0_0, px[0], py[0], pz[0])); } while (0); do { seg_at_alpha[0][1] = round( cubicTex3D(seg_0_1, px[0], py[0], pz[0])); } while (0); do { seg_at_alpha[0][2] = round( cubicTex3D(seg_0_2, px[0], py[0], pz[0])); } while (0); } while (0); } } while (0);
                                                                                                                                                                                                                             ^

kernel.cu(2358): error: identifier "cubicTex3D" is undefined
      do { if (do_trace[0]) { do { px[0] = sx_ijk[0] + alpha * rx_ijk[0] - 0.5; py[0] = sy_ijk[0] + alpha * ry_ijk[0] - 0.5; pz[0] = sz_ijk[0] + alpha * rz_ijk[0] - 0.5; } while (0); do { do { seg_at_alpha[0][0] = round( cubicTex3D(seg_0_0, px[0], py[0], pz[0])); } while (0); do { seg_at_alpha[0][1] = round( cubicTex3D(seg_0_1, px[0], py[0], pz[0])); } while (0); do { seg_at_alpha[0][2] = round( cubicTex3D(seg_0_2, px[0], py[0], pz[0])); } while (0); } while (0); } } while (0);
                                                                                                                                                                                                                                                                                                                      ^

kernel.cu(2358): error: identifier "cubicTex3D" is undefined
      do { if (do_trace[0]) { do { px[0] = sx_ijk[0] + alpha * rx_ijk[0] - 0.5; py[0] = sy_ijk[0] + alpha * ry_ijk[0] - 0.5; pz[0] = sz_ijk[0] + alpha * rz_ijk[0] - 0.5; } while (0); do { do { seg_at_alpha[0][0] = round( cubicTex3D(seg_0_0, px[0], py[0], pz[0])); } while (0); do { seg_at_alpha[0][1] = round( cubicTex3D(seg_0_1, px[0], py[0], pz[0])); } while (0); do { seg_at_alpha[0][2] = round( cubicTex3D(seg_0_2, px[0], py[0], pz[0])); } while (0); } while (0); } } while (0);
                                                                                                                                                                                                                                                                                                                                                                                                               ^

kernel.cu(2409): error: identifier "volume_0" is undefined
        do { if (do_trace[0] && (priority[0] == curr_priority)) { do { do { area_density[(0)] += (weight)*tex3D(volume_0, px[0], py[0], pz[0]) * seg_at_alpha[0][0]; } while (0); do { area_density[(1)] += (weight)*tex3D(volume_0, px[0], py[0], pz[0]) * seg_at_alpha[0][1]; } while (0); do { area_density[(2)] += (weight)*tex3D(volume_0, px[0], py[0], pz[0]) * seg_at_alpha[0][2]; } while (0); } while (0); } } while (0);
                                                                                                                ^

kernel.cu(2409): error: no instance of overloaded function "tex3D" matches the argument list
            argument types are: (<error-type>, float, float, float)
        do { if (do_trace[0] && (priority[0] == curr_priority)) { do { do { area_density[(0)] += (weight)*tex3D(volume_0, px[0], py[0], pz[0]) * seg_at_alpha[0][0]; } while (0); do { area_density[(1)] += (weight)*tex3D(volume_0, px[0], py[0], pz[0]) * seg_at_alpha[0][1]; } while (0); do { area_density[(2)] += (weight)*tex3D(volume_0, px[0], py[0], pz[0]) * seg_at_alpha[0][2]; } while (0); } while (0); } } while (0);
                                                                                                          ^

kernel.cu(2409): error: identifier "volume_0" is undefined
        do { if (do_trace[0] && (priority[0] == curr_priority)) { do { do { area_density[(0)] += (weight)*tex3D(volume_0, px[0], py[0], pz[0]) * seg_at_alpha[0][0]; } while (0); do { area_density[(1)] += (weight)*tex3D(volume_0, px[0], py[0], pz[0]) * seg_at_alpha[0][1]; } while (0); do { area_density[(2)] += (weight)*tex3D(volume_0, px[0], py[0], pz[0]) * seg_at_alpha[0][2]; } while (0); } while (0); } } while (0);
                                                                                                                                                                                                                           ^

kernel.cu(2409): error: no instance of overloaded function "tex3D" matches the argument list
            argument types are: (<error-type>, float, float, float)
        do { if (do_trace[0] && (priority[0] == curr_priority)) { do { do { area_density[(0)] += (weight)*tex3D(volume_0, px[0], py[0], pz[0]) * seg_at_alpha[0][0]; } while (0); do { area_density[(1)] += (weight)*tex3D(volume_0, px[0], py[0], pz[0]) * seg_at_alpha[0][1]; } while (0); do { area_density[(2)] += (weight)*tex3D(volume_0, px[0], py[0], pz[0]) * seg_at_alpha[0][2]; } while (0); } while (0); } } while (0);
                                                                                                                                                                                                                     ^

kernel.cu(2409): error: identifier "volume_0" is undefined
        do { if (do_trace[0] && (priority[0] == curr_priority)) { do { do { area_density[(0)] += (weight)*tex3D(volume_0, px[0], py[0], pz[0]) * seg_at_alpha[0][0]; } while (0); do { area_density[(1)] += (weight)*tex3D(volume_0, px[0], py[0], pz[0]) * seg_at_alpha[0][1]; } while (0); do { area_density[(2)] += (weight)*tex3D(volume_0, px[0], py[0], pz[0]) * seg_at_alpha[0][2]; } while (0); } while (0); } } while (0);
                                                                                                                                                                                                                                                                                                                                      ^

kernel.cu(2409): error: no instance of overloaded function "tex3D" matches the argument list
            argument types are: (<error-type>, float, float, float)
        do { if (do_trace[0] && (priority[0] == curr_priority)) { do { do { area_density[(0)] += (weight)*tex3D(volume_0, px[0], py[0], pz[0]) * seg_at_alpha[0][0]; } while (0); do { area_density[(1)] += (weight)*tex3D(volume_0, px[0], py[0], pz[0]) * seg_at_alpha[0][1]; } while (0); do { area_density[(2)] += (weight)*tex3D(volume_0, px[0], py[0], pz[0]) * seg_at_alpha[0][2]; } while (0); } while (0); } } while (0);
                                                                                                                                                                                                                                                                                                                                ^

kernel.cu(2786): error: identifier "volume_0" is undefined
              do { density_sample[0] = tex3D(volume_0, inp_x, inp_y, inp_z); mat_sample[0][0] = cubicTex3D(seg_0_0, inp_x, inp_y, inp_z); mat_sample[0][1] = cubicTex3D(seg_0_1, inp_x, inp_y, inp_z); mat_sample[0][2] = cubicTex3D(seg_0_2, inp_x, inp_y, inp_z); } while (0);
                                             ^

kernel.cu(2786): error: no instance of overloaded function "tex3D" matches the argument list
            argument types are: (<error-type>, float, float, float)
              do { density_sample[0] = tex3D(volume_0, inp_x, inp_y, inp_z); mat_sample[0][0] = cubicTex3D(seg_0_0, inp_x, inp_y, inp_z); mat_sample[0][1] = cubicTex3D(seg_0_1, inp_x, inp_y, inp_z); mat_sample[0][2] = cubicTex3D(seg_0_2, inp_x, inp_y, inp_z); } while (0);
                                       ^

kernel.cu(2786): error: identifier "cubicTex3D" is undefined
              do { density_sample[0] = tex3D(volume_0, inp_x, inp_y, inp_z); mat_sample[0][0] = cubicTex3D(seg_0_0, inp_x, inp_y, inp_z); mat_sample[0][1] = cubicTex3D(seg_0_1, inp_x, inp_y, inp_z); mat_sample[0][2] = cubicTex3D(seg_0_2, inp_x, inp_y, inp_z); } while (0);
                                                                                                ^

19 errors detected in the compilation of "kernel.cu".
]

Is this an error on my side? I have tried using cuda 11 and the latest cuda but I still keep having this same error.

Thank you, Yassin

benjamindkilleen commented 9 months ago

What is the output of nvcc --version?

YassinAbdelrahman commented 9 months ago
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Wed_Nov_22_10:17:15_PST_2023
Cuda compilation tools, release 12.3, V12.3.107
Build cuda_12.3.r12.3/compiler.33567101_0

That is the output

YassinAbdelrahman commented 9 months ago

Do I have the wrong version? I am still stuck on this. The dev branch worked fine when using a CArm but not with projection matrices which is why I tried switching to the main branch, but now this is happening. Any help would be appreciated, I am still new to this. Thank you!

benjamindkilleen commented 9 months ago

What was the error when you used a projection matrix on the dev branch? Sorry you're having an issue!

YassinAbdelrahman commented 9 months ago

I have fixed it by using the cuda11x instead of 12x, apparently cuda 12.3 does not work with DeepDRR for me, could that just be the case? That DeepDRR does not work with cuda 12.3? Thank you for your help though!

benjamindkilleen commented 9 months ago

The dev branch is specifically updated to work with CUDA 12, but if there is a bug for projection matrices there then it would be something we want to fix before a full release.

Can you still provide this error message if you don’t mind? On Jan 23, 2024 at 8:35 AM -0500, Yassin Abdelrahman @.***>, wrote:

I have fixed it by using the cuda11x instead of 12x, apparently cuda 12.3 does not work with DeepDRR for me, could that just be the case? That DeepDRR does not work with cuda 12.3? Thank you for your help though! — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

YassinAbdelrahman commented 9 months ago

I don't have the original error message but the main error message was: "cuPy failed to load libnvrtc.so.12: cannot open shared object file: No such file or directory". This when installing with pip install .[cuda12x]. Once I made a new environment and installed with pip install .[cuda11x] and after installing pyopengl 3.1.1a1, the code did not give me another error. I hope this helps!