[vtkusers] compiling VTK against CUDA 4.2
David E DeMarle
dave.demarle at kitware.com
Tue Jul 31 09:26:31 EDT 2012
I don't think that file in VTK is meant to be compiled against CUDA as
it stands. It does appear to have code in it that came from something
that could be compiled with nvcc but I am guessing those code paths
are unused in VTK.
The only part of VTK that I am aware of that uses CUDA is the brand new
Accelerators/Piston module. It is in current git master (post VTK
5.10). Look at it's CMakeLists.txt to see how code that uses CUDA can
be brought into VTK.
And I think that Dženan is right. The message you are getting means
that CMake isn't able to use nvcc directly as a replacement for
gcc/icc/vs/what_have_you. Compiling CMake itself with nvcc isn't the
right path to follow.
David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909
On Tue, Jul 31, 2012 at 4:12 AM, Dženan Zukić <dzenanz at gmail.com> wrote:
> Even if you did somehow succeed at building CMake using nvcc, it would make
> no difference. What that error is saying is: nvcc cannot compile even a
> simple C Hello World.
>
> I know that efficient interfacing between a scenegraph library and CUDA is
> not simple.
>
> On Tue, Jul 31, 2012 at 3:18 AM, Cook, Rich <cook47 at llnl.gov> wrote:
>>
>> Hello
>> I'm new to the list and apologize if this is obvious or seen before. I
>> Googled around a bit for the answer but cannot find it.
>>
>> My question seemed simple before I tried it. How does one compile VTK in
>> order to use CUDA? A user of mine requested this; I'm not a VTK expert and
>> am not sure specifically what she plans to do with the result.
>>
>> I see CUDA stuff like this in the source, making me think this should be
>> possible and the question at least makes sense to ask:
>>
>> ../VTK/Graphics/vtkYoungsMaterialInterface.cxx:77204:#ifdef __CUDACC__
>>
>> So, I tried a naive approach:
>>
>> export CC=nvcc
>> export CXX=nvcc
>> export CPP=nvcc
>>
>> mkdir vtk-build
>> cd vtk-build
>> cmake ../VTK
>>
>> cmake fails as follows, making me think maybe I have to build CMake with
>> nvcc as well? That would be a bit ugly, but I just want to make sure I'm
>> going down the right path.
>> Any help is greatly appreciated.
>>
>> rcook at edge84 (vtk-build): cmake ../VTK/
>> -- The C compiler identification is GNU
>> -- The CXX compiler identification is GNU
>> -- Check for working C compiler: /opt/cudatoolkit-4.2/bin/nvcc
>> -- Check for working C compiler: /opt/cudatoolkit-4.2/bin/nvcc -- broken
>> CMake Error at
>> /collab/usr/global/tools/Kitware/CMake/2.8.7/chaos_5_x86_64_ib/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52
>> (MESSAGE):
>> The C compiler "/opt/cudatoolkit-4.2/bin/nvcc" is not able to compile a
>> simple test program.
>>
>> It fails with the following output:
>>
>> Change Dir: /nfs/tmp2/rcook/VTK/5.10/vtk-build/CMakeFiles/CMakeTmp
>>
>>
>>
>> Run Build Command:/usr/bin/gmake "cmTryCompileExec/fast"
>>
>> /usr/bin/gmake -f CMakeFiles/cmTryCompileExec.dir/build.make
>> CMakeFiles/cmTryCompileExec.dir/build
>>
>> gmake[1]: Entering directory
>> `/nfs/tmp2/rcook/VTK/5.10/vtk-build/CMakeFiles/CMakeTmp'
>>
>> /collab/usr/global/tools/Kitware/CMake/2.8.7/chaos_5_x86_64_ib/bin/cmake
>> -E
>> cmake_progress_report
>> /nfs/tmp2/rcook/VTK/5.10/vtk-build/CMakeFiles/CMakeTmp/CMakeFiles 1
>>
>> Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o
>> /opt/cudatoolkit-4.2/bin/nvcc -o
>> CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -c
>> /nfs/tmp2/rcook/VTK/5.10/vtk-build/CMakeFiles/CMakeTmp/testCCompiler.c
>>
>> Linking C executable cmTryCompileExec
>>
>> /collab/usr/global/tools/Kitware/CMake/2.8.7/chaos_5_x86_64_ib/bin/cmake
>> -E
>> cmake_link_script CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1
>>
>> /opt/cudatoolkit-4.2/bin/nvcc
>> CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -o cmTryCompileExec
>> -rdynamic
>>
>> nvcc fatal : Unknown option 'rdynamic'
>>
>> gmake[1]: *** [cmTryCompileExec] Error 255
>>
>> gmake[1]: Leaving directory
>> `/nfs/tmp2/rcook/VTK/5.10/vtk-build/CMakeFiles/CMakeTmp'
>>
>> gmake: *** [cmTryCompileExec/fast] Error 2
>>
>>
>>
>>
>>
>> CMake will not be able to correctly generate this project.
>> Call Stack (most recent call first):
>> CMakeLists.txt:15 (PROJECT)
>>
>>
>>
>> --
>> ✐Richard Cook
>> ✇ Lawrence Livermore National Laboratory
>> Bldg-453 Rm-4024, Mail Stop L-557
>> 7000 East Avenue, Livermore, CA, 94550, USA
>> ☎ (office) (925) 423-9605
>> ☎ (fax) (925) 423-6961
>> ---
>> Information Management & Graphics Grp., Services & Development Div.,
>> Integrated Computing & Communications Dept.
>> (opinions expressed herein are mine and not those of LLNL)
>>
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
More information about the vtkusers
mailing list