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

pytorch1.6 cuda10.2 #5

Open
xiaozhangya opened this issue Nov 3, 2020 · 9 comments
Open

pytorch1.6 cuda10.2 #5

xiaozhangya opened this issue Nov 3, 2020 · 9 comments

Comments

@xiaozhangya
Copy link

pytorch1.6 cuda10.2
Can this be installed?

@Bendabir
Copy link

Bendabir commented Nov 3, 2020

Yes. I did it.
As the library is not on PyPI, you however need to build it yourself.

First install PyTorch 1.6.0 (best in a virtual env) and CUDA 10.2. Make the LD_LIBRARY_PATH point to /usr/local/cuda-10.2/lib64:/usr/local/cuda-10.2/extras/CUPTI/lib64 if not already done. If you have multiple versions of CUDA, do not forget to reset the env variable to its initial value to avoid issues with other projects that would need the default CUDA version installed on your machine. You could also add /usr/local/cuda-10.2/bin to the PATH variable but I'm not sure it's mandatory nor useful.

Then, from the mish-cuda repository, run python setup.py sdist bdist_wheel to build a Wheel file (located in ./dist). You can now either send the Wheel file to your own PyPI instance or just install it in one of your project (with pip install).

Hope this helps.

@thomasbrandon
Copy link
Owner

Just setting LD_LIBRARY_PATH will not properly select the CUDA toolkit if you have multiple versions. PyTorch uses the CUDA_HOME/CUDA_PATH environment variables to locate the CUDA headers and tools. Mismatches between the headers used in compilation and libraries will cause various issues that are hard to diagnose. So make sure those are properly set as well. Or better yet just don't mix CUDA versions.

Also you can just use pip install git+https://github.com/thomasbrandon/mish-cuda/ to install straight from git without needing to create wheels.

@STAROFWIND
Copy link

Hi, I use torch=1.6. I use "pip install git+https://github.com/thomasbrandon/mish-cuda/" to install mish-cuda. But it give me an error like:
ERROR: Command errored out with exit status 1:
command: /opt/anaconda3/envs/global/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"'; file='"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-y5wm_mdb

and
ERROR: Failed building wheel for mish-cuda
and
ERROR: Command errored out with exit status 1: /opt/anaconda3/envs/global/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"'; file='"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-ivpj2a53/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/ducnm/.local/include/python3.6m/mish-cuda Check the logs for full command output.

How can I solve them? Thanks !

@DrewdropLife
Copy link

@thomasbrandon
hi,when I try pip install git+https://github.com/thomasbrandon/mish-cuda/or python setup.py -v build , it failed.
my torch=1.6.0+cu101 torchvision=0.7.0+cu101
How to solve this problem?
2020-12-30 14-48-55 的屏幕截图

@thomasbrandon
Copy link
Owner

@changxinC This is related to an incompatability between your system C++ compiler and your CUDA version, It's apparently fixed in CUDA 10.1.168 (according to this). Otherwise upgrading/downgrading your system C++ compiler may fix. Exactly which is easiest will depend a on your distro.

@DrewdropLife
Copy link

@changxinC This is related to an incompatability between your system C++ compiler and your CUDA version, It's apparently fixed in CUDA 10.1.168 (according to this). Otherwise upgrading/downgrading your system C++ compiler may fix. Exactly which is easiest will depend a on your distro.

Oh thanks, my CUDA is 10.1.105, g++ is 7.6.5, maybe I need to update the CUDA version.

@wuy66
Copy link

wuy66 commented Jul 11, 2021

Hi, I use torch=1.6. I use "pip install git+https://github.com/thomasbrandon/mish-cuda/" to install mish-cuda. But it give me an error like:
ERROR: Command errored out with exit status 1:
command: /opt/anaconda3/envs/global/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"'; file='"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-y5wm_mdb

and
ERROR: Failed building wheel for mish-cuda
and
ERROR: Command errored out with exit status 1: /opt/anaconda3/envs/global/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"'; file='"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-ivpj2a53/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/ducnm/.local/include/python3.6m/mish-cuda Check the logs for full command output.

How can I solve them? Thanks !

I got the same problem. Not sure if you have resolved it? Thanks.

@DrewdropLife
Copy link

Hi, I use torch=1.6. I use "pip install git+https://github.com/thomasbrandon/mish-cuda/" to install mish-cuda. But it give me an error like:
ERROR: Command errored out with exit status 1:
command: /opt/anaconda3/envs/global/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"'; file='"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-y5wm_mdb
and
ERROR: Failed building wheel for mish-cuda
and
ERROR: Command errored out with exit status 1: /opt/anaconda3/envs/global/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"'; file='"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-ivpj2a53/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/ducnm/.local/include/python3.6m/mish-cuda Check the logs for full command output.
How can I solve them? Thanks !

I got the same problem. Not sure if you have resolved it? Thanks.

Instead of installing it, I just defined a class that implements mish by pytorch.

@wuy66
Copy link

wuy66 commented Jul 12, 2021

Hi, I use torch=1.6. I use "pip install git+https://github.com/thomasbrandon/mish-cuda/" to install mish-cuda. But it give me an error like:
ERROR: Command errored out with exit status 1:
command: /opt/anaconda3/envs/global/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"'; file='"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-y5wm_mdb
and
ERROR: Failed building wheel for mish-cuda
and
ERROR: Command errored out with exit status 1: /opt/anaconda3/envs/global/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"'; file='"'"'/tmp/pip-req-build-r_3sl_6g/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-ivpj2a53/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/ducnm/.local/include/python3.6m/mish-cuda Check the logs for full command output.
How can I solve them? Thanks !

I got the same problem. Not sure if you have resolved it? Thanks.

Instead of installing it, I just defined a class that implements mish by pytorch.

Thank you. I figured the same thing lol

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

6 participants