To complement the CMake scripts posted by Abe, here is a small script to use qmake to generate CUDA projects on both linux and windows (where it can generate Visual Studio projects):
You can add this in you .pro files and then you just have to specify the CUDA source files in CUDA_SOURCES variable. I tested it on both windows and linux. On windows it works fine for generating Makefile but requires a change in qmake to generate VS projects. I have to package and submit the required patch to Trolltech…
Thanks for the great head start!
But I have a questen, which I was unable to get answered by google.
Maybe one of your guys could help me with that.
Is is possible to add another configuration like ‘debug’ or ‘release’ to the project by using qmake? I’d like to have a special Device-Emu-Config, just like in the SDK-Examples.
How would I accomplish that?
sorry for the newbie question, but I’m having hard time incorporating the above code into my qmake file. Can someone please post a complete qmake file using, for example, the matrixMul project in the 1.1 SDK? I’m using ubuntu 7.10 with SDK 1.1, 8800GTS.
I am also using Qt to develop cuda code, but I can not debug my .cu code. I can step into .cu file, but I can not step into the cuda kernels. I also tried run cuda-gdb in terminal, but I can not step into the cuda kernels either. What do I need to change for my .pro file? Thank you very much.
Best,
Wu
[codebox]
Path to opencv install
OPENCV_DIR = /usr/local/opencv
Path to cuda SDK install
CUDA_SDK = /home/wu/NVIDIA_GPU_Computing_SDK/C
Path to cuda toolkit install
CUDA_DIR = /usr/local/cuda
#CUDA_DIR = $$system(which nvcc | sed ‘s,/bin/nvcc$,’)
host_part\HemicubeMipMapper\test_host.cpp: In member function ‘void MainWindow::test_main(const std::vector<int, std::allocator >&, const std::vector<double, std::allocator >&)’:
I have used this thread to design my own project file, which works fine with CUDA 3.0 but does not with the latest version 3.2.
Please see this thread for more details: http://forums.nvidia.com/index.php?showtopic=188501