Using OpenGL bindless Textures in Optix

I’m making a hybrid opengl and optix program.
I upload all the buffers and textures into OpengGl, and the use the interop functions to reference them in optix.

The issue is, I started using bindless textures for OpenGl, and from that point on I can’t create optix textures with any combination of function calls I tried.

bindlessHandle = glGetTextureHandleARB(handle);
glMakeTextureHandleResidentARB(bindlessHandle);

These function calls make the textures bindless, and allow me to use an array of texture indexes in my shader.
After making the texture bindless, trying to make a texture from it ends up in an exception.

Is it even possible to do what I’m trying to? The return value of glGetTextureHandleARB is a Gluint64, but I failed to find optix functions which would actually take a 64 bit index.
Using the old handle also doesn’t work, whether I try it before or after making it bindless.

So what should I do now?