Get Cuda DeviceId within the program

Hi,

I wanted to ask whether it is possible to get the Cuda deviceId from inside an Optix program.
I found the exact question in this thread: https://devtalk.nvidia.com/default/topic/539422/optix/multi-gpu-with-optix/post/3786210/#3786210
The solutions were only how to set the Device beforehand, but I need to find out which device the program is running on.

Thank you.

How about: http://stackoverflow.com/a/19913882/678093

I’ve also tried it, but I didn’t manage to make it work. Might be because I’m working with Optix 3.8