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: [url]https://devtalk.nvidia.com/default/topic/539422/optix/multi-gpu-with-optix/post/3786210/#3786210[/url]
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: optix - What device is a cuda kernel running on - Stack Overflow

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