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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:53:28+00:00 2026-06-06T03:53:28+00:00

I am using GeForce 8400M GS on Ubuntu 10.04 and I am learning CUDA

  • 0

I am using GeForce 8400M GS on Ubuntu 10.04 and I am learning CUDA programming. I am writing and running few basic programs. I was using cudaMalloc, and it kept giving me an error until I ran the code as root. However, I had to run the code as root only once. After that, even if I run the code as normal user, I do not get an error on malloc. What’s going on?

  • 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-06-06T03:53:29+00:00Added an answer on June 6, 2026 at 3:53 am

    This is probably due to your GPU not being properly initialized at boot. I’ve come across this problem when using Ubuntu Server and other installations where an X server isn’t being started automatically. Try the following to fix it:

    Create a directory for a script to initialize your GPUs. I usually use /root/bin. In this directory, create a file called cudainit.sh with the following code in it (this script came from the Nvidia forums).

    #!/bin/bash
    
    /sbin/modprobe nvidia
    
    if [ "$?" -eq 0 ]; then
    
        # Count the number of NVIDIA controllers found.
        N3D=`/usr/bin/lspci | grep -i NVIDIA | grep "3D controller" | wc -l`
        NVGA=`/usr/bin/lspci | grep -i NVIDIA | grep "VGA compatible controller" | wc -l`
    
        N=`expr $N3D + $NVGA - 1`
        for i in `seq 0 $N`; do
            mknod -m 666 /dev/nvidia$i c 195 $i;
        done    
    
        mknod -m 666 /dev/nvidiactl c 195 255
    
    else
        exit 1
    fi  
    

    Now we need to make this script run automatically at boot. Edit /etc/rc.local to look like the following.

    #!/bin/sh -e
    #   
    # rc.local
    #   
    # This script is executed at the end of each multiuser runlevel.
    # Make sure that the script will "exit 0" on success or any other
    # value on error.
    #   
    # In order to enable or disable this script just change the execution
    # bits.
    #   
    # By default this script does nothing.
    
    #
    # Init CUDA for all users
    #   
    /root/bin/cudainit.sh
    
    exit 0
    

    Reboot your computer and try to run your CUDA program as a regular user. If I’m right about what the problem is, then it should be fixed.

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

Sidebar

Related Questions

I am using CUDA 4.0 on Geforce GTX 580 (Fermi) . I have numbers
I'm using a GeForce GTX 580 (compute capability 2.0). In my program i'm suspecting
I'm just starting to learn how to do CUDA development(using version 4) and was
I just managed to install my cuda SDK under Linux Ubuntu 10.04. My graphic
Using Xcode4.2.1, with a basic PhoneGap template based app. (I say template, but I
I am using the following parameters for my simulation on Geforce GT 220 card
Using Emacs 23.2.1 on Ubuntu Lucid, any mode based on Comint inserts occasional line
I've got a Dell XPS M1330 with a 2.2ghz processor, 4gig ram, GeForce 8400M,
Using the Exiv2 library to write some exif tags to an image i'm running
Using Point Cloud Library on Ubuntu, I am trying to take multiple point clouds

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.