How to build NVidia NVAPI in slicer environment

Hello everyone,

I want to add the nvapi SDK to the Slicer environment so that users can choose which GPU to use, similar to how we select a GPU in the NVIDIA Control Panel for a specific application.

Can anybody guide me on how to add the sdk?

Thanks

@pieper, @jcfr Is it possible to add such library in slicer?

I don’t know of any work in that area, but you could build Slicer from source and link in the library. Or you could write a command line wrapper for the functions you want and then invoke that as a subprocess from Slicer.

To follow-up on @pieper answer, you may be interested in reviewing the following:

It should help you understand how to work with the associated API.

Hi @pieper, I tried this approach, and it worked perfectly with the wrapper. However, I would like to use the library without the wrapper by linking it directly to the slicer, so I can become familiar with adding other libraries to the slicer in the future.

Hi @jcfr,

Thanks for providing the reference links.

I’ve reviewed both links, and my requirement is in C++. I am already familiar with using basic NVAPI functions, and the example link you provided will be additional help.

I am trying to link the library in Slicer, and for that, I’ve created a CMakeLists.txt file with the necessary code. I am able to build it without any errors and can include the NVAPI header files in Slicer. However, after writing some basic GPU information retrieval code, I encounter the following error after building Slicer.sln:

@jcfr, I can provide more information about the CMake code and how I built the library if you could help me resolve this issue.

Thank you.

Hello, can anybody help me solve this issue? I’ve been stuck on this error for several days.

I appreciate any hints or help.

Thank you.