ML350 Gen10 System에서 CUDA sample code nbody Test 수행해보기
- 무지한 탓에 십 수회를 재설치하고 재셋팅해보았다는 ...
System Information:
ML350 Gen10 (Intel Xeon 51xx)
ML350 Gen10 (Intel Xeon 62xx)
1. Set SW level
System ROM 2.62 / IE 0.2.3.0.0 / SPS 4.1.4.601 / iLO 2.65
2. Set WP
a. Restore Set Default
b. Virtualization - Max Performance: Yes
3. Install Ubuntu 20.04.3
a. Set "nomodeset" during Install
- Edit<E> GRUB: add "nomodeset"
linux /casper/vmlinuz nomodeset ---
b. Configure network (Set IP Address)
5. Install NVidia GPU Driver
a. blacklist nouveau
$ sudo vim /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="nouveau.modeset=0"
$ sudo update-grub2
- Set root credential
$ sudo passwd root
$ sudo bash -c "echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
$ sudo bash -c "echo options nouveau modeset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
$ sudo bash -c "echo install nouveau /bin/false >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
$ cat /etc/modprobe.d/blacklist-nvidia-nouveau.conf
$ sudo update-initramfs -u
b. Setup prerequisite for install GPU Driver
$ sudo vim /etc/apt/sources.list
$ sudo sed -i 's/mirror.kakao.com/us.archive.ubuntu.com/g' /etc/apt/sources.list
$ sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"
$ sudo apt-get update
$ sudo apt install libglvnd-dev pkg-config g++ freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev libfreeimage-dev
c. Install GUI
$ sudo apt-get install ubuntu-desktop
or $ sudo apt-get install --no-install-recommends ubuntu-desktop
$ sudo apt-get install indicator-appmenu-tools
$ sudo apt-get install indicator-session
$ sudo apt-get install indicator-datetime
$ sudo apt-get install indicator-applet-complete
$ sudo reboot
---------------------------------------------------------
cf. user mode commands
$ sudo systemctl isolate multi-user.target
$ sudo systemctl start graphical.target
$ sudo systemctl set-default multi-user
$ sudo systemctl set-default graphical
for nbody
$ cd /usr/local/cuda-11.4/samples/5_Simulations/nbody
$ sudo make
$ ls /usr/local/cuda-11.4/samples/bin/x86_64/linux/release/nbody
if libGLU.so not found:
$ sudo apt-get install libglu1-mesa libxi-dev libxmu-dev libglu1-mesa-dev
if cannot find -lglut:
$ sudo apt-get install freeglut3-dev
---------------------------------------------------------
d. Install GPU Driver
$ sudo systemctl isolate multi-user.target
$ wget https://us.download.nvidia.com/XFree86/Linux-x86_64/470.129.06/NVIDIA-Linux-x86_64-470.129.06.run
$ sudo chmod +x ./NVIDIA-Linux-x86_64-470.129.06.run
$ sudo sh ./NVIDIA-Linux-x86_64-470.129.06.run
5. Install CUDA 11.4
a. Install CUDA
$ wget https://developer.download.nvidia.com/compute/cuda/11.4.4/local_installers/cuda_11.4.4_470.82.01_linux.run
$ sudo sh cuda_11.4.4_470.82.01_linux.run
$ sudo vim ~/.bashrc
PATH=/usr/local/cuda-11.4/bin:/usr/local/cuda-11.4/samples:/usr/local/cuda-11.4/samples/bin/x86_64/linux/release:${PATH:+:${PATH}}
LD_LIBRARY_PATH=/usr/local/cuda-11.4/lib64:${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
$ source ~/.bashrc
b. Install CUDA sample packages
$ cd /usr/local/cuda-11.4/samples
$ sudo make
$ sudo /usr/bin/nvidia-persistenced --verbose
$ sudo systemctl start graphical.target
6. nbody Test 수행 (GUI에서)
$ nbody -device=x -fp64
> CUDA Error가 발생 ... 왜 안되는 거지 ... ㅠ_ㅠ;;;
$ nbody -device=x -fp64 -benchmark
> 요건 동작
여려 자료를 참조한 끝에, (포기 직전에...) 아래 명령으로 구동에 성공 ... (제대로 한 것인지는 ... ...;;;;;)
# __NV_PRIME_RENDER_OFFLOAD=1 __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 __GLX_VENDOR_LIBRARY_NAME=nvidia nbody device=1
결론. 실행하기 무진장 어렵다 ... 오류도 많고... 관련 자료는 없고 ... (무지한 탓이겠지만 ...)
feat. 이런 오류와 끊임없이 사투를 벌이는 개발자분들 존경...