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

Is it possible to have a CUDA compiled version? #54

Closed
1 task done
nikhilweee opened this issue May 12, 2021 · 2 comments · Fixed by #76
Closed
1 task done

Is it possible to have a CUDA compiled version? #54

nikhilweee opened this issue May 12, 2021 · 2 comments · Fixed by #76

Comments

@nikhilweee
Copy link

Issue: I tried checking if dlib is can use my GPU, but turns out it can't. Is it possible to have a CUDA compiled version of dlib?

Python 3.6.13 |Anaconda, Inc.| (default, Feb 23 2021, 21:15:04) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dlib
>>> dlib.cuda.get_num_devices()
1
>>> dlib.DLIB_USE_CUDA
False

Environment (conda list):
$ conda list
# packages in environment at /opt/conda/envs/tftorch36:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                      1_llvm    conda-forge
_tflow_select             2.1.0                       gpu  
absl-py                   0.12.0           py36h06a4308_0  
astor                     0.8.1                    py36_0  
bzip2                     1.0.8                h7b6447c_0  
c-ares                    1.17.1               h27cfd23_0  
ca-certificates           2021.4.13            h06a4308_1  
cached-property           1.5.2                      py_0  
cairo                     1.16.0               hf32fb01_1  
certifi                   2020.12.5        py36h06a4308_0  
cffi                      1.14.5           py36h261ae71_0  
cloudpickle               1.6.0                      py_0  
cudatoolkit               10.2.89              hfd86e86_1  
cudatoolkit-dev           10.1.243             h516909a_3    conda-forge
cudnn                     7.6.5.32             h01f27c4_1    conda-forge
cycler                    0.10.0                   py36_0  
cytoolz                   0.11.0           py36h7b6447c_0  
dask-core                 2021.3.0           pyhd3eb1b0_0  
dataclasses               0.8                pyh4f3eec9_6  
dbus                      1.13.18              hb2f20db_0  
decorator                 4.4.2              pyhd3eb1b0_0  
dlib                      19.22.0          py36h446f8a6_0    conda-forge
expat                     2.3.0                h2531618_2  
face_alignment            1.3.4                      py_1    1adrianb
ffmpeg                    4.3.1                hca11adc_2    conda-forge
fontconfig                2.13.1               h6c09931_0  
freetype                  2.10.4               h5ab3b9f_0  
future                    0.18.2                   py36_1  
gast                      0.4.0                      py_0  
gettext                   0.21.0               hf68c758_0  
glib                      2.68.1               h36276a3_0  
gmp                       6.2.1                h2531618_2  
gnutls                    3.6.15               he1e5248_0  
google-pasta              0.2.0                      py_0  
graphite2                 1.3.14               h23475e2_0  
grpcio                    1.37.1           py36h8e87921_0    conda-forge
gst-plugins-base          1.14.5               h0935bb2_2    conda-forge
gstreamer                 1.18.4               h76c114f_2    conda-forge
h5py                      3.1.0           nompi_py36hc1bc4f5_100    conda-forge
harfbuzz                  2.8.1                h83ec7ef_0    conda-forge
hdf5                      1.10.6               hb1b8bf9_0  
icu                       68.1                 h2531618_0  
imageio                   2.9.0              pyhd3eb1b0_0  
imagesize                 1.2.0              pyhd3eb1b0_0  
importlib-metadata        4.0.1            py36h5fab9bb_0    conda-forge
jasper                    1.900.1              hd497a04_4  
jinja2                    3.0.0                    pypi_0    pypi
jpeg                      9d                   h516909a_0    conda-forge
keras-applications        1.0.8                      py_1  
keras-preprocessing       1.1.2              pyhd3eb1b0_0  
kiwisolver                1.3.1            py36h2531618_0  
krb5                      1.17.2               h926e7f8_0    conda-forge
lame                      3.100                h7b6447c_0  
lcms2                     2.12                 h3be6417_0  
ld_impl_linux-64          2.35.1               hea4e1c9_2    conda-forge
libblas                   3.9.0                     8_mkl    conda-forge
libcblas                  3.9.0                     8_mkl    conda-forge
libclang                  11.1.0          default_ha53f305_0    conda-forge
libcurl                   7.76.1               hc4aaa36_1    conda-forge
libedit                   3.1.20210216         h27cfd23_1  
libev                     4.33                 h7b6447c_0  
libevent                  2.1.10               hcdb4288_3    conda-forge
libffi                    3.3                  he6710b0_2  
libgcc-ng                 9.3.0               h2828fa1_19    conda-forge
libgfortran-ng            7.5.0               h14aa051_19    conda-forge
libgfortran4              7.5.0               h14aa051_19    conda-forge
libglib                   2.68.1               h3e27bee_0    conda-forge
libiconv                  1.16                 h516909a_0    conda-forge
libidn2                   2.3.0                h27cfd23_0  
liblapack                 3.9.0                     8_mkl    conda-forge
liblapacke                3.9.0                     8_mkl    conda-forge
libllvm10                 10.0.1               hbcb73fb_5  
libllvm11                 11.1.0               hf817b99_2    conda-forge
libnghttp2                1.43.0               h812cca2_0    conda-forge
libopencv                 4.5.2            py36h3a58cea_0    conda-forge
libpng                    1.6.37               hbc83047_0  
libpq                     12.3                 hfd2b0eb_3    conda-forge
libprotobuf               3.15.8               h780b84a_0    conda-forge
libssh2                   1.9.0                h1ba5d50_1  
libstdcxx-ng              9.3.0               h6de172a_19    conda-forge
libtasn1                  4.16.0               h27cfd23_0  
libtiff                   4.2.0                h3942068_0  
libunistring              0.9.10               h27cfd23_0  
libuuid                   1.0.3                h1bed415_2  
libwebp-base              1.2.0                h27cfd23_0  
libxcb                    1.14                 h7b6447c_0  
libxkbcommon              1.0.3                he3ba5ed_0    conda-forge
libxml2                   2.9.10               h72842e0_4    conda-forge
llvm-openmp               11.1.0               h4bd325d_1    conda-forge
llvmlite                  0.36.0           py36h612dafd_4  
lz4-c                     1.9.3                h2531618_0  
magma                     2.5.4                h5da55e3_2    conda-forge
markdown                  3.3.4            py36h06a4308_0  
markupsafe                2.0.0                    pypi_0    pypi
matplotlib-base           3.3.4            py36h62a2d02_0  
mkl                       2020.4             h726a3e6_304    conda-forge
multilabel-attr-fashion   0.1.4                     dev_0    <develop>
mysql-common              8.0.22               ha770c72_1    conda-forge
mysql-libs                8.0.22               h1fd7589_1    conda-forge
nccl                      2.9.6.1              h1a5f58c_0    conda-forge
ncurses                   6.2                  he6710b0_1  
nettle                    3.7.2                hbbd107a_1  
networkx                  2.5.1              pyhd3eb1b0_0  
ninja                     1.10.2               hff7bd54_1  
nspr                      4.30                 h9c3ff4c_0    conda-forge
nss                       3.64                 hb5efdd6_0    conda-forge
numba                     0.53.1           py36ha9443f7_0  
numpy                     1.19.5           py36h2aa4a07_1    conda-forge
olefile                   0.46                     py36_0  
opencv                    4.5.2            py36h5fab9bb_0    conda-forge
openh264                  2.1.1                h780b84a_0    conda-forge
openssl                   1.1.1k               h27cfd23_0  
pandas                    1.1.5            py36ha9443f7_0  
pcre                      8.44                 he6710b0_0  
pillow                    8.2.0            py36he98fc37_0  
pip                       21.1.1             pyhd8ed1ab_0    conda-forge
pixman                    0.40.0               h7b6447c_0  
protobuf                  3.15.8           py36hc4f0c31_0    conda-forge
py-opencv                 4.5.2            py36hcb3619a_0    conda-forge
pycparser                 2.20                       py_2  
pyparsing                 2.4.7              pyhd3eb1b0_0  
python                    3.6.13               hdb3f193_0  
python-dateutil           2.8.1              pyhd3eb1b0_0  
python_abi                3.6                     1_cp36m    conda-forge
pytorch                   1.7.1           cuda102py36h8620ce9_1    conda-forge
pytorch-gpu               1.7.1           cuda102py36hf05f184_1    conda-forge
pytz                      2021.1             pyhd3eb1b0_0  
pywavelets                1.1.1            py36h7b6447c_2  
pyyaml                    5.4.1            py36h27cfd23_1  
qt                        5.12.9               h9d6b050_2    conda-forge
readline                  8.1                  h27cfd23_0  
scikit-image              0.17.2           py36hdf5156a_0  
scipy                     1.5.3            py36h976291a_0    conda-forge
setuptools                52.0.0           py36h06a4308_0  
shis                      0.1                      pypi_0    pypi
six                       1.16.0             pyh6c4a22f_0    conda-forge
sqlite                    3.35.5               h74cdb3f_0    conda-forge
tbb                       2020.3               hfd86e86_0  
tensorboard               1.14.0           py36hf484d3e_0  
tensorflow                1.14.0               hc3e5e64_0    conda-forge
tensorflow-base           1.14.0           py36hc3e5e64_0    conda-forge
tensorflow-estimator      1.14.0                     py_0  
tensorflow-gpu            1.14.0               h0d30ee6_0  
termcolor                 1.1.0                    py36_1  
tifffile                  2020.10.1        py36hdd07704_2  
tk                        8.6.10               hbc83047_0  
toolz                     0.11.1             pyhd3eb1b0_0  
torchvision               0.8.2           py36cuda102h29a7989_1_cuda    conda-forge
tornado                   6.1              py36h27cfd23_0  
tqdm                      4.60.0             pyhd8ed1ab_0    conda-forge
typing_extensions         3.7.4.3            pyha847dfd_0  
werkzeug                  1.0.1              pyhd3eb1b0_0  
wheel                     0.36.2             pyhd3eb1b0_0  
wrapt                     1.12.1           py36h7b6447c_1  
x264                      1!161.3030           h7f98852_0    conda-forge
xz                        5.2.5                h7b6447c_0  
yaml                      0.2.5                h7b6447c_0  
zipp                      3.4.1              pyhd3eb1b0_0  
zlib                      1.2.11               h7b6447c_3  
zstd                      1.4.5                h9ceee32_0  

Details about conda and system ( conda info ):
$ conda info
     active environment : tftorch36
    active env location : /opt/conda/envs/tftorch36
            shell level : 2
       user config file : /home/nikhilv/.condarc
 populated config files : /home/nikhilv/.condarc
          conda version : 4.9.2
    conda-build version : not installed
         python version : 3.8.5.final.0
       virtual packages : __cuda=11.2=0
                          __glibc=2.27=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /opt/conda  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /opt/conda/pkgs
                          /home/nikhilv/.conda/pkgs
       envs directories : /opt/conda/envs
                          /home/nikhilv/.conda/envs
               platform : linux-64
             user-agent : conda/4.9.2 requests/2.24.0 CPython/3.8.5 Linux/4.15.0-142-generic ubuntu/18.04.5 glibc/2.27
                UID:GID : 1001:1001
             netrc file : None
           offline mode : False
@Tobias-Fischer
Copy link
Contributor

Hi @nikhilweee - are you still interested in this? There are several recipes that you could follow for CUDA support, if you would like to open a PR. See e.g. https://github.com/conda-forge/detectron2-feedstock/blob/main/recipe/meta.yaml

@nikhilweee
Copy link
Author

Hi @Tobias-Fischer, thank you for your response. Unfortunately I don't think I'll be able to work on a PR at this time, but if anyone else is interested they should feel free to pursue this.

@kuepe-sl kuepe-sl mentioned this issue Dec 13, 2023
5 tasks
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

Successfully merging a pull request may close this issue.

2 participants