Darknet: how to change configure of Makefile in multi cuda enviroment

Created on 20 Jan 2019  路  4Comments  路  Source: AlexeyAB/darknet

OS: Ubuntu 16.04
GPU: Tesla V100

Hi, @AlexeyAB , I have a multi cuda enviroment, before compiling source code with cuda10, I review the Makefile. I think something should be changed, but I am not sure, since I am beginner in Linux. So I want help from you

I had installed cuda9.0 and cudnn into default directory /usr/local.
I just installed cuda10.0 and cudnn7.4.2 into my home directory /home/duohappy/cuda10_cudnn74 from runfile cuda_10.0.130_410.48_linux.run, cudnn-10.0-linux-x64-v7.4.2.24.tgz.

  • Firstly, installed cuda10.0 into /home/duohappy/cuda10_cudnn74
  • Secondly, decompress cudnn file and got cuda directroy
  • Thirdly, cp include and lib file

    • cuda/include/cudnn.h to /home/duohappy/cuda10_cudnn74/include

    • cp cuda/lib64/libcudnn* to /home/duohappy/cuda10_cudann74/lib64

  • Finally, I modified .bashrc

  • Tesla V100
    should I uncomment # ARCH....?
# Tesla V100
# ARCH= -gencode arch=compute_70,code=[sm_70,compute_70]
  • GPU
    should I replace /usr/local/cuda with /home/duohappy/cuda10_cudnn74?
ifeq ($(GPU), 1)
COMMON+= -DGPU -I/usr/local/cuda/include/
CFLAGS+= -DGPU
ifeq ($(OS),Darwin) #MAC
LDFLAGS+= -L/usr/local/cuda/lib -lcuda -lcudart -lcublas -lcurand
else
LDFLAGS+= -L/usr/local/cuda/lib64 -lcuda -lcudart -lcublas -lcurand
endif
endif
  • CUDNN
    > CFLAGS+= -DCUDNN -I/usr/local/cudnn/include

cudnn directory does not exist, so I replace it with CFLAGS+= -DCUDNN -I/home/duohappy/cuda10_cudnn74/include

LDFLAGS+= -L/usr/local/cudnn/lib64 -lcudnn

replace it with LDFLAGS+= -L/home/duohappy/cuda10_cudnn74/lib64 -lcudnn

I dont know if it is right.

ifeq ($(CUDNN), 1)
COMMON+= -DCUDNN
ifeq ($(OS),Darwin) #MAC
CFLAGS+= -DCUDNN -I/usr/local/cuda/include
LDFLAGS+= -L/usr/local/cuda/lib -lcudnn
else
CFLAGS+= -DCUDNN -I/usr/local/cudnn/include
LDFLAGS+= -L/usr/local/cudnn/lib64 -lcudnn
endif
endif
  • another question

In official installation of cudnn, https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html, there is no cudnn directory in Linux. These code are executed in Linux, but I think someting maybe wrong.

else
CFLAGS+= -DCUDNN -I/usr/local/cudnn/include
LDFLAGS+= -L/usr/local/cudnn/lib64 -lcudnn

ifeq ($(CUDNN), 1)
COMMON+= -DCUDNN
ifeq ($(OS),Darwin) #MAC
CFLAGS+= -DCUDNN -I/usr/local/cuda/include
LDFLAGS+= -L/usr/local/cuda/lib -lcudnn
else
CFLAGS+= -DCUDNN -I/usr/local/cudnn/include
LDFLAGS+= -L/usr/local/cudnn/lib64 -lcudnn
endif
endif

Most helpful comment

@duohappy Hi,

Can I ignore the warning '.sync' may produce unpredictable results?

Yes, you can ignore it.
shfl without sunc is used only for experimental XNOR functions for binary networks.

All 4 comments

@duohappy Hi,

Tesla V100
should I uncomment # ARCH....?

Tesla V100

ARCH= -gencode arch=compute_70,code=[sm_70,compute_70]

it highly advisable to do this.

GPU
should I replace /usr/local/cuda with /home/duohappy/cuda10_cudnn74?

Yes, in your case.

I dont know if it is right.

If you have done all of this, and set GPU=1 CUDNN=1 and successfully run make and build the executable file ./darknet, then you have done everything right.

If you have done all of this, and set GPU=1 CUDNN=1 and successfully run make and build the executable file ./darknet, then you have done everything right.

@AlexeyAB , thanks, :+1: .

I run make and run ./darknet detect cfg/yolov3.cfg yolov3.weights data/dog.jpg, I get right result.


I have one question about uncoment Tesla V100 line

# Tesla V100
# ARCH= -gencode arch=compute_70,code=[sm_70,compute_70]
  • uncoment

I get the warning, Instruction 'shfl' without '.sync' may produce unpredictable results

ptxas /tmp/tmpxft_00004711_00000000-5_convolutional_kernels.ptx, line 508; warning : Instruction 'shfl' without '.sync' may produce unpredictable results on sm_70 and later architectures
ptxas /tmp/tmpxft_00004711_00000000-5_convolutional_kernels.ptx, line 508; warning : Instruction 'shfl' without '.sync' is deprecated since PTX ISA version 6.0 and will be discontinued in a future PTX ISA version
ptxas /tmp/tmpxft_00004711_00000000-5_convolutional_kernels.ptx, line 513; warning : Instruction 'shfl' without '.sync' may produce unpredictable results on sm_70 and later architectures

  • do not uncoment

I get the warning, Instruction 'shfl' without '.sync' is deprecated

ptxas /tmp/tmpxft_00004a2f_00000000-7_convolutional_kernels.compute_50.ptx, line 508; warning : Instruction 'shfl' without '.sync' is deprecated since PTX ISA version 6.0 and will be discontinued in a future PTX ISA version
ptxas /tmp/tmpxft_00004a2f_00000000-7_convolutional_kernels.compute_50.ptx, line 513; warning : Instruction 'shfl' without '.sync' is deprecated since PTX ISA version 6.0 and will be discontinued in a future PTX ISA version

  • question
    Can I ignore the warning '.sync' may produce unpredictable results?
    it seems like horrible.

@duohappy Hi,

Can I ignore the warning '.sync' may produce unpredictable results?

Yes, you can ignore it.
shfl without sunc is used only for experimental XNOR functions for binary networks.

@duohappy Hi,

Can I ignore the warning '.sync' may produce unpredictable results?

Yes, you can ignore it.
shfl without sunc is used only for experimental XNOR functions for binary networks.

Thanks, @AlexeyAB, you help me a lot, :+1:

the problem is solved, and I close this issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

HilmiK picture HilmiK  路  3Comments

louisondumont picture louisondumont  路  3Comments

Yumin-Sun-00 picture Yumin-Sun-00  路  3Comments

shootingliu picture shootingliu  路  3Comments

PROGRAMMINGENGINEER-NIKI picture PROGRAMMINGENGINEER-NIKI  路  3Comments