hi there,
I’m having the exact same problem, and I am using ubuntu 710 as well. Nvidia 8800GTS, NVIDIA_CUDA_SDK_1.1_Linux.run, NVIDIA_CUDA_Toolkit_1.1_Ubuntu7_x86_64.run.
has anyone managed to find out what the problem is?
thank you,
hi there,
I’m having the exact same problem, and I am using ubuntu 710 as well. Nvidia 8800GTS, NVIDIA_CUDA_SDK_1.1_Linux.run, NVIDIA_CUDA_Toolkit_1.1_Ubuntu7_x86_64.run.
has anyone managed to find out what the problem is?
thank you,
I am also having the same problem as Pedro and Amael, in Ubuntu 8.04. It seems there has not been any solution posted for it. Does anyone have any ideas or suggestions about how to resolve this problem? Thanks a lot! I hope I can get this working! Here is the beginning of my error messages:
Does this work if you’re not using cmake ?
If you mean compiling cuda code in general, yes - the makefiles provided for the NVidia examples work just fine after setting up my system based on this guide
Sorry I didn’t mention it, but the errors I got were from trying to compile the findcuda.CMake example project following the instructions here.
Thanks for the reply!
Does this FindCUDA.cmake script work with Visual Studio 9 (2008) under Windows XP using a GeForce 8600m GT? When I attempt to build my project, I hit a host of problems. Let me explain…
First error is this…
CMake Error at CUDA/CMake/cuda/FindCuda.cmake:130 (MESSAGE):
Specify CUDA_INSTALL_PREFIX
Call Stack (most recent call first):
CMakeLists.txt:4 (INCLUDE)
To which I manually set the CUDA_INSTALL_PREFIX to C:\CUDA\bin
Then next…
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_FIND_LIBRARY_PREFIXES
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_FIND_LIBRARY_SUFFIXES
CMake Error at CUDA/CMake/cuda/FindCuda.cmake:180 (MESSAGE):
Could not find cudart library (cudart)
Call Stack (most recent call first):
CMakeLists.txt:4 (INCLUDE)
To which I manually set FOUND_CUDART to C:\CUDA\lib
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_FIND_LIBRARY_PREFIXES
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_FIND_LIBRARY_SUFFIXES
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_FIND_LIBRARY_PREFIXES
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_FIND_LIBRARY_SUFFIXES
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_FIND_LIBRARY_PREFIXES
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_FIND_LIBRARY_SUFFIXES
I then set FOUND_CUT to C:\Program Files\NVIDIA Corporation\NVIDIA CUDA SDK\common\inc
Which leads to the following error, where I get stuck…
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_FIND_LIBRARY_PREFIXES
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_FIND_LIBRARY_SUFFIXES
What could I possibly be doing wrong? I thought that this script was supposed to find CUDA automatically. Could it be that I am using a mobile GPU that is causing issues? My CUDA installation is all default, version 1.1.
Cheers,
Mike
Sorry, please disregard my previous post. My supervisor encouraged me to include the CUDA script before declaring the project. This is obviously not right. If I declare it after the project, it works well. The only thing it does not do is set the additional libraries correctly. That should prove not too difficult, but please feel free to make suggestions.
Thank you Abe for providing FindCUDA.cmake to us all.
Mike
Hi!!
I’m using FindCuda.cmake to compile a project with Visual Studio 2005.
But if I build solution by Visual Studio the output is:
If I compile by command line I’ve the same error (stop building with cudafe error) but the output is:
What’s the error?
Thank you!!
Several developers reported this issue directly via email. Newer versions of the toolkit (e.g. version string “Built on Tue_Jun_10_04:42:57_PDT_2008”) produce .cpp files (not .c) with the -cuda option.
To check for yourself run:
cd build
nvcc -cuda ../src/test_bin.cu -I../src; ls test_bin*
# The output should be:
test_bin.cu.cpp
The svn HEAD revision of the script is not necessarily backwards compatible. Try updating your version of the toolkit or checking out an older version of the script from svn. The svn log contains notes about updates for specific nvcc platforms and versions.
This is unrelated to use of the --host-compilation flag which is necessary when the .cu file contains c++ host code. To add flags to the nvcc command modify the CMake variable CUDA_NVCC_FLAGS (note the use of semi-colons in place of spaces).
Abe
I upgraded to the CUDA Toolkit 2.0 Beta for Ubuntu 7.10 (I’m running 8.04 though), and it works! Thanks Abe!
The example project compiles and runs just fine. Now I want to compile something which includes cutil.h. If I add
#include<cutil.h>
to main.cc in the example project (this is the only change), cmake runs fine, then when I run make I get:
error: cutil.h: No such file or directory
This is expected, because I need to somehow tell CMake that “test” depends on “cutil.h” I have been struggling all day on this, searching forums and the CMake documentation for how to do this, but I have just had no success. I’ve tried all kinds of permutations like
TARGET_LINK_LIBRARIES(
test ${CUDA_CUT_INCLUDE}
)
in the /src/CMakeLists.txt file, with various names mentioned on the findcuda.cmake page, and the error never goes away. I have the feeling it’s something trivial I am missing because I am new to CMake. Does anyone know how to set this up? Any help would be greatly appreciated!
Check here. I posted my cmakelists.txt that links other files, this might help you.
You probably mean
INCLUDE_DIRECTORIES( ${CUDA_CUT_INCLUDE} )
TARGET_LINK_LIBRARIES( my_target ${CUDA_CUT_TARGET_LINK} )
Hi, There is a much newer version of FindCUDA.cmake in a different location:
[url=“MyGForge > Projects > FindCUDA > Home”]MyGForge > Projects > FindCUDA > Home
svn co [url=“https://gforge.sci.utah.edu/svn/findcuda/trunk”]https://gforge.sci.utah.edu/svn/findcuda/trunk[/url] CMake-cuda
This version is significantly more stable than the original and has several new features, please see FindCUDA.html in the repository for details. Thank you to everyone who sent me bug reports over the past 2+ years–we’ve tried to get this new version out for the last 6-8 months, and it should fix nearly all of the issues reported.
Abe
Great work! The new FindCUDA.cmake is indeed significantly improved. I’ll be switching HOOMD over to it as soon as I have the time to. Almost all of the hacks I’ve applied to the old FindCUDA.cmake, along with a few that issues I haven’t gotten around to fixing yet, are implemented the right way in your new one :)
There is only one issue I see. Are you aware that CUDA 2.2 exposes that --device-emulation and -cubin are incompatible compilation options when compiling C++ .cu code? http://forums.nvidia.com/index.php?showtop…22&hl=CMake
Everything works when you compile with -c instead of -cuda. You can set generated_extension to .o and then add
SET_SOURCE_FILES_PROPERTIES(
${generated_file}
PROPERTIES
EXTERNAL_OBJECT true # to say that "this is actually an object file, so it should not be compiled, only linked"
GENERATED true # to say that "it is OK that the obj-files do not exist before build time"
)
The problem with this is that now nvcc is compiling the host code and the user chosen CMAKE_CXX_FLAGS are not being used. So there is either no debug symbols or no optimization :( In my hack, I just assumed that the user choosing emulation mode would be doing to debug and just added debug command line options with -Xcompiler. I couldn’t figure out a way to forward the actual target dependent CXX_FLAGS in the general case as the visual studio generator creates all targets with a single configure.
Anyways, with your new setup it would be a simple enough matter to change the generated_extension and use set_source_file_properties only if emulation mode is set so that the normal device compilation is unaffected.
Thanks for the compliment. I spent a number of months reworking the script. This script is actually used quite heavily for a project we are developing internally to NVIDIA that will be released later this year.
Yeah, I played around a little bit with the direct to object file compilation, but ran into the same issues you described. The flags used to compile the code by nvcc aren’t the same ones used by the regular build chain. I need to get the CMAKE_C_FLAGS and friends and add them to nvcc using -Xcompiler.
James
Has anybody gotten used the newest version with gcc and the -pedantic option? In the original version this was no problem, as it seems it failed to pass the CPP-flags to the gcc. However as the newest versions fix this problem it will now bail out on the usage of “long long” in the fatbin.c files.
Of course an easy solution would be to remove -pedantic from CPP-flags, however I would prefer to still compile my normal cpp code with -pedantic and only exclude this option for the code generated from .cu files (as I only put launcher functions in those anyways). Any ideas on how to achieve that?
anyone know how to define -arch sm_11 in the cmake file?
Add the following to your CMakeList.txt:
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -arch=sm_11)
Thank you
I feel a bit stupid about this, but how do I make this work at all?
I can’t seem to get CMake to do even the simplest things.
[codebox]$ svn co https://gforge.sci.utah.edu/svn/findcuda/trunk FindCUDA
letharion@Sylvanas ~/FindCUDA $ cmake .
– The C compiler identification is GNU
– The CXX compiler identification is GNU
– Check for working C compiler: /usr/bin/gcc
– Check for working C compiler: /usr/bin/gcc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working CXX compiler: /usr/bin/c++
– Check for working CXX compiler: /usr/bin/c++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Configuring done
– Generating done
– Build files have been written to: /home/letharion/FindCUDA
letharion@Sylvanas ~/FindCUDA $ make
[ 16%] Building NVCC (Device) object src/./cuda_compile_generated_test_bin.cu.o
Scanning dependencies of target cuda_compile_example
[ 33%] Building CXX object src/CMakeFiles/cuda_compile_example.dir/main.cc.o
Linking CXX executable cuda_compile_example
[ 33%] Built target cuda_compile_example
[ 50%] Building NVCC (Device) object src/./test_lib_generated_test_lib.cu.o
Scanning dependencies of target test_lib
Linking CXX shared library libtest_lib.so
[ 50%] Built target test_lib
Scanning dependencies of target lib_example
[ 66%] Building CXX object src/CMakeFiles/lib_example.dir/main_for_lib.cc.o
Linking CXX executable lib_example
[ 66%] Built target lib_example
[ 83%] Building NVCC (Device) object src/./test_generated_test_bin.cu.o
Scanning dependencies of target test
[100%] Building CXX object src/CMakeFiles/test.dir/main.cc.o
Linking CXX executable test
[100%] Built target test
letharion@Sylvanas ~/FindCUDA $ mkdir test && cd test && vim CMakeLists.txt
letharion@Sylvanas ~/FindCUDA $ cat CMakeLists.txt
cmake_minimum_required(VERSION 2.6)
SET(CMAKE_MODULE_PATH “${CMAKE_SOURCE_DIR}/CMake/cuda” ${CMAKE_MODULE_PATH})
FIND_PACKAGE(CUDA)
letharion@Sylvanas ~/FindCUDA/test $ cmake .
CMake Warning at CMakeLists.txt:3 (FIND_PACKAGE):
Could not find module FindCUDA.cmake or a configuration file for package
CUDA.
Adjust CMAKE_MODULE_PATH to find FindCUDA.cmake or set CUDA_DIR to the
directory containing a CMake configuration file for CUDA. The file will
have one of the following names:
CUDAConfig.cmake
cuda-config.cmake
– Configuring done
– Generating done
– Build files have been written to: /home/letharion/FindCUDA/test[/codebox]
Ah. Moving the FindCUDA.cmake to /usr/share/cmake/Modules did the trick :)