-
Notifications
You must be signed in to change notification settings - Fork 60
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
installation problem #26
Comments
Is it possible that you have a version conflict between your nvcc provided by Visual Studio and Cuda, e.g. as described here: https://stackoverflow.com/questions/48170231/cuda-c-expected-an-expression-in-kernel-cu-file ? |
Have you tried compiling the DeepDRR kernels though? It seems that the issue is somewhere in the compatibility with some calls within the INTERPOLATE function. If you have a way to increase verbosity of your outputs you may also find some more helpful pointers. |
I've had similar bugs before. What version of gcc is on you path? We use macros to enable some features, which may not work with every C compiler. |
Hello, @mathiasunberath About verbosity I owe you an apology. THe error message in Jupyter notebook is longer, but I thought the line numbers would be enough. I will copy the complete error message at the end of this message. As you may have guessed I am a relative noob. So I will write down what I tried: I will try further tonight and come back to you if I get any further. I installed gcc-core, gcc debug info, gcc fortran, gcc g++, gcc objc and gcc objc ++ version 9.3.0-2 using cygwin installer. Install location is in c: and the c:\cygwin64\bin is added to the user path. I tested the gcc version from the command prompt and I got a reponse. Thank you for your assistance. The complete error message (of the last step of the example script):CompileError Traceback (most recent call last) ~\anaconda3\envs\deepdrr2\lib\site-packages\deepdrr\projector\projector.py in init(self, volume, camera_intrinsics, carm, step, mode, spectrum, add_scatter, add_noise, photon_count, threads, max_block_index, collected_energy, neglog) ~\anaconda3\envs\deepdrr2\lib\site-packages\deepdrr\projector\projector.py in _get_kernel_projector_module(num_materials) ~\anaconda3\envs\deepdrr2\lib\site-packages\pycuda\compiler.py in init(self, source, nvcc, options, keep, no_extern_c, arch, code, cache_dir, include_dirs) ~\anaconda3\envs\deepdrr2\lib\site-packages\pycuda\compiler.py in compile(source, nvcc, options, keep, no_extern_c, arch, code, cache_dir, include_dirs, target) ~\anaconda3\envs\deepdrr2\lib\site-packages\pycuda\compiler.py in compile_plain(source, options, keep, nvcc, cache_dir, target) CompileError: nvcc compilation of C:\Users\Samer\AppData\Local\Temp\tmpyoq75wm0\kernel.cu failed kernel.cu(363): error: expected an expression kernel.cu(371): error: expected an expression kernel.cu(324): warning: variable "px" was set but never used kernel.cu(324): warning: variable "py" was set but never used kernel.cu(324): warning: variable "pz" was set but never used kernel.cu(327): warning: variable "boundary_factor" was set but never used 3 errors detected in the compilation of "kernel.cu". |
After installing the project via Setup:
Also same error with this setup:
Both Cuda installations were tested against the examples from the respective installation. Was the framework tested against windows? If yes, what were the respective versions of the cuda and cpp compilers used? The errors in the cuda code occur where ever the macro INTERPOLATE is used. I suspect, that the compile chains I have tested dont resolve the macros right. Maybe, some preprocessor directives are not set right for windows... Edit: nvcc --cubin -D NUM_MATERIALS=3 -arch sm_75 -m64 -E -IC:\Users\max\Documents\deepdrr\deepdrr\projector\cubic -Ic:\users\max\miniconda3\envs\deepdrr\lib\site-packages\pycuda\cuda C:\Users\max\AppData\Local\Temp\tmpnusjoa2s\kernel.cu See the preprocessed code here: preprocessed_kernel_cud11_msvc192.txt (renamed to .txt for github) I am not an expert in cpp and macros, but the macro from kernel.cu(363) INTERPOLATE(0.5 * lastStepsize); was resolved to ({
({ output[idx + (0)] += (0.5 * lastStepsize) * tex3D(volume, px, py, pz) * round(cubicTex3D(seg_0, px, py, pz));});
({ output[idx + (1)] += (0.5 * lastStepsize) * tex3D(volume, px, py, pz) * round(cubicTex3D(seg_1, px, py, pz));});
({ output[idx + (2)] += (0.5 * lastStepsize) * tex3D(volume, px, py, pz) * round(cubicTex3D(seg_2, px, py, pz));});
}); , which looks okay to me. (I added in the line breaks and indents for readability in this post) I am not sure about all the brackets and if that would make the compiler think its not an expression, hence the error. But the preprocessing seems to work and I dont think this would be different with gcc, which the readme stated to use. So still no idea what the problem is. Hope this helps someone else. Thanks for the help in advance, |
The parenthesis in the macro UPDATE and INTERPOLATE are causing problems when compiling on windows. See arcadelab#26 for more details.
It looks like the pull request found the problem in the INTERPOLATE macro in the cuda kernel. I suspect there is a difference between Windows and Linux here. Thanks for the pull request! I will take a look. |
Yes it looks like a Win/Linux thing! Please let me know if you find out the root problem, I would very much be interested in that! As you can see in the proposed changes, the Why this works on Linux and not on Windows, I have no clue. Bear in mind, that this change was only tested against cuda 11.2 and 10.2 and their respective host cpp compilers (MSVC 192x and 190x if I remember correctly). Please make sure it does not break your linux setup. |
The parenthesis in the macro UPDATE and INTERPOLATE are causing problems when compiling on Windows. See arcadelab#26 for more details. This is a second pull request, as the changes in arcadelab#29 got lost by mistake.
Hello,
I am really interested in using your program, but I keep getting an error when trying the example script.
The first error is in this line:
carm = deepdrr.CArm(isocenter=center)
I get this error : TypeError: init() missing 1 required positional argument: 'isocenter_distance'
So I add a random value of 800 to read : carm = deepdrr.CArm(isocenter=center, isocenter_distance=800)
and it runs. But in this line a get a long error message:
CompileError: nvcc compilation of C:\Users\Samer\AppData\Local\Temp\tmprdw5qsft\kernel.cu failed
[command: nvcc --cubin -D NUM_MATERIALS=3 -arch sm_75 -m64 -IC:\Users\Samer\anaconda3\envs\deepdrr2\Lib\site-packages\deepdrr\projector\cubic -Ic:\users\samer\anaconda3\envs\deepdrr2\lib\site-packages\pycuda\cuda kernel.cu]
[stdout:
kernel.cu(351): error: expected an expression
kernel.cu(363): error: expected an expression
kernel.cu(371): error: expected an expression
kernel.cu(324): warning: variable "px" was set but never used
kernel.cu(324): warning: variable "py" was set but never used
kernel.cu(324): warning: variable "pz" was set but never used
kernel.cu(327): warning: variable "boundary_factor" was set but never used
3 errors detected in the compilation of "kernel.cu".
kernel.cu
]
Some Information about my system. I am running python 3.9 under windows 10 through a jupyter Notebook.
I have CUDA 11 installed. I tried using pycuda (https://documen.tician.de/pycuda/tutorial.html) And I had no errors.
I can run tensorflow CNN on my machine without errors edit: (in R).
edit: I also added the path to cl.exe to the envoronment variables.
I would be very thankful if you could you maybe help find where this error is coming from.
The text was updated successfully, but these errors were encountered: