728x90
반응형
NVIDIA 리눅스용 드라이버도 설치했고 CUDA Toolkit도 설치했다면
이제 CUDA SDK 코드 샘플을 좀 가지고 삽질을 해봐야지 ;;;;
우선 SDK 코드샘플은 해당계정 최상위 디렉토리에 소스코드가 설치되므로
SDK코드 샘플을 직접적으로 테스트할 계정을 우선 생성해보자..
(물론 경로 수정이 가능하지만 일반계정으로 실행해보자 ^^;;)
[root@chemzine home]# mkdir /home/user
[root@chemzine home]# useradd chemzine -d /home/user/chemzine
[root@chemzine home]# passwd chemzine
Changing password for user chemzine.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@chemzine home]# su chemzine
[chemzine@chemzine home]$ cd
[chemzine@chemzine ~]$ vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
[chemzine@chemzine ~]$ source .bash_profile
[chemzine@chemzine ~]$ which nvcc
/usr/local/cuda/bin/nvcc
[root@chemzine home]# useradd chemzine -d /home/user/chemzine
[root@chemzine home]# passwd chemzine
Changing password for user chemzine.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@chemzine home]# su chemzine
[chemzine@chemzine home]$ cd
[chemzine@chemzine ~]$ vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
[chemzine@chemzine ~]$ source .bash_profile
[chemzine@chemzine ~]$ which nvcc
/usr/local/cuda/bin/nvcc
해당 계정이 사용할 공간을 /home/user 디렉토리에서 사용하자.
디렉토리를 생성하고 (계정들이 사용할 공간을 한곳에 모아두기 위해 편의상....)
chemzine이라는 계정을 생성하고 그 유저디렉토리를 /home/user/chemzine 으로 지정한다.
그리고 CUDA toolkit 의 경로를 설정해야하는데
위 에디터 상의 파란 글씨를 다음과 같이 고친다.
위에 파란색으로 된 부분을 아래와 같이 수정합니다.
export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
vi 에디터의 사용법은 따로 정리를 하고 여기서는 단순히 수정 저장하는 법만 다루겠음.
방향키로 이동 후 수정하고자 하는 위치에서 a키 혹은 i키를 누르면
에디터 하단에 다음과 같이 나타남
경로 설정후 which 명령으로 nvcc의 위치를 확인했다면 경로설정이 완료된 것이다.
해당 계정으로 접속 후 SDK 코드 샘플을 다운로드 하거나 FTP, SSH등을 이용해 샘플파일을
업로드 하고 작업을 시작해보자..
[chemzine@chemzine ~]$ ls
cudasdk_2.3_linux.run
[chemzine@chemzine ~]$ sh cudasdk_2.3_linux.run
Verifying archive integrity... All good.
Uncompressing NVIDIA GPU Computing SDK.
..................................................................................
..................................................................................
..................................................................................
Enter install path (default ~/NVIDIA_GPU_Computing_SDK):
Located CUDA at /usr/local/cuda
If this is correct, choose the default below.
If it is not correct, enter the correct path to CUDA
Enter CUDA install path (default /usr/local/cuda):
설치 과정 생략..........................
* Please make sure your PATH includes /usr/local/cuda/bin
* Please make sure your LD_LIBRARY_PATH includes /usr/local/cuda/lib
* To uninstall the NVIDIA GPU Computing SDK, please delete /home/user/chemzine/NVIDIA_GPU_Computing_SDK
* Installation Complete
[chemzine@chemzine ~]$ ls
cudasdk_2.3_linux.run NVIDIA_GPU_Computing_SDK
cudasdk_2.3_linux.run
[chemzine@chemzine ~]$ sh cudasdk_2.3_linux.run
Verifying archive integrity... All good.
Uncompressing NVIDIA GPU Computing SDK.
..................................................................................
..................................................................................
..................................................................................
Enter install path (default ~/NVIDIA_GPU_Computing_SDK):
Located CUDA at /usr/local/cuda
If this is correct, choose the default below.
If it is not correct, enter the correct path to CUDA
Enter CUDA install path (default /usr/local/cuda):
설치 과정 생략..........................
* Please make sure your PATH includes /usr/local/cuda/bin
* Please make sure your LD_LIBRARY_PATH includes /usr/local/cuda/lib
* To uninstall the NVIDIA GPU Computing SDK, please delete /home/user/chemzine/NVIDIA_GPU_Computing_SDK
* Installation Complete
[chemzine@chemzine ~]$ ls
cudasdk_2.3_linux.run NVIDIA_GPU_Computing_SDK
이 과정을 마치고 나면 계정 홈디렉토리에 NVIDIA_GPU_Computing_SDK 디렉토리가 생성될것이다.
그럼 다음 시간에는 SDK 코드 샘플을 컴파일 해보도록하자..
728x90
반응형