TimSong412 / 2D-surfel-gaussian

GNU General Public License v3.0
163 stars 6 forks source link

Keep getting CUDA_HOME environment variable is not set. #11

Closed Maxiviper117 closed 4 months ago

Maxiviper117 commented 5 months ago

Keep getting CUDA_HOME environment variable is not set error even when it is set?

(2dgs) PS E:\DEV\github-repos\2D-gaussian> pip install ./submodules/simple-knn
Processing e:\dev\github-repos\2d-gaussian\submodules\simple-knn
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [12 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "E:\DEV\github-repos\2D-gaussian\submodules\simple-knn\setup.py", line 24, in <module>
          CUDAExtension(
        File "E:\Users\xxxxx\anaconda3\envs\2dgs\lib\site-packages\torch\utils\cpp_extension.py", line 1077, in CUDAExtension
          library_dirs += library_paths(cuda=True)
        File "E:\Users\xxxxx\anaconda3\envs\2dgs\lib\site-packages\torch\utils\cpp_extension.py", line 1211, in library_paths
          paths.append(_join_cuda_home(lib_dir))
        File "E:\Users\xxxxx\anaconda3\envs\2dgs\lib\site-packages\torch\utils\cpp_extension.py", line 2419, in _join_cuda_home
          raise OSError('CUDA_HOME environment variable is not set. '
      OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

image

TimSong412 commented 5 months ago

Hi, I am not familiar with installation on Windows. We follow the installation of simple-knn as that of 3D gaussian. I suggest you may resort 3D gaussian for the issue?

Maxiviper117 commented 5 months ago

Strange because this repo, according to the readme, is based on this implementation https://github.com/graphdeco-inria/gaussian-splatting

That version also installs simple-knn via submodule, but I do not run into the same issue and am able to successfully install and run the code.

In their conda environment.yml:

name: gaussian_splatting
channels:
  - pytorch
  - conda-forge
  - defaults
dependencies:
  - cudatoolkit=11.6
  - plyfile
  - python=3.7.13
  - pip=22.3.1
  - pytorch=1.12.1
  - torchaudio=0.12.1
  - torchvision=0.13.1
  - tqdm
  - pip:
    - submodules/diff-gaussian-rasterization
    - submodules/simple-knn