Trying to setup a docker container with Pytorch3D, using Nvidia's Pytorch images, I kept running into a strange build error, which spat out an immense amount of red text. Digging through I found some references to certain features in the source code requiring the C++17 standard, which apparently had not been set.
To work around this issue I've adjusted the setup.py file on lines 52 and 77 to build with --std=c++17 instead, and builds are now successful. I haven't yet had a chance to test whether the GPU acceleration works, but at least it'll build in a consistent manner.
Instructions To Reproduce the Issue:
Please include the following (depending on what the issue is):
nvcc_args.append("-std=c++17")
if cub_home is None:
prefix = os.environ.get("CONDA_PREFIX", None)
if prefix is not None and os.path.isdir(prefix + "/include/cub"):
The full error log is way too long to include here, in fact it didn't even fit in my terminal buffer.
I am not in the loop enough to know why the setup.py calls out the c++14 standard, while the C++ code seems to require c++17 features, nor do I know if this is kept at c++14 for a particular reason. But if this is all it takes to get a successful build in a Docker image, I'll post it here too in case it ends up being useful for someone else.
🐛 Bugs / Unexpected behaviors
Trying to setup a docker container with Pytorch3D, using Nvidia's Pytorch images, I kept running into a strange build error, which spat out an immense amount of red text. Digging through I found some references to certain features in the source code requiring the C++17 standard, which apparently had not been set.
To work around this issue I've adjusted the
setup.py
file on lines 52 and 77 to build with--std=c++17
instead, and builds are now successful. I haven't yet had a chance to test whether the GPU acceleration works, but at least it'll build in a consistent manner.Instructions To Reproduce the Issue:
Please include the following (depending on what the issue is):
git diff
) or code you wrote@@ -74,7 +74,7 @@ def get_extensions(): "-D__CUDA_NO_HALF2_OPERATORS__", ] if os.name != "nt":
Dockerfile:
I am not in the loop enough to know why the
setup.py
calls out the c++14 standard, while the C++ code seems to require c++17 features, nor do I know if this is kept at c++14 for a particular reason. But if this is all it takes to get a successful build in a Docker image, I'll post it here too in case it ends up being useful for someone else.