CUDA 8 on EMR with g2.2xlarge instance type
发表时间:2017-02-10 12:15:31Below is a quick recap of the steps to make CUDA 8 working on an single-node EMR cluster with the g2.2xlarge instance type. The challenges here being (1) finding a particular version of the Nvidia driver that would work with CUDA 8, and (2) installing the Nvidia driver and the CUDA Toolkit when there is only very limited disk space on /dev/xvda1.
#
# STEP 1: Install Nvidia Driver
# 367.57 is a version that has been verified to be working with CUDA 8
#
sudo yum install -y gcc kernel-devel-`uname -r`
cd /mnt
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/367.57/NVIDIA-Linux-x86_64-367.57.run
sudo /bin/bash ./NVIDIA-Linux-x86_64-367.57.run
nvidia-smi
#
# STEP 2: Install CUDA Repo
# Since we have limited disk space on /dev/xvda1, we use a symbolic link as a workaround
#
cd /mnt
wget https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda-repo-rhel6-8-0-local-ga2-8.0.61-1.x86_64-rpm
mkdir -p /mnt/cuda-repo-8-0-local-ga2
sudo ln -s /mnt/cuda-repo-8-0-local-ga2 /var/cuda-repo-8-0-local-ga2
sudo rpm -i cuda-repo-rhel6-8-0-local-ga2-8.0.61-1.x86_64-rpm
#
# STEP 3: Install CUDA Toolkit
# Since we have limited disk space on /dev/xvda1, we use a symbolic link as a workaround
#
cd /mnt
mkdir -p /mnt/cuda-8.0
sudo ln -s /mnt/cuda-8.0 /usr/local/cuda-8.0
sudo yum install cuda-toolkit-8-0
export PATH=$PATH:/usr/local/cuda-8.0/bin
nvcc --version
#
# STEP 4: Compile a sample program (deviceQuery) to use CUDA
#
cd /usr/local/cuda-8.0
sudo chown -R hadoop:hadoop samples
cd samples/1_Utilities/deviceQuery
make
./deviceQuery
At this point everything should be all set. I have also compiled and tested some other sample code from the samples folder and they all seemed to work.
A quick example on cuBLAS can be obtained from http://docs.nvidia.com/cuda/cublas/ . Simply copy Example 1 or Example 2 from this web page and save it as test.c, then compile and run the code with the following commands. I have tested both of them and verified them to be working.
#
# STEP 5: Compile and test cuBLAS code
#
nvcc test.c -lcublas -o test
./test
| 上一篇 | 下一篇 |
| 姓名: | |
| 评论: | |
|
请输入下面这首诗词的作者姓名。 空山新雨后,天气晚来秋。 |
|
| 答案: | |
云与清风常拥有,
冰雪知音世难求。
击节纵歌相对笑,
案上诗书杯中酒。
2020年12月31日
洛杉矶
最新评论
2026-07-23 11:37:04
qyjohn 评论了 《几句翻译》
2026-07-21 20:11:28
wells 评论了 《几句翻译》
2025-11-15 06:29:51
qyjohn 评论了 《青桔》
2025-11-14 01:55:04
wells 评论了 《青桔》
2025-10-24 18:04:06
Ted Wang 评论了 《关于作者(About Me)》
2025-03-27 08:28:09
Max 评论了 《父亲走了》
2025-03-08 04:13:52
W 评论了 《我不想颂扬普京大帝》
2024-07-22 16:02:03
云思 评论了 《无题》
2024-06-27 10:01:54
yiming 评论了 《致访客(Welcome)》
2024-05-06 08:50:06
qyjohn 评论了 《致访客(Welcome)》
2024-05-03 19:49:00
jimmie 评论了 《致访客(Welcome)》
2024-02-19 03:32:57
林小静 评论了 《埋剑渡》
2024-01-05 03:54:28
路过者 评论了 《2023年度盘点》
2024-01-04 10:22:05
qyjohn 评论了 《致访客(Welcome)》
2024-01-04 08:05:13
qyjohn 评论了 《2023年度盘点》