在xavier和xavier NX上面的cuda版本不一致,花点时间看些有哪些东西不一样,在xavier上面是cuda10.0和cudnn7.在xavier NX上面是cuda10.2和cudnn8.
以编译darknet为例.darknet的makefile有关cuda的东西如下:
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
endififeq ($(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
首先看-lcuda -lcudart -lcublas -lcurand这四个库,
1.libcuda.o 这个应该是不区分10.0和10.2的,都在/usr/lib/aarch64-linux-gnu/tegra/里面
find / -iname "libcuda*"得到/usr/lib/aarch64-linux-gnu/libcuda.soll /usr/lib/aarch64-linux-gnu/libcuda.so得到/usr/lib/aarch64-linux-gnu/libcuda.so -> tegra/libcuda.so*ll /usr/lib/aarch64-linux-gnu/tegra/libcuda.so得到/usr/lib/aarch64-linux-gnu/tegra/libcuda.so -> libcuda.so.1.1*
然后
所以最终是用的libcuda.so.1.1
2.libcudart.so 区分10.0和10.2
find / -iname "libcudart.so"得到 /usr/local/cuda-10.0/targets/aarch64-linux/lib/libcudart.soll /usr/local/cuda-10.0/targets/aarch64-linux/lib/libcudart.so得到 /usr/local/cuda-10.0/targets/aarch64-linux/lib/libcudart.so -> libcudart.so.10.0
3. libcublas.so 区分10.0和10.2 find / -iname "libcublas.so"得到 /usr/local/cuda-10.0/targets/aarch64-linux/lib/libcublas.soll /usr/local/cuda-10.0/targets/aarch64-linux/lib/libcublas.so
得到 /usr/local/cuda-10.0/targets/aarch64-linux/lib/libcublas.so -> libcublas.so.10.0
4.libcurand.so 区分10.0和10.2
find / -iname "libcurand.so"得到 /usr/local/cuda-10.0/targets/aarch64-linux/lib/libcurand.soll /usr/local/cuda-10.0/targets/aarch64-linux/lib/libcurand.so得到 /usr/local/cuda-10.0/targets/aarch64-linux/lib/libcurand.so -> libcurand.so.10.0
5.libcudnn.so
find / -iname "libcudnn.so"得到 /usr/lib/aarch64-linux-gnu/libcudnn.soll /usr/lib/aarch64-linux-gnu/libcudnn.so得到 /usr/lib/aarch64-linux-gnu/libcudnn.so -> /etc/alternatives/libcudnn_so*ll /etc/alternatives/libcudnn_so得到 /etc/alternatives/libcudnn_so -> /usr/lib/aarch64-linux-gnu/libcudnn.so.7*ll /usr/lib/aarch64-linux-gnu/libcudnn.so.7/usr/lib/aarch64-linux-gnu/libcudnn.so.7 -> libcudnn.so.7.5.0*