You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this was a chore, but I got it working. compiled, at least.
first, setup some environment variables.
specifically, you need CUDA_ARCH to exist. you'll need to look up exactly what the value should be for your video card. my Nvidia 3050 is 'sm_86'
Some others that you might need are TCNN_CUDA_ARCHITECTURES which depends on your card again, mine is '86'
and also CUDA_HOME which should be the path to your cuda install
Start with downloading the repo, then navigate to torch-ngp\gridencoder and run python setup.py install
This will almost certainly fail. you'll probably get a bunch of errors about atomicAdd.
we needed to do this to generate a build.ninja file. it would be somewhere like \torch-ngp\gridencoder\build\temp.win-amd64-cpython-312\Release
edit the file.
you need to double check all the paths you see in here. mine failed to have correct paths for cuda and visual studio. there is also a reference to std=c++. make sure that you change this to a version you have installed. I used c++17
save the file
now open gridencoder.cu
near the top, around like 20 you'll see a definition for atomicadd
now, depending on the errors you get you'll need to be creative here, but basically we need to write a function to convert what is getting put into atomic add into what cuda 12.5 is expecting.
My errors looked like this: function "atomicAdd(int *, int)" does not match because argument #1 does not match parameter static __inline __declspec(__device__) int atomicAdd(int *address, int val)
this was a chore, but I got it working. compiled, at least.
first, setup some environment variables.
specifically, you need
CUDA_ARCH
to exist. you'll need to look up exactly what the value should be for your video card. my Nvidia 3050 is 'sm_86'Some others that you might need are
TCNN_CUDA_ARCHITECTURES
which depends on your card again, mine is '86'and also
CUDA_HOME
which should be the path to your cuda installStart with downloading the repo, then navigate to torch-ngp\gridencoder and run python setup.py install
This will almost certainly fail. you'll probably get a bunch of errors about atomicAdd.
we needed to do this to generate a build.ninja file. it would be somewhere like \torch-ngp\gridencoder\build\temp.win-amd64-cpython-312\Release
edit the file.
you need to double check all the paths you see in here. mine failed to have correct paths for cuda and visual studio. there is also a reference to std=c++. make sure that you change this to a version you have installed. I used c++17
save the file
now open gridencoder.cu
near the top, around like 20 you'll see a definition for atomicadd
now, depending on the errors you get you'll need to be creative here, but basically we need to write a function to convert what is getting put into atomic add into what cuda 12.5 is expecting.
My errors looked like this:
function "atomicAdd(int *, int)" does not match because argument #1 does not match parameter
static __inline __declspec(__device__) int atomicAdd(int *address, int val)
so my functions ended up looking like this
__device__ inline at::Half atomicAdd(at::Half *address, at::Half val) {
return atomicAdd(address, val);
}
template <typename T>
__device__ inline T atomicAdd(T *address, T val) {
return atomicAdd(address, val);
}
now open a cmd window next to the build.ninja file and run ninja -f build.ninja
and then it compiled. yay
The text was updated successfully, but these errors were encountered: