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 7400991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:20:54+00:00 2026-05-29T04:20:54+00:00

I was following this: Dynamically allocating memory inside __device/global__ CUDA kernel But it still

  • 0

I was following this: Dynamically allocating memory inside __device/global__ CUDA kernel

But it still doesn’t compile.

error : calling a host function("_malloc_dbg") from a __device__/__global__  
function("kernel") is not allowed

error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA  
\v4.1\bin\nvcc.exe" -gencode=arch=compute_20,code=\"sm_20,compute_20\"  
--use-local-env --cl-version 2010 -ccbin "c:\Program Files (x86)\Microsoft Visual  
Studio 10.0\VC\bin\x86_amd64" -I"..\..\..\Source\Include" -G0  --keep-dir   
"x64\Debug" -maxrregcount=0  --machine 64 --compile  -g  -Xcompiler "/EHsc /nologo 
/Od /Zi  /MDd " -o "x64\Debug\move.cu.obj"  "C:\Source\scene\move.cu"" exited with  
code 2. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA  
4.1.targets     361 10  

As suggested, I added #if __CUDA_ARCH__ >= 200 and it returns false.

What else can be the issues? I’m running on a GTX480.

Edit: I have this warning as well: #warning C4005: '_malloca' : macro redefinition

  • 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-29T04:20:55+00:00Added an answer on May 29, 2026 at 4:20 am

    I understand you solved your main problem but there is the remaining question:

    I added #if __CUDA_ARCH__ >= 200 and it returns false.

    The CUDA code is compiled at least twice. In one compilation pass the CPU code is generated, in another pass, the device code. __CUDA_ARCH__ is defined only for the device code generation.
    It is possible to make even more compilation passes and produce GPU code for several architectures. The code for CPU would not change, but the GPU will.

    I suspect that you are testing the #if __CUDA_ARCH__ >= 200 when producing CPU code.

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

Sidebar

Related Questions

I have this following where I would like to dynamically add the list elements
I get an error at adapter.getFilter().filter(s) in the onTextChanged() function. I was following this
Following this question: Good crash reporting library in c# Is there any library like
Following this example, I can list all elements into a pdf file import pyPdf
following this link i was able to load and read pixels from a .gif.
I've been following this tutorial (lesson 6) in order to build and deploy a
So I am following this guide: http://technotes.1000lines.net/?p=23 and I am going through the steps.
I'm following this tutorial (seems good) for Rails. After I run ruby script/generate scaffold
I'm following this walkthrough: http://msdn.microsoft.com/en-us/library/879kf95c(VS.80).aspx In a machine running vista ultimate, I have installed:
I'm following this walktrough: http://msdn.microsoft.com/en-us/library/879kf95c.aspx to add user login and register pages using out-of-the-box

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.