Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SofaCUDA] Compilation error fix (CudaStandardTetrahedralFEMForceField.cu) #991

Merged
merged 2 commits into from
Apr 24, 2019

Conversation

Ant0nin
Copy link

@Ant0nin Ant0nin commented Apr 12, 2019

Compilation error fix. When CMake variables PLUGIN_SOFACUDA and SOFACUDA_DOUBLE are enabled, CudaStandardTetrahedralFEMForceField.cu try to be compiled through NVCC (Nvidia compiler). It was leading to a compile error because of 2 missing function prototypes in the .cu file. This commit fixes the issue. Compilation was tested on my side on Fedora 29 with CUDA Toolkit v10.1


This PR:

  • builds with SUCCESS for all platforms on the CI.
  • does not generate new warnings.
  • does not generate new unit test failures.
  • does not generate new scene test failures.
  • does not break API compatibility.
  • is more than 1 week old (or has fast-merge label).

Reviewers will merge only if all these checks are true.

…A and SOFACUDA_DOUBLE are enabled, CudaStandardTetrahedralFEMForceField.cu try to be compiled through NVCC (Nvidia compiler). It was leading to a compile error because of 2 missing function prototypes in the .cu file. This commit fixes the issue. Compilation was tested on Fedora 29 with CUDA Toolkit v10.1
@guparan
Copy link
Contributor

guparan commented Apr 12, 2019

Congrats for your first PR @Ant0nin 👏
I guess we never enable SOFACUDA_DOUBLE on our CI 😞

@guparan guparan added pr: fix Fix a bug pr: status to review To notify reviewers to review this pull-request labels Apr 12, 2019
@guparan guparan added pr: status ready Approved a pull-request, ready to be squashed and removed pr: status to review To notify reviewers to review this pull-request labels Apr 17, 2019
@guparan
Copy link
Contributor

guparan commented Apr 17, 2019

From SOFA-dev meeting: we had a hard time understanding why it did not compile with CUDA_DOUBLE in the first place. Could you explain why?

@guparan guparan added pr: status to review To notify reviewers to review this pull-request and removed pr: status ready Approved a pull-request, ready to be squashed labels Apr 17, 2019
@epernod
Copy link
Contributor

epernod commented Apr 17, 2019

hello @Ant0nin , are you speaking about the option:
SOFACUDA_DOUBLE
or
SOFA_GPU_CUDA_DOUBLE_PRECISE

my version with SOFACUDA_DOUBLE activated compile on windows 10 with recent cudaToolkit.
Maybe can you put here the error log.

@Ant0nin
Copy link
Author

Ant0nin commented Apr 17, 2019

@guparan @epernod , I just tested the compilation again (without my patch) and I realized that SOFACUDA_DOUBLE has nothing to do with this issue, I was wrong about that. On my setup, the compilation does not works regardless of the SOFACUDA_DOUBLE option. I'm a bit surprized it works on your side.

Here are information on my setup:
OS => Fedora 29
NVCC version => V10.1.105
CMake variable SOFACUDA_ARCH=sm_60
CMake variable CUDA_VERSION=10.1

And here are the output errors from ninja:

[1/96] Building NVCC (Device) object applications/plugins/SofaCUDA/CMakeFiles/SofaCUDA.dir/sofa/gpu/cuda/SofaCUDA_generated_CudaStandardTetrahedralFEMForceField.cu.o
FAILED: applications/plugins/SofaCUDA/CMakeFiles/SofaCUDA.dir/sofa/gpu/cuda/SofaCUDA_generated_CudaStandardTetrahedralFEMForceField.cu.o 
cd /home/abernard/Workspace/sofa/build_master/applications/plugins/SofaCUDA/CMakeFiles/SofaCUDA.dir/sofa/gpu/cuda && /usr/bin/cmake -E make_directory /home/abernard/Workspace/sofa/build_master/applications/plugins/SofaCUDA/CMakeFiles/SofaCUDA.dir/sofa/gpu/cuda/. && /usr/bin/cmake -D verbose:BOOL=OFF -D build_configuration:STRING=Release -D generated_file:STRING=/home/abernard/Workspace/sofa/build_master/applications/plugins/SofaCUDA/CMakeFiles/SofaCUDA.dir/sofa/gpu/cuda/./SofaCUDA_generated_CudaStandardTetrahedralFEMForceField.cu.o -D generated_cubin_file:STRING=/home/abernard/Workspace/sofa/build_master/applications/plugins/SofaCUDA/CMakeFiles/SofaCUDA.dir/sofa/gpu/cuda/./SofaCUDA_generated_CudaStandardTetrahedralFEMForceField.cu.o.cubin.txt -P /home/abernard/Workspace/sofa/build_master/applications/plugins/SofaCUDA/CMakeFiles/SofaCUDA.dir/sofa/gpu/cuda/SofaCUDA_generated_CudaStandardTetrahedralFEMForceField.cu.o.Release.cmake
/home/abernard/Workspace/sofa/src_master/applications/plugins/SofaCUDA/sofa/gpu/cuda/CudaStandardTetrahedralFEMForceField.cu(1251): warning: variable "threads2" was declared but never referenced

/home/abernard/Workspace/sofa/src_master/applications/plugins/SofaCUDA/sofa/gpu/cuda/CudaStandardTetrahedralFEMForceField.cu(360): error: identifier "StandardTetrahedralFEMForceFieldCuda_BoyceAndArruda_deriveSPKTensor" is undefined
          detected during instantiation of "void StandardTetrahedralFEMForceFieldCuda_addForce_kernel(int, real *, real *, const real *, __nv_bool, const real *, float, float) [with real=float]" 
(1248): here

/home/abernard/Workspace/sofa/src_master/applications/plugins/SofaCUDA/sofa/gpu/cuda/CudaStandardTetrahedralFEMForceField.cu(587): error: identifier "StandardTetrahedralFEMForceFieldCuda_BoyceAndArruda_ElasticityTensor" is undefined
          detected during instantiation of "void StandardTetrahedralFEMForceFieldCuda_addDForce_kernel(int, real *, real *, real, real, real *) [with real=float]" 
(1266): here

2 errors detected in the compilation of "/tmp/tmpxft_0000044c_00000000-6_CudaStandardTetrahedralFEMForceField.cpp1.ii".
CMake Error at SofaCUDA_generated_CudaStandardTetrahedralFEMForceField.cu.o.Release.cmake:275 (message):
  Error generating file
  /home/abernard/Workspace/sofa/build_master/applications/plugins/SofaCUDA/CMakeFiles/SofaCUDA.dir/sofa/gpu/cuda/./SofaCUDA_generated_CudaStandardTetrahedralFEMForceField.cu.o

@epernod
Copy link
Contributor

epernod commented Apr 19, 2019

I'm using sofaCUDA on windows. Will try to install it on my ubuntu 18.04

@guparan guparan added pr: status ready Approved a pull-request, ready to be squashed and removed pr: status to review To notify reviewers to review this pull-request labels Apr 24, 2019
@guparan guparan merged commit dce505f into sofa-framework:master Apr 24, 2019
@guparan guparan added this to the v19.06 milestone Jun 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: fix Fix a bug pr: status ready Approved a pull-request, ready to be squashed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants