Skip to content

Installation on windows. RuntimeError: Not compiled with GPU support #1230

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

Closed
wwdok opened this issue Jun 23, 2022 · 2 comments
Closed

Installation on windows. RuntimeError: Not compiled with GPU support #1230

wwdok opened this issue Jun 23, 2022 · 2 comments
Assignees
Labels
installation Installation questions or issues

Comments

@wwdok
Copy link

wwdok commented Jun 23, 2022

Although the Issues alrady have some similar issues, but i didn't notice a workable solution, so i open a new issue.

My computer system is Windows 10 .
Pytorch env are :
image
I install pytorch3d by :

git clone https://github.com/facebookresearch/pytorch3d.git
cd pytorch3d && pip install -e .

then i use pytorch3d to run this repo: https://github.com/ascust/3DMM-Fitting-Pytorch, it reports error:

PS D:\AI\3DMM\3DMM-Fitting-Pytorch> python fit_single_img.py --img_path data/000002.jpg --res_folder results
------------ Options -------------
cache_folder: fitting_cache
exp_reg_w: 0.0008
first_nrf_iters: 500
first_rf_iters: 1000
gpu: 0
id_reg_w: 0.001
img_path: data/000002.jpg
lm_loss_w: 100
nframes_shape: 16
nrf_lr: 0.01
padding_ratio: 0.3
recon_model: bfm09
res_folder: results
rest_nrf_iters: 30
rest_rf_iters: 50
rf_lr: 0.01
rgb_loss_w: 1.6
rot_reg_w: 1
tar_size: 256
tex_reg_w: 1.7e-06
tex_w: 1
trans_reg_w: 1
-------------- End ----------------
loading models
loading images
image is loaded. width: 423, height: 594
C:\Users\weida\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\nn\functional.py:780: UserWarning: Note that order of the arguments: ceil_mode and return_indices will changeto match the args list in nn.MaxPool2d in a future release.
  warnings.warn("Note that order of the arguments: ceil_mode and return_indices will change"
A face is detected. l: 44, t: 84, r: 356, b: 396
landmarks detected.
start rigid fitting
100%|█████████████████████████████████████████████████████████████████████████████| 1000/1000 [00:04<00:00, 239.56it/s]
done rigid fitting. lm_loss: 0.000491
start non-rigid fitting
  0%|                                                                                          | 0/500 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "fit_single_img.py", line 158, in <module>
    fit(args)
  File "fit_single_img.py", line 78, in fit
    pred_dict = recon_model(recon_model.get_packed_tensors(), render=True)
  File "C:\Users\weida\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "D:\AI\3DMM\3DMM-Fitting-Pytorch\core\BFM09Model.py", line 105, in forward
    rendered_img = self.renderer(mesh)
  File "C:\Users\weida\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "d:\ai\3dmm\pytorch3d\pytorch3d\renderer\mesh\renderer.py", line 63, in forward
    fragments = self.rasterizer(meshes_world, **kwargs)
  File "C:\Users\weida\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "d:\ai\3dmm\pytorch3d\pytorch3d\renderer\mesh\rasterizer.py", line 240, in forward
    pix_to_face, zbuf, bary_coords, dists = rasterize_meshes(
  File "d:\ai\3dmm\pytorch3d\pytorch3d\renderer\mesh\rasterize_meshes.py", line 234, in rasterize_meshes
    pix_to_face, zbuf, barycentric_coords, dists = _RasterizeFaceVerts.apply(
  File "d:\ai\3dmm\pytorch3d\pytorch3d\renderer\mesh\rasterize_meshes.py", line 308, in forward
    pix_to_face, zbuf, barycentric_coords, dists = _C.rasterize_meshes(
RuntimeError: Not compiled with GPU support
@bottler
Copy link
Contributor

bottler commented Jun 23, 2022

For some reason PyTorch3D built without cuda. You could try ensuring CUDA_HOME is set, creating a new environment. Then try to build pytorch3d again, setting the environment variable FORCE_CUDA to 1.

@bottler bottler self-assigned this Jun 23, 2022
@bottler bottler added the installation Installation questions or issues label Jun 23, 2022
@wwdok
Copy link
Author

wwdok commented Jun 24, 2022

I have successfully install pytorch3d with GPU support, let me summarize the process.

  1. First i mannually set force_cuda to 1, but 'pip install -e .' still didn't execute def get_extensions(), then i doubt 'pip install -e .' did NOT execute setup.py at all, i insert some prints insides setup.py, and run 'pip install -e .', it still not print out any print statements, so maybe 'pip install -e .' really didn't execute setup.py.
  2. I go to INSTALL.md, reread the guide, find there is anther install method : python setup.py install
    image
    execxuting python setup.py install, this time the windows prompt print out those print statements i inserted, so it proves setup.py has been executed.
  3. from the log, i found some warning and error, then i go to https://github.com/NVIDIA/cub/releases, download its source code, and set env variable CUB_HOME to its folder path, then i also use the x64 Native Tools Command Prompt for VS 2019 instead of common cmd prompt.
    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installation Installation questions or issues
Projects
None yet
Development

No branches or pull requests

2 participants