Spaces:
Sleeping
Sleeping
Georg commited on
Commit ·
39ce43c
1
Parent(s): 23fa3da
Optimized Docker build to fix OOM errors
Browse files- Dockerfile +1 -1
Dockerfile
CHANGED
|
@@ -17,7 +17,7 @@ ENV MAX_JOBS=1
|
|
| 17 |
RUN git clone --depth 1 https://github.com/NVlabs/nvdiffrast.git /tmp/nvdiffrast \
|
| 18 |
&& cd /tmp/nvdiffrast \
|
| 19 |
&& python3 setup.py build_ext --inplace
|
| 20 |
-
RUN python3 -c "import shutil, sysconfig, glob; from pathlib import Path; site=Path(sysconfig.get_paths()['purelib']); src=Path('/tmp/nvdiffrast/nvdiffrast'); dst=site/'nvdiffrast'; shutil.rmtree(dst, ignore_errors=True); shutil.copytree(src, dst); so_files=glob.glob('/tmp/nvdiffrast/_nvdiffrast_c*.so'); [shutil.copy2(p, site) for p in so_files]"
|
| 21 |
RUN python3 -c "import sysconfig; from pathlib import Path; site=Path(sysconfig.get_paths()['purelib']); dist=site/'nvdiffrast-0.0.0.dist-info'; dist.mkdir(exist_ok=True); (dist/'METADATA').write_text('Metadata-Version: 2.1\\nName: nvdiffrast\\nVersion: 0.0.0\\n'); (dist/'WHEEL').write_text('Wheel-Version: 1.0\\nGenerator: manual\\nRoot-Is-Purelib: false\\nTag: py3-none-any\\n'); (dist/'top_level.txt').write_text('nvdiffrast\\n'); (dist/'RECORD').write_text('')"
|
| 22 |
RUN python3 -c "import nvdiffrast.torch"
|
| 23 |
RUN rm -rf /tmp/nvdiffrast
|
|
|
|
| 17 |
RUN git clone --depth 1 https://github.com/NVlabs/nvdiffrast.git /tmp/nvdiffrast \
|
| 18 |
&& cd /tmp/nvdiffrast \
|
| 19 |
&& python3 setup.py build_ext --inplace
|
| 20 |
+
RUN python3 -c "import shutil, sysconfig, glob; from pathlib import Path; site=Path(sysconfig.get_paths()['purelib']); src=Path('/tmp/nvdiffrast/nvdiffrast'); dst=site/'nvdiffrast'; shutil.rmtree(dst, ignore_errors=True); shutil.copytree(src, dst); so_files=(glob.glob('/tmp/nvdiffrast/_nvdiffrast_c*.so') + glob.glob('/tmp/nvdiffrast/nvdiffrast/_nvdiffrast_c*.so') + glob.glob('/tmp/nvdiffrast/build/lib.*/*_nvdiffrast_c*.so')); [shutil.copy2(p, site) for p in so_files]"
|
| 21 |
RUN python3 -c "import sysconfig; from pathlib import Path; site=Path(sysconfig.get_paths()['purelib']); dist=site/'nvdiffrast-0.0.0.dist-info'; dist.mkdir(exist_ok=True); (dist/'METADATA').write_text('Metadata-Version: 2.1\\nName: nvdiffrast\\nVersion: 0.0.0\\n'); (dist/'WHEEL').write_text('Wheel-Version: 1.0\\nGenerator: manual\\nRoot-Is-Purelib: false\\nTag: py3-none-any\\n'); (dist/'top_level.txt').write_text('nvdiffrast\\n'); (dist/'RECORD').write_text('')"
|
| 22 |
RUN python3 -c "import nvdiffrast.torch"
|
| 23 |
RUN rm -rf /tmp/nvdiffrast
|