leoliuf / MRiLab

A Numerical Magnetic Resonance Imaging (MRI) Simulation Platform
https://leoliuf.github.io/MRiLab/
BSD 2-Clause "Simplified" License
204 stars 63 forks source link

GPU make error #10

Closed ksinghrao closed 7 years ago

ksinghrao commented 7 years ago

Hi all,

I have successfully gotten MRiLab running on a CPU however I am now trying to install it on a machine with a GPU and keep getting a bizarre error which I do not understand (I am a relative novice with CUDA and GPUs).

I am running a GEforce GTX 1070 on a 64 bit machine and a Ubuntu OS. I can run the cmake file successfully with CUDA being found as well as the other major dependencies. However when I run make I get the following error. Has anyone else run into this problem and been able to fix it?

Terminal Output [ 11%] Linking CXX shared library DoCalSARAtCPU.mexa64 [ 11%] Built target DoCalSARAtCPU Scanning dependencies of target DoScanAtCPU [ 11%] Building CXX object engine/CPUEngine/CMakeFiles/DoScanAtCPU.dir/DoScanAtCPU.cpp.o [ 11%] Linking CXX shared library DoScanAtCPU.mexa64 [ 11%] Built target DoScanAtCPU [ 11%] Building NVCC (Device) object engine/GPUEngine/CMakeFiles/cuda_compile.dir/cuda_compile_generated_DoCESTScanAtGPU.cu.o

/home/ksinghrao/Documents/MRiLab/Lib/src/engine/GPUEngine/DoCESTScanAtGPU.cu(94): warning: variable "MaxThreadNum" was set but never used

/home/ksinghrao/Documents/MRiLab/Lib/src/engine/GPUEngine/DoCESTScanAtGPU.cu(94): warning: variable "ThreadNum" was declared but never referenced

/home/ksinghrao/Documents/MRiLab/Lib/src/engine/GPUEngine/DoCESTScanAtGPU.cu(94): warning: variable "MaxThreadNum" was set but never used

/home/ksinghrao/Documents/MRiLab/Lib/src/engine/GPUEngine/DoCESTScanAtGPU.cu(94): warning: variable "ThreadNum" was declared but never referenced

/home/ksinghrao/Documents/MRiLab/Lib/src/engine/GPUEngine/DoCESTScanAtGPU.cu(94): warning: variable "MaxThreadNum" was set but never used

/home/ksinghrao/Documents/MRiLab/Lib/src/engine/GPUEngine/DoCESTScanAtGPU.cu(94): warning: variable "ThreadNum" was declared but never referenced

/home/ksinghrao/Documents/MRiLab/Lib/src/engine/GPUEngine/DoCESTScanAtGPU.cu(94): warning: variable "MaxThreadNum" was set but never used

/home/ksinghrao/Documents/MRiLab/Lib/src/engine/GPUEngine/DoCESTScanAtGPU.cu(94): warning: variable "ThreadNum" was declared but never referenced

/home/ksinghrao/Documents/MRiLab/Lib/src/engine/GPUEngine/DoCESTScanAtGPU.cu(94): warning: variable "MaxThreadNum" was set but never used

/home/ksinghrao/Documents/MRiLab/Lib/src/engine/GPUEngine/DoCESTScanAtGPU.cu(94): warning: variable "ThreadNum" was declared but never referenced

ptxas info : 0 bytes gmem ptxas info : Compiling entry function '_Z18BlochKernelCESTGPUfPdPfS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_ffS0_S0_fiiiiS0_S0_S0_iiiiiiii' for 'sm_20' ptxas info : Function properties for _Z18BlochKernelCESTGPUfPdPfS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_ffS0_S0_fiiiiS0_S0_S0_iiiiiiii 128 bytes stack frame, 152 bytes spill stores, 152 bytes spill loads ptxas info : Used 63 registers, 296 bytes cmem[0], 48 bytes cmem[16] /home/ksinghrao/Documents/MRiLab/Lib/src/engine/GPUEngine/DoCESTScanAtGPU.cu(94): warning: variable "MaxThreadNum" was set but never used

/home/ksinghrao/Documents/MRiLab/Lib/src/engine/GPUEngine/DoCESTScanAtGPU.cu(94): warning: variable "ThreadNum" was declared but never referenced

ptxas info : 0 bytes gmem ptxas info : Compiling entry function '_Z18BlochKernelCESTGPUfPdPfS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_ffS0_S0_fiiiiS0_S0_S0_iiiiiiii' for 'sm_30' ptxas info : Function properties for _Z18BlochKernelCESTGPUfPdPfS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_ffS0_S0_fiiiiS0_S0_S0_iiiiiiii 144 bytes stack frame, 168 bytes spill stores, 168 bytes spill loads ptxas info : Used 63 registers, 584 bytes cmem[0], 88 bytes cmem[2] /home/ksinghrao/Documents/MRiLab/Lib/src/engine/GPUEngine/DoCESTScanAtGPU.cu(94): warning: variable "MaxThreadNum" was set but never used

/home/ksinghrao/Documents/MRiLab/Lib/src/engine/GPUEngine/DoCESTScanAtGPU.cu(94): warning: variable "ThreadNum" was declared but never referenced

ptxas info : 0 bytes gmem ptxas info : Compiling entry function '_Z18BlochKernelCESTGPUfPdPfS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_ffS0_S0_fiiiiS0_S0_S0_iiiiiiii' for 'sm_35' ptxas info : Function properties for _Z18BlochKernelCESTGPUfPdPfS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_ffS0_S0_fiiiiS0_S0_S0_iiiiiiii 0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads ptxas info : Used 126 registers, 584 bytes cmem[0], 88 bytes cmem[2] /home/ksinghrao/Documents/MRiLab/Lib/src/engine/GPUEngine/DoCESTScanAtGPU.cu(94): warning: variable "MaxThreadNum" was set but never used

/home/ksinghrao/Documents/MRiLab/Lib/src/engine/GPUEngine/DoCESTScanAtGPU.cu(94): warning: variable "ThreadNum" was declared but never referenced

ptxas info : 0 bytes gmem ptxas info : Compiling entry function '_Z18BlochKernelCESTGPUfPdPfS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_ffS0_S0_fiiiiS0_S0_S0_iiiiiiii' for 'sm_50' ptxas info : Function properties for _Z18BlochKernelCESTGPUfPdPfS0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_ffS0_S0_fiiiiS0_S0_S0_iiiiiiii 0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads ptxas info : Used 108 registers, 584 bytes cmem[0], 92 bytes cmem[2] /usr/include/string.h: In function ‘void __mempcpy_inline(void, const void, size_t)’: /usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope return (char ) memcpy (dest, src, n) + n; ^ CMake Error at cuda_compile_generated_DoCESTScanAtGPU.cu.o.cmake:266 (message): Error generating file /home/ksinghrao/Documents/MRiLab/Lib/build/engine/GPUEngine/CMakeFiles/cuda_compile.dir//./cuda_compile_generated_DoCESTScanAtGPU.cu.o

engine/GPUEngine/CMakeFiles/DoCESTScanAtGPU.dir/build.make:63: recipe for target 'engine/GPUEngine/CMakeFiles/cuda_compile.dir/cuda_compile_generated_DoCESTScanAtGPU.cu.o' failed make[2]: [engine/GPUEngine/CMakeFiles/cuda_compile.dir/cuda_compile_generated_DoCESTScanAtGPU.cu.o] Error 1 CMakeFiles/Makefile2:208: recipe for target 'engine/GPUEngine/CMakeFiles/DoCESTScanAtGPU.dir/all' failed make[1]: [engine/GPUEngine/CMakeFiles/DoCESTScanAtGPU.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2

ksinghrao commented 7 years ago

I figured out how to solve this. I ran make using a single thread:

sudo make -j1

and that worked.

leoliuf commented 6 years ago

I am glad you figured out! :)