File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ void jit_unregister_cuda_resource(void *cuda_resource) {
3838 ThreadState *ts = thread_state (JitBackend::CUDA);
3939 scoped_set_context guard (ts->context );
4040
41- uint32_t rv = cuGraphicsUnregisterResource ((CUgraphicsResource) cuda_resource);
41+ int rv = cuGraphicsUnregisterResource ((CUgraphicsResource) cuda_resource);
4242
4343 // OpenGL has already shut down. Ignore.
4444 if (rv == CUDA_ERROR_INVALID_GRAPHICS_CONTEXT)
@@ -78,8 +78,13 @@ void jit_unmap_graphics_resource(void *cuda_resource) {
7878 ThreadState *ts = thread_state (JitBackend::CUDA);
7979 scoped_set_context guard (ts->context );
8080
81- cuda_check (
82- cuGraphicsUnmapResources (1 , (CUgraphicsResource *) &cuda_resource, 0 ));
81+ int rv = cuGraphicsUnmapResources (1 , (CUgraphicsResource *) &cuda_resource, 0 );
82+
83+ // OpenGL has already shut down. Ignore.
84+ if (rv == CUDA_ERROR_INVALID_GRAPHICS_CONTEXT)
85+ return ;
86+
87+ cuda_check (rv);
8388}
8489
8590void jit_memcpy_2d_to_array_async (void *dst, const void *src, size_t src_pitch,
You can’t perform that action at this time.
0 commit comments