voxcraft / voxcraft-sim

a GPU-accelerated voxel-based physics engine
Creative Commons Zero v1.0 Universal
43 stars 10 forks source link

[Bug] Can't access GPUs during docker build #47

Open liusida opened 3 years ago

liusida commented 3 years ago

When I was running

docker build -t voxcraft-sim .

I had this error message:

-- Autodetected CUDA architecture(s): 3.5;5.0;3.0;5.2;6.0;6.1;7.0;7.5;7.5+PTX
CUDA_SELECT_NVCC_ARCH_FLAGS returns: -gencodearch=compute_35,code=sm_35-gencodearch=compute_50,code=sm_50-gencodearch=compute_30,code=sm_30-gencodearch=compute_52,code=sm_52-gencodearch=compute_60,code=sm_60-gencodearch=compute_61,code=sm_61-gencodearch=compute_70,code=sm_70-gencodearch=compute_75,code=sm_75-gencodearch=compute_75,code=compute_75
Flag length: 18
CMake Error at CMakeLists.txt:54 (message):
  Nvidia GPU not found.  Abort.

Seems one can't access GPUs during docker build. According to answers here: https://stackoverflow.com/questions/59691207/docker-build-with-nvidia-runtime

My work around is to comment out the final line in Dockerfile:

# RUN git clone https://github.com/voxcraft/voxcraft-sim.git \
#     && cd voxcraft-sim && mkdir build && cd build && cmake .. && make -j 10

and after voxcraft-sim was built, I got in by

$ docker run -it --rm --gpus all voxcraft-sim

and pull github and compile manually.

liusida commented 3 years ago

Maybe a good way to do this is clone the repo locally, and only build a docker container to be a proper environment, and docker run -v to mount local folder to the container, and compile. So one can modify the local folder and compile and test inside the container.

cfusting commented 3 years ago

Was the nvidia runtime container installed?

liusida commented 3 years ago

Yes. I am not sure why docker doesn't really work for me.

I tend to view the docker container as a compile environment. Once compile is done, the app can be run locally. I tried to make some change here https://github.com/voxcraft/voxcraft-sim/blob/docker_with_mount/Dockerfile and some bash files to help execute docker-related command, because I can't remember them and they are so long.

But I'm not very confident of using docker, still.

manavbilakhia commented 3 years ago

I am running into the same error and tried the fix. I am having trouble mounting the file locally.