NPP within Python3 segfaults on malloc?


I’m trying to replicate some code which used to be available at and seems to be someone saved at .

I’m running CUDA 9.0 with a Titan V card on Linux Mint (Ubuntu). Other Python-CUDA applications (e.g. homebrew CuPy stuff) work perfectly fine, even impressively so, compared to their speed when I had a 1080Ti installed.

The reduced offending code is:

from ctypes import *
npp_supp = CDLL("/usr/local/cuda/lib64/")
npp_supp.nppiMalloc_8u_C1.restype = POINTER(c_char)
d_a = npp_supp.nppiMalloc_8u_C1(640, 480, 640)

I’ll sure be grateful if someone can help me figure out what I’m doing wrong here!