diffvg: CUDA Runtime Error: an illegal memory access was encountered

Hi, I encountered an error when running apps/single_curve_sdf_trans.py with GPU.

~/diffvg/apps$ CUDA_VISIBLE_DEVICES=1 python single_curve_sdf_trans.py 
CUDA Runtime Error: an illegal memory access was encountered at ~/diffvg/diffvg.cpp:1631

When this error occurred, the terminal hangs.

    // Clean up weight image
    if (scene->use_gpu) {
#ifdef __CUDACC__
        checkCuda(cudaFree(weight_image)); <--------------error occurred to this line
#else
        assert(false);
#endif
    } else {
        free(weight_image);
    }

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

Change max_hit_shapes to a larger number? https://github.com/BachiLi/diffvg/blob/fd38f71527b6258ddaf54ba2db3596b396dc80e1/diffvg.cpp#L542

Sorry this is a stupid restriction. I need to fix it : (

sorry i was in the wrong mindset: diffvg doesn’t have CPU mode : ( can you run it with cuda-memcheck?

any chance you can build diffvg in debug mode and let me know at which line it breaks?