Merge pull request #306 from gonsolo/wayland

Fix crash on Wayland.
This commit is contained in:
Matt Pharr 2022-11-10 05:59:24 -08:00 • committed by GitHub
commit dd7b255b56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -352,9 +352,10 @@ CUDAOutputBuffer<PIXEL_FORMAT>::CUDAOutputBuffer(int32_t width, int32_t height)
CUDA_CHECK(cudaGetDevice(&current_device));
CUDA_CHECK(cudaDeviceGetAttribute(&is_display_device, cudaDevAttrKernelExecTimeout,
current_device));
if (!is_display_device)
LOG_FATAL("GL interop is only available on display device.");
if (getenv("XDG_SESSION_TYPE") == nullptr || getenv("XDG_SESSION_TYPE") != std::string("wayland")) {
if (!is_display_device)
LOG_FATAL("GL interop is only available on display device.");
}
CUDA_CHECK(cudaGetDevice(&m_device_idx));
m_width = width;