cu icon indicating copy to clipboard operation
cu copied to clipboard

Errors when building

Open kolkov opened this issue 6 years ago • 21 comments

GOROOT=C:/Go
GOPATH=D:/Go
C:/Go\bin\go.exe build -i -o C:\Users\Andy\AppData\Local\Temp\___Unnamed.exe github.com/chewxy/cu/cmd/cudatest
# github.com/chewxy/cu
gcc: error: FilesNVIDIA: No such file or directory
gcc: error: GPU: No such file or directory
gcc: error: Computing: No such file or directory
gcc: error: ToolkitCUDAv8.0include: No such file or directory

kolkov avatar Sep 13 '17 17:09 kolkov

Solved this by copy folder to D:/cuda/v8.0/bin and D:/cuda/v8.0/include (without spaces), but got another lot of errors

GOROOT=C:/Go
GOPATH=D:/Go
C:/Go\bin\go.exe build -i -o C:\Users\Andy\AppData\Local\Temp\___Unnamed.exe github.com/chewxy/cu/cmd/cudatest
# github.com/chewxy/cu
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\addressing.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuMemAdvise':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:44: undefined reference to `cuMemAdvise'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\addressing.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuMemPrefetchAsync':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:66: undefined reference to `cuMemPrefetchAsync'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\addressing.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuPointerGetAttribute':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:87: undefined reference to `cuPointerGetAttribute'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\addressing.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuPointerSetAttribute':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:108: undefined reference to `cuPointerSetAttribute'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\context.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuCtxCreate':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:43: undefined reference to `cuCtxCreate_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\context.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuCtxDestroy':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:61: undefined reference to `cuCtxDestroy_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\context.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuCtxGetApiVersion':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:80: undefined reference to `cuCtxGetApiVersion'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\context.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuCtxGetCacheConfig':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:98: undefined reference to `cuCtxGetCacheConfig'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\context.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuCtxGetCurrent':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:116: undefined reference to `cuCtxGetCurrent'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\context.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuCtxGetDevice':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:134: undefined reference to `cuCtxGetDevice'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\context.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuCtxGetFlags':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:152: undefined reference to `cuCtxGetFlags'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\context.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuCtxGetLimit':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:172: undefined reference to `cuCtxGetLimit'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\context.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuCtxGetSharedMemConfig':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:190: undefined reference to `cuCtxGetSharedMemConfig'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\context.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuCtxPopCurrent':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:208: undefined reference to `cuCtxPopCurrent_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\context.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuCtxPushCurrent':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:226: undefined reference to `cuCtxPushCurrent_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\context.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuCtxSetCacheConfig':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:245: undefined reference to `cuCtxSetCacheConfig'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\context.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuCtxSetCurrent':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:263: undefined reference to `cuCtxSetCurrent'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\context.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuCtxSetLimit':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:283: undefined reference to `cuCtxSetLimit'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\context.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuCtxSetSharedMemConfig':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:302: undefined reference to `cuCtxSetSharedMemConfig'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\context.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuCtxSynchronize':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:319: undefined reference to `cuCtxSynchronize'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\context.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuDevicePrimaryCtxGetState':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:340: undefined reference to `cuDevicePrimaryCtxGetState'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\context.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuDevicePrimaryCtxRelease':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:359: undefined reference to `cuDevicePrimaryCtxRelease'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\context.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuDevicePrimaryCtxReset':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:378: undefined reference to `cuDevicePrimaryCtxReset'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\context.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuDevicePrimaryCtxRetain':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:398: undefined reference to `cuDevicePrimaryCtxRetain'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\context.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuDevicePrimaryCtxSetFlags':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:417: undefined reference to `cuDevicePrimaryCtxSetFlags'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\cu.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuDriverGetVersion':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:41: undefined reference to `cuDriverGetVersion'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\cu.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuInit':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:60: undefined reference to `cuInit'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\device.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuDeviceGet':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:43: undefined reference to `cuDeviceGet'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\device.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuDeviceGetAttribute':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:63: undefined reference to `cuDeviceGetAttribute'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\device.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuDeviceGetCount':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:81: undefined reference to `cuDeviceGetCount'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\device.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuDeviceGetName':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:101: undefined reference to `cuDeviceGetName'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\device.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuDeviceTotalMem':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:121: undefined reference to `cuDeviceTotalMem_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\execution.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuFuncGetAttribute':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:44: undefined reference to `cuFuncGetAttribute'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\execution.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuFuncSetCacheConfig':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:64: undefined reference to `cuFuncSetCacheConfig'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\execution.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuFuncSetSharedMemConfig':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:84: undefined reference to `cuFuncSetSharedMemConfig'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\execution.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuLaunchKernel':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:113: undefined reference to `cuLaunchKernel'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\memory.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuArray3DCreate':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:42: undefined reference to `cuArray3DCreate_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\memory.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuArray3DGetDescriptor':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:61: undefined reference to `cuArray3DGetDescriptor_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\memory.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuArrayCreate':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:80: undefined reference to `cuArrayCreate_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\memory.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuArrayDestroy':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:98: undefined reference to `cuArrayDestroy'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\memory.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuArrayGetDescriptor':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:117: undefined reference to `cuArrayGetDescriptor_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\memory.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuMemAlloc':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:136: undefined reference to `cuMemAlloc_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\memory.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuMemAllocHost':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:155: undefined reference to `cuMemAllocHost_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\memory.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuMemAllocManaged':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:176: undefined reference to `cuMemAllocManaged'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\memory.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuMemAllocPitch':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:199: undefined reference to `cuMemAllocPitch_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\memory.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuMemFree':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:217: undefined reference to `cuMemFree_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\memory.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuMemFreeHost':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:235: undefined reference to `cuMemFreeHost'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\memory.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuMemGetAddressRange':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:255: undefined reference to `cuMemGetAddressRange_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\memory.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuMemGetInfo':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:274: undefined reference to `cuMemGetInfo_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\memory.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuMemcpy':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:294: undefined reference to `cuMemcpy'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\memory.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuMemcpyAsync':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:315: undefined reference to `cuMemcpyAsync'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\memory.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuMemcpyDtoD':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:335: undefined reference to `cuMemcpyDtoD_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\memory.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuMemcpyDtoDAsync':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:356: undefined reference to `cuMemcpyDtoDAsync_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\memory.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuMemcpyDtoH':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:376: undefined reference to `cuMemcpyDtoH_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\memory.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuMemcpyDtoHAsync':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:397: undefined reference to `cuMemcpyDtoHAsync_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\memory.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuMemcpyHtoD':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:417: undefined reference to `cuMemcpyHtoD_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\memory.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuMemcpyHtoDAsync':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:438: undefined reference to `cuMemcpyHtoDAsync_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\memory.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuMemcpyPeer':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:460: undefined reference to `cuMemcpyPeer'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\memory.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuMemcpyPeerAsync':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:483: undefined reference to `cuMemcpyPeerAsync'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\memory.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuMemsetD32':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:504: undefined reference to `cuMemsetD32_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\memory.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuMemsetD32Async':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:526: undefined reference to `cuMemsetD32Async'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\memory.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuMemsetD8':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:547: undefined reference to `cuMemsetD8_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\memory.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuMemsetD8Async':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:569: undefined reference to `cuMemsetD8Async'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\module.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuModuleGetFunction':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:43: undefined reference to `cuModuleGetFunction'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\module.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuModuleGetGlobal':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:64: undefined reference to `cuModuleGetGlobal_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\module.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuModuleLoad':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:83: undefined reference to `cuModuleLoad'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\module.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuModuleLoadData':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:102: undefined reference to `cuModuleLoadData'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\module.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuModuleUnload':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:120: undefined reference to `cuModuleUnload'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\occupancy.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuOccupancyMaxActiveBlocksPerMultiprocessor':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:45: undefined reference to `cuOccupancyMaxActiveBlocksPerMultiprocessor'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\occupancy.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:69: undefined reference to `cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\stream.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuStreamCreate':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:43: undefined reference to `cuStreamCreate'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\stream.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuStreamCreateWithPriority':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:63: undefined reference to `cuStreamCreateWithPriority'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\stream.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuStreamDestroy':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:81: undefined reference to `cuStreamDestroy_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\stream.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuStreamGetFlags':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:100: undefined reference to `cuStreamGetFlags'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\stream.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuStreamGetPriority':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:119: undefined reference to `cuStreamGetPriority'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\stream.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuStreamQuery':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:137: undefined reference to `cuStreamQuery'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\stream.cgo2.o: In function `_cgo_d079f8571fab_Cfunc_cuStreamSynchronize':
/tmp/go-build\github.com\chewxy\cu\_obj/cgo-gcc-prolog:155: undefined reference to `cuStreamSynchronize'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\batch.o: In function `cuDeviceGetAttributes':
./batch.c:11: undefined reference to `cuDeviceGetAttribute'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\batch.o: In function `cuLaunchAndSync':
./batch.c:25: undefined reference to `cuLaunchKernel'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\batch.o: In function `cuAllocAndCopy':
./batch.c:36: undefined reference to `cuMemAlloc_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\batch.o: In function `processFn':
./batch.c:99: undefined reference to `cuLaunchKernel'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\batch.o: In function `cuAllocAndCopy':
./batch.c:36: undefined reference to `cuMemAlloc_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\batch.o: In function `process':
./batch.c:123: undefined reference to `cuCtxSetCurrent'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\batch.o: In function `processFn':
./batch.c:99: undefined reference to `cuLaunchKernel'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\batch.o: In function `cuAllocAndCopy':
./batch.c:36: undefined reference to `cuMemAlloc_v2'
./batch.c:41: undefined reference to `cuMemcpyHtoD_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\batch.o: In function `processFn':
./batch.c:49: undefined reference to `cuCtxSetCurrent'
./batch.c:53: undefined reference to `cuMemAlloc_v2'
./batch.c:107: undefined reference to `cuCtxSynchronize'
./batch.c:64: undefined reference to `cuMemFree_v2'
./batch.c:68: undefined reference to `cuMemFreeHost'
./batch.c:72: undefined reference to `cuMemcpy'
./batch.c:77: undefined reference to `cuMemcpyHtoD_v2'
./batch.c:82: undefined reference to `cuMemcpyDtoH_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\batch.o: In function `cuLaunchAndSync':
./batch.c:30: undefined reference to `cuCtxSynchronize'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\batch.o: In function `cuAllocAndCopy':
./batch.c:41: undefined reference to `cuMemcpyHtoD_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\batch.o: In function `processFn':
./batch.c:53: undefined reference to `cuMemAlloc_v2'
./batch.c:107: undefined reference to `cuCtxSynchronize'
./batch.c:64: undefined reference to `cuMemFree_v2'
./batch.c:68: undefined reference to `cuMemFreeHost'
./batch.c:72: undefined reference to `cuMemcpy'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\batch.o: In function `cuAllocAndCopy':
./batch.c:41: undefined reference to `cuMemcpyHtoD_v2'
C:\Users\Andy\AppData\Local\Temp\go-build247682430\github.com\chewxy\cu\_obj\batch.o: In function `processFn':
./batch.c:82: undefined reference to `cuMemcpyDtoH_v2'
./batch.c:49: undefined reference to `cuCtxSetCurrent'
collect2.exe: error: ld returned 1 exit status

kolkov avatar Sep 13 '17 18:09 kolkov

I'll look into this. This is on master?

chewxy avatar Sep 13 '17 21:09 chewxy

Yes!

kolkov avatar Sep 14 '17 10:09 kolkov

I returned to testing the package. I can not yet overcome the above compilation problem.

kolkov avatar Oct 17 '17 09:10 kolkov

Did you try with the latest? There has been some updated by @abeltensor

chewxy avatar Oct 17 '17 10:10 chewxy

Thanks! I updated cu package and chage path to cuda lib in my system to drive D:

CUDA version: 9000
CUDA devices: 1
Device 0
========
Name      :	"GeForce GT 740M"
Clock Rate:	895000 kHz
Memory    :	2147483648 bytes
Compute   : 	3.0

Process finished with exit code 0

Thanks!

kolkov avatar Oct 17 '17 10:10 kolkov

I think that if we use this approach, it will be very convenient. https://stackoverflow.com/questions/16931700/is-it-possible-to-use-environment-variables-in-a-cgo-cflags-comment

kolkov avatar Oct 17 '17 10:10 kolkov

https://github.com/chewxy/cu/blob/master/cgoflags.go

chewxy avatar Oct 17 '17 10:10 chewxy

Yes! But the problem is that for Windows there is a hard binding to the path, and when installing CUDA, the real path to the library will be written into environment variables. image

kolkov avatar Oct 17 '17 11:10 kolkov

Oh that's... surprising. What would the solution be then? Making sure everyone set their environment variable is a lot less intuitive, no?

chewxy avatar Oct 17 '17 11:10 chewxy

By default, this environment variables is set up by the CUDA toolkit installer itself.

kolkov avatar Oct 17 '17 11:10 kolkov

is it always the same? If a user decides to install CUDA elsewhere?

If it's always the same we can hardcode it right?

chewxy avatar Oct 17 '17 11:10 chewxy

btw, feel free to send a PR to show me what you mean

chewxy avatar Oct 17 '17 11:10 chewxy

Thanks! Yes, the installer itself writes the selected path for installation. The default value is C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA But the first time I had a problem with spaces in the path to the library. (

kolkov avatar Oct 17 '17 11:10 kolkov

Sorry to interrupt the conversation here. But when I initially submitted my Pull request and added the other versions of Cuda I did actually try to set the environment flag ($CUDA_PATH/include/) rather then putting an absolute path into the flags. For whatever reason, Cgo had trouble getting the path even through the environment variable at C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA. Its possible that my implementation of this didn't work properly for whatever reasons. I didn't try it again after I reset the cuda path to c:\cuda.

Ill try it really quick now if you want and see if that will work. As @kolkov mentioned above, the cuda installer automatically sets up a CUDA_PATH variable on the system so it might be a better solution.

abeltensor avatar Oct 17 '17 16:10 abeltensor

After a quick try, I was unable to make it work. The problem it seems has to do with the difference between bash path variables and windows path variables. Cgo uses the gcc compiler which means it needs to use a bash style syntax to find the variable which would be $CUDA_PATH but windows can't find the variable through that format. Windows needs to use a %CUDA_PATH% format.

I tried putting both %CUDA_PATH% and $CUDA_PATH into the cgoflags.go file with no success. If you are able to find an alternate syntax that would allow this to work then you could remove all of the other version paths for windows since the CUDA_PATH includes the version folder number.

abeltensor avatar Oct 17 '17 17:10 abeltensor

Maybe this will help? https://stackoverflow.com/questions/14589971/how-to-make-gcc-accept-spaces-in-path

kolkov avatar Oct 17 '17 20:10 kolkov

Its not about the spaces so much as its about the windows variable format vs the bash variable format. %CUDA_PATH% and $CUDA_PATH respectively. I guess a different way to handle this would be to add some kind of conditional statement or try/catch block into the comments but I don't know if that's possible with cgo. I'll try to post a question to stack overflow and see what comes up.

abeltensor avatar Oct 17 '17 21:10 abeltensor

Yes! This worked, but how to use system variable? image

kolkov avatar Oct 17 '17 21:10 kolkov

As an alternative, we can use: https://github.com/rjeczalik/pkgconfig

kolkov avatar Oct 17 '17 21:10 kolkov

I highly suggest putting in a PR. I'll mark it as hacktoberfest :)

chewxy avatar Oct 18 '17 12:10 chewxy