pjreddie / darknet

Convolutional Neural Networks
http://pjreddie.com/darknet/
Other
25.78k stars 21.33k forks source link

nvcc fatal : Unsupported gpu architecture 'compute_75' #1874

Closed CaptianFluffy100 closed 5 years ago

CaptianFluffy100 commented 5 years ago

nvcc -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] -gencode arch=compute_70,code=[sm_70,compute_70] -gencode arch=compute_72,code=[sm_72,compute_72] -gencode arch=compute_75,code=[sm_75,compute_75] -Iinclude/ -Isrc/ -DOPENCV pkg-config --cflags opencv -DGPU -I/usr/local/cuda/include/ --compiler-options "-Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -DGPU" -c ./src/convolutional_kernels.cu -o obj/convolutional_kernels.o nvcc fatal : Unsupported gpu architecture 'compute_75' Makefile:95: recipe for target 'obj/convolutional_kernels.o' failed make: *** [obj/convolutional_kernels.o] Error 1

My GPU is GTX 1660 ti nvidia-smi: +-----------------------------------------------------------------------------+ | NVIDIA-SMI 418.87.00 Driver Version: 418.87.00 CUDA Version: 10.1 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 GeForce GTX 166... On | 00000000:1F:00.0 On | N/A | | 45% 40C P8 11W / 120W | 464MiB / 5911MiB | 1% Default | +-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=============================================================================| | 0 1150 G /usr/lib/xorg/Xorg 24MiB | | 0 1238 G /usr/bin/gnome-shell 49MiB | | 0 1520 G /usr/lib/xorg/Xorg 181MiB | | 0 1664 G /usr/bin/gnome-shell 127MiB | | 0 2336 G ...uest-channel-token=11404328327218669122 79MiB | +-----------------------------------------------------------------------------+

I am using Ubuntu 18.04 LTS.

Make file for GPU ARCH:

GPU=1 CUDNN=0 OPENCV=1 OPENMP=0 DEBUG=0

ARCH= -gencode arch=compute_30,code=sm_30 \ -gencode arch=compute_35,code=sm_35 \ -gencode arch=compute_50,code=[sm_50,compute_50] \ -gencode arch=compute_52,code=[sm_52,compute_52] \ -gencode arch=compute_70,code=[sm_70,compute_70] \ -gencode arch=compute_72,code=[sm_72,compute_72] \ -gencode arch=compute_75,code=[sm_75,compute_75]

-gencode arch=compute_20,code=[sm_20,sm_21] \ This one is deprecated?

This is what I use, uncomment if you know your arch and want to specify

ARCH= -gencode arch=compute_52,code=compute_52

VPATH=./src/:./examples SLIB=libdarknet.so ALIB=libdarknet.a EXEC=darknet OBJDIR=./obj/

CC=gcc CPP=g++ NVCC=nvcc AR=ar ARFLAGS=rcs OPTS=-Ofast LDFLAGS= -lm -pthread COMMON= -Iinclude/ -Isrc/ CFLAGS=-Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC

ifeq ($(OPENMP), 1) CFLAGS+= -fopenmp endif

ifeq ($(DEBUG), 1) OPTS=-O0 -g endif

CFLAGS+=$(OPTS)

ifeq ($(OPENCV), 1) COMMON+= -DOPENCV CFLAGS+= -DOPENCV LDFLAGS+= pkg-config --libs opencv -lstdc++ COMMON+= pkg-config --cflags opencv endif

ifeq ($(GPU), 1) COMMON+= -DGPU -I/usr/local/cuda/include/ CFLAGS+= -DGPU LDFLAGS+= -L/usr/local/cuda/lib64 -lcuda -lcudart -lcublas -lcurand endif

ifeq ($(CUDNN), 1) COMMON+= -DCUDNN CFLAGS+= -DCUDNN LDFLAGS+= -lcudnn endif

