compiling error for cuda-gdb-9.2.148

I am installing the cuda 9.2 one x86_64-pc-linux-gnu CentOS Linux 7.5, but encountered the following error. Will you please help to solve this issue? Thank you very much.

g++ -g -O2 -I. -I. -I./common -I./config -DLOCALEDIR=""/home/bliang/sbin/cuda/cuda-gdb-9.2.148/share/locale"" -DHAVE_CONFIG_H -I./…/include/opcode -I./…/opcodes/… -I./…/readline/… -I./…/zlib -I…/bfd -I./…/bfd -I./…/include -I…/libdecnumber -I./…/libdecnumber -I./gnulib/import -Ibuild-gnulib/import -DTUI=1 -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wno-sign-compare -Wno-write-strings -Wno-narrowing -Wformat-nonliteral -c -o gdb.o -MT gdb.o -MMD -MP -MF .deps/gdb.Tpo gdb.c
g++ -g -O2 -I. -I. -I./common -I./config -DLOCALEDIR=""/home/bliang/sbin/cuda/cuda-gdb-9.2.148/share/locale"" -DHAVE_CONFIG_H -I./…/include/opcode -I./…/opcodes/… -I./…/readline/… -I./…/zlib -I…/bfd -I./…/bfd -I./…/include -I…/libdecnumber -I./…/libdecnumber -I./gnulib/import -Ibuild-gnulib/import -DTUI=1 -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wno-sign-compare -Wno-write-strings -Wno-narrowing -Wformat-nonliteral -c -o cuda-api.o -MT cuda-api.o -MMD -MP -MF .deps/cuda-api.Tpo cuda-api.c
g++ -g -O2 -I. -I. -I./common -I./config -DLOCALEDIR=""/home/bliang/sbin/cuda/cuda-gdb-9.2.148/share/locale"" -DHAVE_CONFIG_H -I./…/include/opcode -I./…/opcodes/… -I./…/readline/… -I./…/zlib -I…/bfd -I./…/bfd -I./…/include -I…/libdecnumber -I./…/libdecnumber -I./gnulib/import -Ibuild-gnulib/import -DTUI=1 -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wno-sign-compare -Wno-write-strings -Wno-narrowing -Wformat-nonliteral -c -o cuda-autostep.o -MT cuda-autostep.o -MMD -MP -MF .deps/cuda-autostep.Tpo cuda-autostep.c
cuda-autostep.c: In function ‘int cuda_initialize_device_autostep(CORE_ADDR)’:
cuda-autostep.c:477:50: error: invalid conversion from ‘int’ to ‘cuda_select_t’ [-fpermissive]
CUDA_SELECT_BKPT | CUDA_SELECT_VALID);
^
In file included from cuda-autostep.c:28:0:
cuda-iterator.h:36:15: error: initializing argument 3 of ‘cuda_iterator_t* cuda_iterator_create(cuda_iterator_type, cuda_coords_t*, cuda_select_t)’ [-fpermissive]
cuda_iterator cuda_iterator_create (cuda_iterator_type type,
^
make[2]: *** [cuda-autostep.o] Error 1
make[2]: Leaving directory $HOME/sbin/cuda/cuda-gdb-9.2.148/gdb' make[1]: *** [all-gdb] Error 2 make[1]: Leaving directory $HOME/sbin/cuda/cuda-gdb-9.2.148’
make: *** [all] Error 2

If you are attempting to compile cuda-gdb, it should not be necessary as that tool is compiled for you already

Sorry, what I meant is to install the cuda. Thanks.

what you are showing here isn’t necessary for a typical CUDA install

You won’t need to do this if you follow the instructions in the CUDA linux install guide

Thanks for the reply. The reason I didn’t do a typical CUDA install is that I don’t have the root/administrator permissions. I could not access many default directories as a user. Therefore I have to install in a non-typical way. Do you have any way to solve the issue?

Or alternatively, please instruct with guidelines how to install cuda 9.2 on my computer as a user in a user-specified path? Thanks for the help.

run the linux runfile installer, but specify your own path for installation of the toolkit. The linux runfile installer will prompt you for the installation path. Just specify a directory that is in your own user space.

You’ll need to skip the driver install. If the machine you are running your code on has a driver installed that is new enough, this should not be an issue.

If the machine you are running on has a (too-) old driver install, or no driver install, then the only way to rectify that is with root permission. Root permission is required to install the driver. If you don’t have a GPU driver installed, you will not be able to run CUDA codes. Likewise for GPU. If you have no GPU, you won’t be able to run CUDA codes.

In other respects, follow the instructions in the linux install guide for runfile installation.

Note that when you get to section 7, you’ll need to specify paths for PATH and LD_LIBRARY_PATH that are appropriate for whatever install path you entered. Don’t use /usr/local/… as you will presumably not have installed there.

get the linux runfile installer from http://www.nvidia.com/getcuda

Thank you. Downloading now. Will test to see it works.

A quick follow up question: how can I get an older version of runfile installer? such as 9.2. Thanks.

The legacy cuda toolkits page is linked from the getcuda page I already gave you. Read the whole page. Look for the link “Legacy Releases”

Thanks, Robert.

I have downloaded cuda_9.2.148_396.37_linux.run, but since it asks for sudo sh I still could not install. I tried sh cuda_9.2.148_396.37_linux.run, but in question 3/4 it asks for sudo privilege.

I looked the error again, it looks like cuda.h is missing.
…/…/gdb/cuda-gdb.c:19:18: fatal error: cuda.h: No such file or directory
#include “cuda.h”
^
compilation terminated.

I searched …/…/gdb/ folder, and it doesn’t have cuda.h. Is possible this is a bug? Thanks.

You seem to want to get a version of CUDA installed. Compiling cuda-gdb is not equivalent to getting a version of CUDA installed.

To install the cuda 9.2 runfile installer in a local directory that you have write access to, perform the following steps. Let’s assume that the local directory that you have write access to is:

/home/myuser/cuda

Then do the following:

sh cuda_9.2.148_396.37_linux.run

press spacebar to advance through the EULA

type accept to accept the EULA

press n when prompted to install the driver

press y when prompted to install the cuda toolkit

enter your local directory, which per the description above we are pretending is:

/home/myuser/cuda

press n when prompted to install a symbolic link (You will need to use the environment variables defined in section 7 instead)

press n when prompted to install the samples

The above sequence will install the cuda toolkit (and you will get a precompiled version of cuda-gdb) without any need for root privilege.

be sure to follow section 7 in the install guide, using your install directory /hyome/myuser/cuda as a guide.

and all of this assumes you have an appropriate and new enough gpu driver installed.

Thanks. It got installed this way. I will see if it runs into any problems. Thanks again.