CUDA, cupy, numpy and OpenTPS compatibility

Hello,

I’m a new user of the OpenTPS software.

My installation went fine, but when I ran opentps some warning messages started appearing.
One was in regard with Gurobi package, if I’m not mistaken, and the other one regarding
a cupy package. The latter seemed important, so I went back and tried to resolve the issue.

cupy turns out to be a package related to GPU computing (needs Nvidia CUDA toolkit installed).
When these componenets are in place, opentps doesn’t want to start at all, and spits out this error message that ends like this,

  • raise AttributeError( AttributeError: np.Inf was removed in the NumPy 2.0 release. Use np.inf instead. *

My question here would be, what is the correct selection of dependencies of packages like python3, cupy, numpy, and CUDA toolkit, and possibly others?

I appreciate any help/pointers,
Pawel

Hello Pawel,

The two packages you mentioned are optional for OpenTPS. If they are installed on your system, OpenTPS will use them to accelerate computation. However, if they are not installed, it should not cause any issues with functionality. I recommend not installing cupy unless your system has CUDA support. Same for the Gurobi package (you would need a licence to use it).
Please do not install them if they are not available on your computer or it could lead to errors.

Regarding the np.Inf issue, please ensure that you are using the latest version of the software. You can re-download it from our GitLab page if needed. This issue has already been resolved in the most recent release.

As for package dependencies, everything should work as expected. If you still encounter dependency errors after updating OpenTPS, please let me know.

Finally, for information purpose, could you let me know which installation method you used? Was it as an end user (via pip install) or for development purposes (using the .bat files)?

I hope this clarifies things for you! Let me know if you have any further questions.

Romain Schyns

Hello Romain,

Thank you for your reply.
My understanding was that cupy and Gurobi are optional as the software installed without a problem and ran.
The problem for me/us was that the MCsquared calculations for the plan optimization were taking too long.

I will start afresh, following your pointers.

Thanks again,
Pawel

MCsquare calculations can be relatively slow. If you’d like to speed them up, I recommend reducing the number of primary particles. Using around 1e4 primaries per beamlet is generally a good compromise between speed and accuracy.

Depending on the complexity of your plan, beamlet computation and optimization may take anywhere from several minutes to several hours.

Thank you for the speed-up tips, Romain.
The plan we have in mind is indeed complex,
so let’s wait and see how this works out. Thanks again