Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5967713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:59:02+00:00 2026-05-22T19:59:02+00:00

I have found weird behavior of CUDA. After I got segfault in my kernel,

  • 0

I have found weird behavior of CUDA. After I got segfault in my kernel, I was trying to free prior allocated memory and it fails. Does CUDA do it automatically? I mean, does CUDA free memory after segfault during kernel executions?

Here is code to reproduce my situation. I have tested that on CUDA 4.0, 4.0rc2 and 3.2

#include <cassert>

__global__ void segfault(){
    int* null = NULL;
    *null = 0;
}

int main() {
    int* i;
    assert (cudaSuccess ==  cudaHostAlloc(&i, sizeof(int)*100, cudaHostAllocMapped));
    segfault<<<1,100>>>();
    assert (cudaErrorLaunchFailure == cudaThreadSynchronize());
    assert (cudaErrorLaunchFailure == cudaGetLastError());
    assert (cudaSuccess == cudaGetLastError());
    assert (cudaSuccess == cudaFreeHost(i));
    return 0;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:59:02+00:00Added an answer on May 22, 2026 at 7:59 pm

    In my experience, once you hit that kind of error in CUDA execution, all subsequent operations will fail until you reset the device. The documentation indicates that the memory is scoped to the CUDA context, so when you destroy the context (by resetting the device), the memory will be freed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just found something very weird while developing a website. While trying to
I have a Rails 3.1 app where I just got some weird behavior. I
I found a weird behavior of jquery's html function. I have the following code
I believe I have found a weird bug as follow: I want to delete
I just found a weird behavior when attempting to extract a string from the
Ok, so I found something weird over the weekend. I have a WPF app
I have found a weird bug in my application and due to my small
I'm debugging my program with gdb and I have found a weird value for
I seem to have found a weird edge case where it seems that a
I have a little weird behavior with my ASP.NET MVC 2 application. I'm using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.