Open rodrigovimieiro opened 2 years ago
Not really an issue either but I thought it would be good for me as much as anyone to leave instructions to run MCGPU on docker on a similar note to @rodrigovimieiro
First you need to install docker to work with your gpu drivers:
https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html
Then:
docker pull nvidia/cuda:11.2.1-devel-ubuntu20.04
or whichever docker version you would like.docker run -it --gpus all nvidia/cuda:11.2.0-devel-ubuntu20.04 bash
apt-get update # update apt listings
apt install zlib1g-dev
apt install openmpi-dev
apt install git-all
apt install vim # optional for editing the makefile
nvcc MC-GPU_v1.5b.cu -o MC-GPU_v1.5b.x -m64 -O3 -use_fast_math -DUSING_MPI -I. -I/usr/local/cuda/include -I/root/cuda-samples/Common/ -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi -I/usr/lib/x86_64-linux-gnu/openmpi/include -L/usr/lib/x86_64-linux-gnu/openmpi/lib -lmpi -lz --ptxas-options=-v -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_61,code=sm_61 -gencode=arch=compute_75,code=sm_75
Environment (locally, so shouldn't really matter other than GPU):
Not really an issue. Just to help others who want to compile with new versions of CUDA.
CUDA Samples are not found in local installation anymore. Based on NVIDIA samples README:
So, these are the steps:
git clone https://github.com/NVIDIA/cuda-samples.git
;-I/usr/local/cuda/samples/common/inc -I/usr/local/cuda/samples/shared/inc/
to-I/yourPath/cuda-samples/Common/
in the make_MC-GPU_v1.5b.sh file;sudo apt install libopenmpi-dev
and thempicc -showme
command shows the path to the necessary libraries to compile mpi projects (based on this answer). Then substitute-I/usr/include/openmpi -L/usr/lib/ -lmpi
with the output from the previous command.This command works for me:
nvcc MC-GPU_v1.5b.cu -o MC-GPU_v1.5b.x -m64 -O3 -use_fast_math -DUSING_MPI -I. -I/usr/local/cuda/include -I/home/rodrigo/NVIDIA_CUDA-11.5_Samples/cuda-samples/Common/ -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi -I/usr/lib/x86_64-linux-gnu/openmpi/include -L/usr/lib/x86_64-linux-gnu/openmpi/lib -lmpi -lz --ptxas-options=-v -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_61,code=sm_61
Environment: