what's wrong with cudaMalloc ?

I am trying to migration Gadget2 to GPU platform.I use Tesla 1070 with cuda 2.3
I find that if I call the cudaMalloc function in my code, the error described below will emerge.

[ang15:31249] *** Process received signal ***
[ang15:31249] Signal: Segmentation fault (11)
[ang15:31249] Signal code: Address not mapped (1)
[ang15:31249] Failing at address: (nil)
[ang15:31249] [ 0] /lib64/libc.so.6 [0x3e82e302d0]
[ang15:31249] [ 1] /usr/lib64/libcuda.so [0x2aaaae1da570]
[ang15:31249] [ 2] /usr/lib64/libcuda.so [0x2aaaae1dffb4]
[ang15:31249] [ 3] /usr/lib64/libcuda.so [0x2aaaae1b0537]
[ang15:31249] [ 4] /usr/lib64/libcuda.so [0x2aaaae15c387]
[ang15:31249] [ 5] /usr/lib64/libcuda.so [0x2aaaae16dbab]
[ang15:31249] [ 6] /usr/lib64/libcuda.so [0x2aaaae1529fd]
[ang15:31249] [ 7] /usr/lib64/libcuda.so [0x2aaaae14baea]
[ang15:31249] [ 8] /usr/lib64/libcuda.so(cuCtxCreate+0x57) [0x2aaaae1a6197]
[ang15:31249] [ 9] /opt/sharcnet/cuda-toolkit+sdk/current/lib64/libcudart.so.2 [0x2b43af124eb2]
[ang15:31249] [10] /opt/sharcnet/cuda-toolkit+sdk/current/lib64/libcudart.so.2 [0x2b43af12569c]
[ang15:31249] [11] /opt/sharcnet/cuda-toolkit+sdk/current/lib64/libcudart.so.2(cudaMalloc+0x44) [0x2b43af10ae34]
[ang15:31249] [12] Gadget2.cuda [0x4180e0]
[ang15:31249] [13] Gadget2.cuda [0x40be10]
[ang15:31249] [14] Gadget2.cuda [0x40a7e6]
[ang15:31249] [15] Gadget2.cuda(__gxx_personality_v0+0x459) [0x402039]
[ang15:31249] [16] Gadget2.cuda(__gxx_personality_v0+0x3c8) [0x401fa8]
[ang15:31249] [17] /lib64/libc.so.6(__libc_start_main+0xf4) [0x3e82e1d994]
[ang15:31249] [18] Gadget2.cuda(__gxx_personality_v0+0x99) [0x401c79]
[ang15:31249] *** End of error message ***

I use PBS to submit jobs.

what’s wrong with the cudaMalloc? Thanks for you help.

That’s a bit hard to say. Have you tried a simple test code which only has a cudaMalloc call in main()?