I'm trying to launch some form of cuda interaction via the blender python interpreter and keep running into Segmentation Faults. After tracing through the code with python's faulthandler, I've discovered it's an inability of blender to call the cuda NVRTC compiler. I've tried many things to debug this, but haven't managed to get around it. I've tried installing cupy in a million different ways and I've tried different python cuda libraries, such as pycuda, but nothing seems to work within the blender python interpreter that doesn't end in a Seg Fault.

One thing that I've found is that if I launch another python instance from within the blender environment (i.e import os; os.system("python test_cuda.py")) it runs without fault. That's obviously not useful when my goal of using the pythonic blender is to hand off the data coming from the application without having to save it for run-time efficiency.

I've also found that certain cupy calls work within the blender environment, but the majority break it. For instance, cp.zeros(3) works, but as soon as you introduce non-zeros values, cp.eye(3), it gives a seg fault. You can get around this by wrapping a numpy array with cp.asarray(), but if you try to manipulate that array in any way (i.e any arithmetic such as addition, etc. or if you try and change any values within the array) it seg faults.

Any help with this would be greatly appreciated!

Here's a link to my github where I've created a Dockerfile that installs everything. This is the exact environment I'm using: https://github.com/sforsyth6/blender_docker

I'm running:

  • Blender 2.82
  • Cuda 10.2
  • GPUs 4x Tesla V100s
  • Cupy 7.3
  • Python 3.7

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.