Restart NVidia Jetson board into recovery mode
Assuming you have flashed your Jetson module (TX, Xavier, Nano, etc) and you want to set it into recovery mode to flash another image. Just… Read More »Restart NVidia Jetson board into recovery mode
Assuming you have flashed your Jetson module (TX, Xavier, Nano, etc) and you want to set it into recovery mode to flash another image. Just… Read More »Restart NVidia Jetson board into recovery mode
This article covering how to change the NVidia Jetson modules partition layout using yocto + meta-tegra layer, and is basically a summary of this issue.… Read More »Partitioning NVIdia Jetson module
I’ve had a computer in a network running a CI. Everything works locally but then as soon as I connect form VPN, I cannot access… Read More »Fix docker blocking VPN access
I’m running LinuxMint 19.3 and with default setup, sdkmanager won’t work and flashing will fail. Download sdkmanager form NVidia’s website and install it Make a… Read More »Flash Xavier on Linux Mint
Today I needed to upgrade GCC to a newer version than what comes from aptitude. I’m on LinuxMint 18.3 First make sure to remove gcc… Read More »Compile and install GCC on Linux
https://arrayfire.com/ is a great library providing an abstraction layer for different kinds of acceleration technologies: CPU, OpenCL and CUDA. You write your code once and… Read More »Exporting ArrayFire CUDA kernels to files
I have CUDA 9.2 installed at /usr/local/cuda-9.2/.
Create a QtCreator console project
In the project file add:
CUDA_DIR = /usr/local/cuda-9.2
CUDA_LIBS = -lcudart -lcuda
INCLUDEPATH += $$CUDA_DIR/include
QMAKE_LIBDIR += $$CUDA_DIR/lib64
LIBS += $$CUDA_LIBS
#####################################################################
# CUDA compiler configuration #
#####################################################################
# GPU architecture
SYSTEM_TYPE = 64
CUDA_ARCH = sm_30
NVCCOPTIONS = -use_fast_math -O2
# Mandatory flags for stepping through the code
debug {
NVCCOPTIONS += -g -G
}
# Prepare the extra compiler configuration (taken from the nvidia forum - i'm not an expert in this part)
CUDA_INC = $$join(INCLUDEPATH,' -I','-I',' ')
cuda.input = CUDA_SOURCES
cuda.output = ${OBJECTS_DIR}${QMAKE_FILE_BASE}_cuda.o
cuda.commands = $$CUDA_DIR/bin/nvcc $$NVCCOPTIONS $$CUDA_INC $$CUDA_LIBS --machine $$SYSTEM_TYPE -arch=$$CUDA_ARCH -c -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME} 2>&1 | sed -r \"s/\\(([0-9]+)\\)/:\\1/g\" 1>&2
cuda.dependency_type = TYPE_C
QMAKE_EXTRA_COMPILERS += cuda
Code language: Bash (bash)
Change CUDA_DIR to match your version
Add the .cu files with project files as
CUDA_SOURCES += cuda_helloworld.cu
Code language: Bash (bash)
Next step is to configure QtCreator to use cuda-gdb instead of gdb
Check where cuda-gdb is located
$ which cuda-gdb
/usr/local/cuda-9.2/bin/cuda-gdb
Code language: Bash (bash)
Go to QtCreator > Option > Kit > Debuggers > Add
Give it a name and the cuda gdb path
Then go to QtCreator > Options > Kits > Kits > Select the Desktop kit you’d like to use. For me Desktop Qt 5.13.0 GCC 64bit.
In the Debugger combo box select the cuda debugger you’d like to use.
Now you can add break points to native code as well as CUDA kernels. If after all these steps you are not able to get cuda-gdb working, make sure your GPU isn’t too old. To be able to debug with X server on, you need a graphics card with compute capability of >= 3.2. I had for example a GTX 650 on one PC and I was not able to debug or run the application at all. See https://en.wikipedia.org/wiki/CUDA
Read More »Adding CUDA compiler to QtCreator