I am compiling Darknet on Ubuntu 16.04 with GPU support. Nvidial toolkit version 8.0 RC
And I get stuck with error:
nvcc --gpu-architecture=compute_52 --gpu-code=compute_52 -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ --compiler-options "-Wall -Wfatal-errors -Ofast -DOPENCV -DGPU" -c ./src/convolutional_kernels.cu -o obj/convolutional_kernels.o
/usr/local/cuda/include/surface_functions.h(134): error: expected a ";"
/usr/local/cuda/include/surface_functions.h(135): error: expected a ";"
/usr/local/cuda/include/surface_functions.h(136): error: expected a ";"
/usr/local/cuda/include/surface_functions.h at error lines has something like this:
template<> __device__ __cudart_builtin__ char surf1Dread(surface<void, cudaSurfaceType1D> surf, int x, enum cudaSurfaceBoundaryMode mode) asm("__surf1Dread_char") ;
Any advice ?
So it happens when your environment uses different versions of nvcc binary and cuda includes files during compilation process.
Darknet is using /usr/local/cuda/include/ as its include path but relys on you PATH when executing nvcc binary. And it could belong to your another cuda installation in the system.
To avoid this force your shell to search for nvcc in the /usr/local/cuda/bin/nvcc.
This could be done either by hacking nvcc path in the Makefile:
replace NVCC=nvcc with NVCC=/usr/local/cuda/bin/nvcc
or by modyfying PATH variable for make command (simpler and session related)
PATH=/usr/local/cuda/bin:$PATH make
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With