question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CUDA Runtime Error: an illegal memory access was encountered

See original GitHub issue

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);
    }

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
BachiLicommented, Mar 24, 2021

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 : (

1reaction
BachiLicommented, Mar 24, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

RuntimeError: CUDA error: an illegal memory access was ...
Hi,everyone! I met a strange illegal memory access error. It happens randomly without any regular pattern. The code is really simple.
Read more >
PyTorch CUDA error: an illegal memory access was ...
RuntimeError: CUDA error: an illegal memory access was encountered CUDA kernel errors might be asynchronously reported at some other API ...
Read more >
CUDA error: an illegal memory access was encountered with ...
Try to use the latest PyTorch (1.10). The error indicates an out of bound memory access similar to a segfault on the CPU,...
Read more >
CUDA error 700 - an illegal memory access was encountered
This could be due to you're running out of memory or accessing an illegal address via a pointer. Following similar issue may help...
Read more >
CUDA error: an illegal memory access was encountered - Part ...
RuntimeError: CUDA error: an illegal memory access was encountered CUDA kernel errors might be asynchronously reported at some other API ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found