Results 1 to 5 of 5

Thread: nVidia + Linux: Dedicated cruncher

  1. #1
    Xtreme Cruncher
    Join Date
    Jun 2006
    Location
    Land o' 10,000 lakes
    Posts
    836

    nVidia + Linux: Dedicated cruncher

    I'm not sure if this is the best place to put this, but I figure it will have the most exposure so here goes.
    For a while now I had struggled with getting BOINC to cooperate correctly on linux with GPUs. Normally the issue I ran into was it starting before the driver had loaded, so it would give the "No Usable GPUs found" message in the logs. I think I've found a way to get around that with horrible init script suckitude. What I've found is that OpenCL (maybe CUDA) tries to open /dev/nvidiactl and /dev/nvidia0. So, all we need to do is make sure those exist (and the nvidia kernel module is loaded) without the aforementioned suck.
    In a nutshell: use systemd.
    Here's a startup script that seems to be working for me, to guarantee those devices exist on Arch Linux.
    Code:
    [Unit]
    Description=Creates nVidia /dev thingys
    Wants=multi-user.target
    Before=multi-user.target
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/usr/bin/mknod -m 666 /dev/nvidia0 c 195 0
    ExecStart=/usr/bin/mknod -m 666 /dev/nvidiactl c 195 255
    
    [Install]
    WantedBy=multi-user.target
    Drop that in /etc/systemd/system, run systemctl enable nvidia.service && systemctl start nvidia.service and voila. Anything using the nVidia OpenCL implementation should work. This appears to be working for me, but YMMV and there may be some things that need to be changed. Off the top of my head, if the nvidia kernel module isn't loading, you could add ExecStart=modprobe nvidia before the mknod commands in the service block.
    If I find something breaks or needs to be changed, I'll update it here.

    I'm almost always available on Steam to chat. Same username.

  2. #2
    Xtreme Addict FaYt's Avatar
    Join Date
    Jul 2008
    Location
    Langeveen NL
    Posts
    1,039
    Thanks this could be usefull to a lot of Linux users

  3. #3
    Xtreme Cruncher
    Join Date
    Jun 2006
    Location
    Land o' 10,000 lakes
    Posts
    836
    Played around a bit with multiple cards.
    Looks like it creates /dev/nvidia1 for a second card.
    I would think it creates /dev/nvidia2,3,n for each additional card, but I don't have enough cards to test with.
    My script-fu is too weak to write something neat to figure out how many cards are in the system and create the appropriate devices, but the quick & dirty way has been working fine so far.

    EDIT: Looks like you also need to increment the number after the first mknod command. So for the second card I added the line
    Code:
    ExecStart=/usr/bin/mknod -m 666 /dev/nvidia1 c 195 1
    So try making nvidian match 195 n.
    Last edited by jspace; 02-06-2013 at 08:11 PM.

    I'm almost always available on Steam to chat. Same username.

  4. #4
    Xtreme Cruncher
    Join Date
    Jun 2006
    Location
    Land o' 10,000 lakes
    Posts
    836
    BUMP WITH UPDATE!

    Something recently broke on my machines with an update to Mesa. There was a package split and it was kind of a mess, but the point is this doesn't seem to work with nvidia-334.21-5. I'll update here when I manage to figure this out.

    OK:
    So, first thing to do is make sure that the nvidia-uvm module is loaded.
    On Arch, do
    Code:
    echo "nvidia-uvm" >> /etc/modules-load.d/nvidia.conf
    Then, add this line to the startup script
    Code:
    ExecStart=/usr/bin/mknod -m 666 /dev/nvidia-uvm c 251 0
    251 was the magic number for me (determined by doing an ls -lha /dev | grep nvid after running some CUDA program as root and reading the output), but you may have to figure something else out. I don't know enough about makedev to figure out what goes there for sure.

    I found what I was looking for here.
    Right now, I just need to monitor things and made sure they are copacetic.
    Last edited by jspace; 03-25-2014 at 04:45 PM. Reason: Update

    I'm almost always available on Steam to chat. Same username.

  5. #5
    Xtreme Cruncher
    Join Date
    Jun 2006
    Location
    Land o' 10,000 lakes
    Posts
    836
    Another update:
    Looks like everything is working now. I've updated this on multiple machines and it seems to be running fine again.

    I'm almost always available on Steam to chat. Same username.

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •