exception in cuda cudaExternalMemoryGetMappedMipmappedArray: Integer division by zero

In an attempt to have cuda interop with a D3D12 texture (I want to modify a D2D12 texture from cuda, as I think a 2Dsurface, but I believe I need to go through a mimap 2Dtexture array), I reach a hard blocking exception when calling cudaExternalMemoryGetMappedMipmappedArray:

Exception thrown at 0x00007FFC398D45B3 (nvcuda.dll) in simpleD3D12.exe: 0xC0000094: Integer division by zero.

There is litteraly zero resource about this anywhere.

TextureChannels = 4;
TextureWidth = m_width;
TextureHeight = m_height;
auto textureSurface = TextureWidth * TextureHeight;
auto texturePixels = textureSurface * TextureChannels;
auto textureSizeBytes = sizeof(float)* texturePixels;

D3D12_RESOURCE_DESC textureDesc{};
textureDesc.MipLevels = 1;
textureDesc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT;
textureDesc.Width = TextureWidth;
textureDesc.Height = TextureHeight;
textureDesc.Flags = D3D12_RESOURCE_FLAG_NONE;
textureDesc.DepthOrArraySize = 1;
textureDesc.SampleDesc.Count = 1;
textureDesc.SampleDesc.Quality = 0;
textureDesc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;

ThrowIfFailed(m_device->CreateCommittedResource(&CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_DEFAULT), D3D12_HEAP_FLAG_SHARED,
    &textureDesc, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE, nullptr, IID_PPV_ARGS(&TextureArray)));
NAME_D3D12_OBJECT(TextureArray);

HANDLE sharedHandle{};
WindowsSecurityAttributes secAttr{};
LPCWSTR name{};
ThrowIfFailed(m_device->CreateSharedHandle(TextureArray.Get(), &secAttr, GENERIC_ALL, name, &sharedHandle));
D3D12_RESOURCE_ALLOCATION_INFO allocInfo{};
allocInfo = m_device->GetResourceAllocationInfo(m_nodeMask, 1, &textureDesc);
cudaExternalMemoryHandleDesc extDesc{};
extDesc.type = cudaExternalMemoryHandleTypeD3D12Resource;
extDesc.handle.win32.handle = sharedHandle;
extDesc.size = allocInfo.SizeInBytes;
extDesc.flags = cudaExternalMemoryDedicated;
CheckCudaErrors(cudaImportExternalMemory(&m_externalMemory, &extDesc));

cudaExternalMemoryMipmappedArrayDesc cuTexDesc{};
cuTexDesc.extent = make_cudaExtent(TextureWidth, TextureHeight, 0);
cuTexDesc.formatDesc = cudaCreateChannelDesc<float4>();
CheckCudaErrors(cudaMallocMipmappedArray(&cuMipArray, &cuTexDesc.formatDesc, cuTexDesc.extent, cuTexDesc.numLevels));
auto result = cudaExternalMemoryGetMappedMipmappedArray(&cuMipArray, m_externalMemory, &cuTexDesc); //HERE

I believe my code is correct, at least the arguments of cudaExternalMemoryGetMappedMipmappedArray are correct (they exists). Why is this happening ? What can be done here ?

cuTexDesc.numLevels

was 0 and should have been at 1.

cudaExternalMemoryGetMappedMipmappedArray now returns success.