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

OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root. #2

Open
Bai426 opened this issue Aug 6, 2024 · 2 comments

Comments

@Bai426
Copy link

Bai426 commented Aug 6, 2024

When I installed Autostill-grounded-sam2, I am facing on the following questions:
1) It seems that the installation of SAM2 will be implemented every time when I run the python script.
fatal: destination path 'segment-anything-2' already exists and is not an empty directory.
Obtaining file:///C:/Users/ibo22/.cache/autodistill/segment_anything_2/segment-anything-2
Installing build dependencies ... done
Checking if build backend supports build_editable ... done
Getting requirements to build editable ... error
error: subprocess-exited-with-error

2) Cannot locate the CUDA.
× Getting requirements to build editable did not run successfully.
│ exit code: 1
╰─> [32 lines of output]
C:\Users\ibo22\AppData\Local\Temp\pip-build-env-yqwkereb\overlay\Lib\site-packages\torch_subclasses\functional_tensor.py:258: UserWarning: Failed to initialize NumPy: No module named 'numpy' (Triggered internally at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\utils\tensor_numpy.cpp:84.)
cpu = _conversion_method_template(device=torch.device("cpu"))
Traceback (most recent call last):
File "C:\Users\ibo22.conda\envs\gsam2\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 353, in
main()
File "C:\Users\ibo22.conda\envs\gsam2\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ibo22.conda\envs\gsam2\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 132, in get_requires_for_build_editable
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ibo22\AppData\Local\Temp\pip-build-env-yqwkereb\overlay\Lib\site-packages\setuptools\build_meta.py", line 458, in get_requires_for_build_editable
return self.get_requires_for_build_wheel(config_settings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ibo22\AppData\Local\Temp\pip-build-env-yqwkereb\overlay\Lib\site-packages\setuptools\build_meta.py", line 327, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ibo22\AppData\Local\Temp\pip-build-env-yqwkereb\overlay\Lib\site-packages\setuptools\build_meta.py", line 297, in _get_build_requires
self.run_setup()
File "C:\Users\ibo22\AppData\Local\Temp\pip-build-env-yqwkereb\overlay\Lib\site-packages\setuptools\build_meta.py", line 313, in run_setup
exec(code, locals())
File "", line 70, in
File "", line 51, in get_extensions
File "C:\Users\ibo22\AppData\Local\Temp\pip-build-env-yqwkereb\overlay\Lib\site-packages\torch\utils\cpp_extension.py", line 1076, in CUDAExtension
library_dirs += library_paths(cuda=True)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ibo22\AppData\Local\Temp\pip-build-env-yqwkereb\overlay\Lib\site-packages\torch\utils\cpp_extension.py", line 1214, in library_paths
paths.append(_join_cuda_home(lib_dir))
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ibo22\AppData\Local\Temp\pip-build-env-yqwkereb\overlay\Lib\site-packages\torch\utils\cpp_extension.py", line 2416, 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: subprocess-exited-with-error

@capjamesg
Copy link
Member

Hello there! Are you running this on a device with an NVIDIA GPU set up in your environment?

@Bai426
Copy link
Author

Bai426 commented Aug 7, 2024 via email

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

No branches or pull requests

1 participant