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

Better Compatibility for __CUDA_ARCH__ for RTX GPUs #62

Open
BICHENG opened this issue Jul 15, 2019 · 2 comments
Open

Better Compatibility for __CUDA_ARCH__ for RTX GPUs #62

BICHENG opened this issue Jul 15, 2019 · 2 comments

Comments

@BICHENG
Copy link

BICHENG commented Jul 15, 2019

at rasterize_cuda_kernel.cu
you need to change
#if CUDA_ARCH < 600 and defined(__CUDA_ARCH__)
//blablabla
#endif
to

#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 600
#else
static __inline__ __device__ double atomicAdd(double* address, double val) {
    unsigned long long int* address_as_ull = (unsigned long long int*)address;
    unsigned long long int old = *address_as_ull, assumed;
    do {
        assumed = old;
        old = atomicCAS(address_as_ull, assumed,
                __double_as_longlong(val + __longlong_as_double(assumed)));
    // Note: uses integer comparison to avoid hang in case of NaN (since NaN != NaN) } while (assumed != old);
    } while (assumed != old);
    return __longlong_as_double(old);
}
#endif

it will solve setup.py nvcc call errors somehow

@BICHENG BICHENG changed the title Better Compatibility for __CUDA_ARCH__ identification Better Compatibility for __CUDA_ARCH__ for RTX GPUs Oct 18, 2019
@b4824583
Copy link

Thanks God
You're a lifesaver

My RTX 2080 can work now

@pfvaldez
Copy link

pfvaldez commented May 4, 2021

Hello I applied the changes to rasterize_cuda_kernel.cu

Machine specs:
RTX-30
cuda 11.2

pip env:
torch==1.4.0
torchvision==0.5.0

But I still get this error:

    /usr/local/cuda-11.2/bin/nvcc -I/home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include -I/home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/TH -I/home/pfvaldez/Development/neural_renderer/venv/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda-11.2/include -I/home/pfvaldez/Development/neural_renderer/venv/include -I/home/pfvaldez/anaconda3/include/python3.8 -c neural_renderer/cuda/load_textures_cuda_kernel.cu -o build/temp.linux-x86_64-3.8/neural_renderer/cuda/load_textures_cuda_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=load_textures -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_61,code=sm_61 -gencode=arch=compute_30,code=sm_30 -gencode=arch=compute_52,code=sm_52 -gencode=arch=compute_53,code=sm_53 -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_32,code=sm_32 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_62,code=sm_62 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_72,code=sm_72 -gencode=arch=compute_37,code=sm_37 -std=c++11
    nvcc fatal   : Unsupported gpu architecture 'compute_30'
    error: command '/usr/local/cuda-11.2/bin/nvcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/pfvaldez/Development/neural_renderer/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-283h03zo/neural-renderer-pytorch_ddcda0b2d3c14319913d122830fb84d7/setup.py'"'"'; __file__='"'"'/tmp/pip-install-283h03zo/neural-renderer-pytorch_ddcda0b2d3c14319913d122830fb84d7/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-xbduzdh2/install-record.txt --single-version-externally-managed --compile --install-headers /home/pfvaldez/Development/neural_renderer/venv/include/site/python3.8/neural-renderer-pytorch Check the logs for full command output.

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

3 participants