Tuesday, November 19, 2019

cuda 8.0 compile related


Compile cuda-z

    https://sourceforge.net/p/cuda-z/code/HEAD/tree/trunk/


Cuda 8.0 and Qt5


$qmake file.pro

$make


1) Error fPIC

error: #error "You must build your code with position independent code if Qt was built with -reduce-relocations. " "Compile your code with -fPIC (-fPIE is not enough)."

 #  error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\


#sol, add next parameter in Makefile


$nvcc -shared -Xcompiler -fPIC

2) Compile error , comment CZ_VER_BUILD block

3) Error link stage

bld/o/czdialog.o: In function `CZDialog::getCudaDeviceNumber()':

czdialog.cpp:(.text+0x421): undefined reference to `CZCudaDeviceFound'

bld/o/czdeviceinfo.o: In function `CZCudaDeviceInfo::prepareDevice()':

czdeviceinfo.cpp:(.text+0x569): undefined reference to `CZCudaCalcDeviceSelect'

bld/o/czdeviceinfo.o: In function `CZCudaDeviceInfo::updateInfo()':

czdeviceinfo.cpp:(.text+0x5c5): undefined reference to `CZCudaCalcDeviceBandwidth'

czdeviceinfo.cpp:(.text+0x5d2): undefined reference to `CZCudaCalcDevicePerformance'

bld/o/czdeviceinfo.o: In function `CZCudaDeviceInfo::readInfo()':

czdeviceinfo.cpp:(.text+0x448): undefined reference to `CZCudaReadDeviceInfo'

bld/o/czdeviceinfo.o: In function `CZCudaDeviceInfo::prepareDevice()':

czdeviceinfo.cpp:(.text+0x585): undefined reference to `CZCudaPrepareDevice'

bld/o/czdeviceinfo.o: In function `CZCudaDeviceInfo::cleanDevice()':

czdeviceinfo.cpp:(.text+0x615): undefined reference to `CZCudaCleanDevice'

bld/o/czcommandline.o: In function `CZCommandLine::printDeviceList()':

czcommandline.cpp:(.text+0x45b5): undefined reference to `CZCudaDeviceFound'

czcommandline.cpp:(.text+0x46e8): undefined reference to `CZCudaReadDeviceInfo'

bld/o/czcommandline.o: In function `CZCommandLine::exec()':

czcommandline.cpp:(.text+0x4b16): undefined reference to `CZCudaDeviceFound'

czcommandline.cpp:(.text+0x4e2c): undefined reference to `CZCudaReadDeviceInfo'

czcommandline.cpp:(.text+0x4fbb): undefined reference to `CZCudaPrepareDevice'

czcommandline.cpp:(.text+0x4fd0): undefined reference to `CZCudaCalcDeviceBandwidth'

czcommandline.cpp:(.text+0x52fe): undefined reference to `CZCudaCalcDevicePerformance'

czcommandline.cpp:(.text+0x561f): undefined reference to `CZCudaCleanDevice'

bld/o/main.o: In function `testCudaPresent()':

main.cpp:(.text+0x2): undefined reference to `CZCudaCheck'

bld/o/main.o: In function `getCudaDeviceNum()':

main.cpp:(.text+0x4c): undefined reference to `CZCudaDeviceFound'

main.cpp:(.text+0x96): undefined reference to `CZCudaReadDeviceInfo'


#sol, change order of object files


$ g++ -m64 -Wl,-O1 -o bin/cuda-z bld/o/main.o bld/o/cudainfo.o bld/o/czdialog.o bld/o/czdeviceinfo.o bld/o/czdeviceinfodecoder.o bld/o/czcommandline.o bld/o/log.o bld/o/platform.o bld/o/qrc_cuda-z.o bld/o/moc_czdialog.o bld/o/moc_czdeviceinfo.o bld/o/moc_czdeviceinfodecoder.o bld/o/moc_czcommandline.o   -L /usr/local/cuda/lib64 -L/usr/X11R6/lib64 -lcudart_static -ldl -lm -lrt -lQt5Widgets -lQt5Gui -lQt5Network -lQt5Core -lGL -lpthread

4) Execution error
./cuda-z: error while loading shared libraries: bld/o/cudainfo.o: cannot open shared object file: No such file or directory


#sol, move from bin to ..

$./cuda-z


No comments:

Ubuntu Forware port 80

  #!/bin/bash iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8069 iptables -t nat -A PREROUTING -i eth0 -p tc...