OBJ=gemm.o utils.o cuda.o deconvolutional_layer.o convolutional_layer.o list.o image.o activations.o im2col.o col2im.o blas.o crop_layer.o dropout_layer.o maxpool_layer.o softmax_layer.o data.o matrix.o network.o connected_layer.o cost_layer.o parser.o option_list.o detection_layer.o route_layer.o upsample_layer.o box.o normalization_layer.o avgpool_layer.o layer.o local_layer.o shortcut_layer.o logistic_layer.o activation_layer.o rnn_layer.o gru_layer.o crnn_layer.o demo.o batchnorm_layer.o region_layer.o reorg_layer.o tree.o lstm_layer.o l2norm_layer.o yolo_layer.o iseg_layer.o image_opencv.o EXECOBJA=captcha.o lsd.o super.o art.o tag.o cifar.o go.o rnn.o segmenter.o regressor.o classifier.o coco.o yolo.o detector.o nightmare.o instance-segmenter.o darknet.o ifeq ($(GPU), 1) LDFLAGS+= -lstdc++ OBJ+=convolutional_kernels.o deconvolutional_kernels.o activation_kernels.o im2col_kernels.o col2im_kernels.o blas_kernels.o crop_layer_kernels.o dropout_layer_kernels.o maxpool_layer_kernels.o avgpool_layer_kernels.o endif

EXECOBJ = $(addprefix $(OBJDIR), $(EXECOBJA)) OBJS = $(addprefix $(OBJDIR), $(OBJ)) DEPS = $(wildcard src/*.h) Makefile include/darknet.h

all: obj backup results $(SLIB) $(ALIB) $(EXEC)

all: obj results $(SLIB) $(ALIB) $(EXEC)

$(EXEC): $(EXECOBJ) $(ALIB) $(CC) $(COMMON) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(ALIB)

$(ALIB): $(OBJS) $(AR) $(ARFLAGS) $@ $^

$(SLIB): $(OBJS) $(CC) $(CFLAGS) -shared $^ -o $@ $(LDFLAGS)

$(OBJDIR)%.o: %.cpp $(DEPS) $(CPP) $(COMMON) $(CFLAGS) -c $< -o $@

$(OBJDIR)%.o: %.c $(DEPS) $(CC) $(COMMON) $(CFLAGS) -c $< -o $@

$(OBJDIR)%.o: %.cu $(DEPS) $(NVCC) $(ARCH) $(COMMON) --compiler-options "$(CFLAGS)" -c $< -o $@

obj: mkdir -p obj backup: mkdir -p backup results: mkdir -p results

.PHONY: clean

clean: rm -rf $(OBJS) $(SLIB) $(ALIB) $(EXEC) $(EXECOBJ) $(OBJDIR)/* When i run: ./darknet detect cfg/yolov3.cfg yolov3.weights data/dog.jpg

After 106 yolo Loading weights from yolov3.weights...Done! CUDA Error: invalid device symbol darknet: ./src/cuda.c:36: check_error: Assertion `0' failed. Aborted (core dumped)

CaptianFluffy100 commented 5 years ago

https://devtalk.nvidia.com/default/topic/1045400/cuda-setup-and-installation/cuda-10-installation-problems-on-ubuntu-18-04/

The go to vitaliy.gyrya post half way dow the screen.

The problem is nvcc not being the same as your cuda version.

muzairkhattak commented 4 years ago

I had the similar problem regarding this ,but I solved the issue by simply un-commenting ARCH line in my make file according to my GPU (WHICH IS GTX 1060 ) , after that , that error was fixed.

wangxinglong1990 commented 4 years ago

I had the similar problem regarding this ,but I solved the issue by simply un-commenting ARCH line in my make file according to my GPU (WHICH IS GTX 1060 ) , after that , that error was fixed.

May I please ask how you done that, I'm a new learner who face that issue, could you please show me the code?

muzairkhattak commented 4 years ago

I had the similar problem regarding this ,but I solved the issue by simply un-commenting ARCH line in my make file according to my GPU (WHICH IS GTX 1060 ) , after that , that error was fixed.

May I please ask how you done that, I'm a new learner who face that issue, could you please show me the code?

Yes, I fixed this problem by uncommenting the ARCH line, which is present in the makefile. Just edit the makefile, It is present in the darknet folder among the other files.

wangxinglong1990 commented 4 years ago

I had the similar problem regarding this ,but I solved the issue by simply un-commenting ARCH line in my make file according to my GPU (WHICH IS GTX 1060 ) , after that , that error was fixed.

May I please ask how you done that, I'm a new learner who face that issue, could you please show me the code?

Yes, I fixed this problem by uncommenting the ARCH line, which is present in the makefile. Just edit the makefile, It is present in the darknet folder among the other files.

Thank you for your reply, I was using that for Gromacs installation, and it was treaky until I used the lastest version of Gromacs everything resolved automatically

hamdii02 commented 3 years ago

Just change the NVCC=nvcc line in ur makefile to NVCC="nvcc path in ur cuda bin location" for example : NVCC=/usr/local/cuda-11.3/bin/nvcc

changing this fixed my issue.