HPCE / hpce-2017-cw6

2 stars 17 forks source link

Cuda compiler #31

Closed JanMatas closed 6 years ago

JanMatas commented 6 years ago

Hi,

I was glad to learn that nvidia-cuda-dev will be installed on the AMI. However, it would really help to also install associated compiler nvcc because the code that uses cuda needs to be compiled by it.

A possible workaround would be to add compiled binaries to the git repo that would be just linked by g++ but this does not seem like a good practice.

m8pple commented 6 years ago

Good point - I haven't used CUDA in about 5 years, and forgot that the compiler is a separate thing in their world. I'm getting worried about disk-space (as I need a lot of it to hold outputs from all the submissions), so I can do:

 sudo apt install --no-install-recommends nvidia-cuda-toolkit

Does that give enough of the toolkit to compile things?

JanMatas commented 6 years ago

Sorry for late reply. I have some bad news on this front - altough the nvidia-cuda-toolkit indeed provides everything we need to compile cuda, it does not work on the target g3.4xlarge machine. The GPU there is too "new" for the drivers in jessie repos.

One solution is to run Debian Stretch (probably not doable at this point) or to install the drivers using jessie backports.

The rough steps I took to make it working are the following:

  1. Add this to /etc/apt/sources.list

    deb http://httpredir.debian.org/debian jessie-backports main contrib non-free

  2. In terminal:

    sudo apt-get update

  3. Install headers:

    sudo apt-get install linux-headers-$(uname -r|sed 's/[^-]-[^-]-//')

  4. Update again

    sudo apt-get update

  5. Install toolkit:

    sudo apt-get install -t jessie-backports nvidia-driver nvidia-cuda-toolkit nvidia-smi

  6. Check it works (this should not return an error):

    nvidia-smi

m8pple commented 6 years ago

Yes - someone pointed out the driver problem in #39; it turned out I'd updated in my AMI over the summer using backports too, but not propagated to the public AMI. So I'll pull in the updated cuda toolkit too.

Thanks for the set of steps though - full solutions are always appreciated.