Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[HOWTO] Folding@Home GPU2 NVidia client with WINE
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
rada
Apprentice
Apprentice


Joined: 21 Oct 2005
Posts: 202
Location: Ottawa, Canada

PostPosted: Tue Jul 29, 2008 7:07 pm    Post subject: [HOWTO] Folding@Home GPU2 NVidia client with WINE Reply with quote

Thanks to http://foldingforum.org/viewtopic.php?f=43&t=3744:

HowTo for Gentoo Linux x86-64 users: (maybe useful for others)

1. Compile and install CUDA and the thunked cudart.dll

1.1 Download the CUDA 32-bit toolkit from http://www.nvidia.com/object/thankyou_linux.html?url=/compute/cuda/2.0-Beta2/linux/toolkit/NVIDIA_CUDA_Toolkit_2.0beta2_Ubuntu7.10_x86.run. Install it by making it executable then running it as root:
Code:
chmod +x NVIDIA_CUDA_Toolkit_2.0beta2_Ubuntu7.10_x86.run
./NVIDIA_CUDA_Toolkit_2.0beta2_Ubuntu7.10_x86.run

Make sure to install in the default directory.

1.2 Make a new directory and put the following source files in it:
cudart.c
Code:
#include <windows.h>
#include "cudart.h"
#include "wine/debug.h"

#if 0
#define __CUDA_INTERNAL_COMPILATION__
#include "crt/host_runtime.h"
#endif

#ifdef USE_SLEEPWAIT

#include <time.h>

static struct timespec sleepTime = { 0, USE_SLEEPWAIT };

#endif  /* USE_SLEEPWAIT */

WINE_DEFAULT_DEBUG_CHANNEL(cuda);

#define QUEUE_MAX       20
#define HALF_QUEUE_MAX  ((QUEUE_MAX)/2)

static unsigned int numQueued = 0;
static BOOL eventInitialized = FALSE;
static cudaEvent_t event;

static const char* cudaErrorString[] = {
    "cudaSuccess",
    "cudaErrorMissingConfiguration",
    "cudaErrorMemoryAllocation",
    "cudaErrorInitializationError",
    "cudaErrorLaunchFailure",
    "cudaErrorPriorLaunchFailure",
    "cudaErrorLaunchTimeout",
    "cudaErrorLaunchOutOfResources",
    "cudaErrorInvalidDeviceFunction",
    "cudaErrorInvalidConfiguration",
    "cudaErrorInvalidDevice",
    "cudaErrorInvalidValue",
    "cudaErrorInvalidPitchValue",
    "cudaErrorInvalidSymbol",
    "cudaErrorMapBufferObjectFailed",
    "cudaErrorUnmapBufferObjectFailed",
    "cudaErrorInvalidHostPointer",
    "cudaErrorInvalidDevicePointer",
    "cudaErrorInvalidTexture",
    "cudaErrorInvalidTextureBinding",
    "cudaErrorInvalidChannelDescriptor",
    "cudaErrorInvalidMemcpyDirection",
    "cudaErrorAddressOfConstant",
    "cudaErrorTextureFetchFailed",
    "cudaErrorTextureNotBound",
    "cudaErrorSynchronizationError",
    "cudaErrorInvalidFilterSetting",
    "cudaErrorInvalidNormSetting",
    "cudaErrorMixedDeviceExecution",
    "cudaErrorCudartUnloading",
    "cudaErrorUnknown",
    "cudaErrorNotYetImplemented",
    "cudaErrorMemoryValueTooLarge",
    "cudaErrorInvalidResourceHandle",
    "cudaErrorNotReady"
};

static const char* debug_cudaError(cudaError_t err) {
    if (cudaErrorStartupFailure == err) {
        return "cudaErrorStartupFailure";
    }

    if (cudaErrorApiFailureBase == err) {
        return "cudaErrorApiFailureBase";
    }

    if (err >= 0 && err < sizeof(cudaErrorString)/sizeof(cudaErrorString[0])) {
        return cudaErrorString[err];
    }

    WINE_TRACE("unknown error %d\n", err);
    return "unknown CUDA error";
}

BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
{
    if (DLL_PROCESS_DETACH == fdwReason)
    {
        /* Cleanup */
        if (eventInitialized) {
            WINE_TRACE("releasing event %d\n", event);

            cudaError_t err = cudaEventDestroy(event);

            if (err) {
                WINE_TRACE("cudaEventDestroy: %s\n", debug_cudaError(err));
            }
        }
    }
}

cudaError_t WINAPI wine_cudaConfigureCall(dim3 gridDim, dim3 blockDim, size_t sharedMem,
                                          cudaStream_t stream) {
    WINE_TRACE("(%d %d %d) (%d %d %d) %d %d\n", gridDim.x, gridDim.y, gridDim.z, blockDim.x,
               blockDim.y, blockDim.z, sharedMem, stream);

    cudaError_t err = cudaConfigureCall(gridDim, blockDim, sharedMem, stream);

    if (err) {
        WINE_TRACE("return %s\n", debug_cudaError(err));
    }

    return err;
}

cudaError_t WINAPI wine_cudaGetDeviceProperties(struct cudaDeviceProp *prop, int device) {
    WINE_TRACE("\n");
    return cudaGetDeviceProperties(prop, device);
}

const char* WINAPI wine_cudaGetErrorString(cudaError_t error) {
    WINE_TRACE("\n");
    return cudaGetErrorString(error);
}

cudaError_t WINAPI wine_cudaGetLastError() {
    WINE_TRACE("\n");

    cudaError_t err = cudaGetLastError();

    WINE_TRACE("return %s\n", debug_cudaError(err));

    return err;
}

cudaError_t WINAPI wine_cudaLaunch(const char *symbol) {
    WINE_TRACE("%p\n", symbol);

    if (QUEUE_MAX == numQueued) {
        cudaError_t evtErr;

        if (WINE_TRACE_ON(cuda)) {
            /* print out if event was recorded or not */
            WINE_TRACE("check event recorded %s\n", debug_cudaError(cudaEventQuery(event)));
        }

        /* wait for event */
#ifdef USE_SLEEPWAIT
        unsigned int sleepCount = 0;

        while (cudaEventQuery(event) != cudaSuccess) {
            nanosleep(&sleepTime, NULL);
            sleepCount++;
        }

        WINE_TRACE("slept %u times\n", sleepCount);
#else
        evtErr = cudaEventSynchronize(event);

        if (evtErr) {
            WINE_ERR("cudaEventSynchronize: %s\n", debug_cudaError(evtErr));
        }
#endif

        WINE_TRACE("event recorded, continuing\n");

        /* record a new event and subtract HALF_QUEUE_MAX from numQueued */
        numQueued = HALF_QUEUE_MAX;
        evtErr = cudaEventRecord(event, 0);

        if (evtErr) {
            WINE_ERR("cudaEventRecord: %s\n", debug_cudaError(evtErr));
        }
    }

    cudaError_t err = cudaLaunch(symbol);

    if (!eventInitialized) {
        /* Create an event on the first cudaLaunch call.  This is done here so the calling program
         * has a chance to select the GPU device with cudaSetDevice if desired. */
        cudaError_t evtErr = cudaEventCreate(&event);

        if (evtErr) {
            WINE_ERR("cudaEventCreate: %s\n", debug_cudaError(evtErr));
        }

        /* cudaEventCreate can return errors from previous asynchronous calls, so an error here does
         * not necessarily mean the event wasn't created.  Assume it was created for now. */
        eventInitialized = TRUE;
        WINE_TRACE("created event %d\n", event);
    }

    /* record an event at HALF_QUEUE_MAX */
    if (HALF_QUEUE_MAX == ++numQueued) {
        cudaError_t evtErr = cudaEventRecord(event, 0);  /* Assuming everything using stream 0 */

        if (evtErr) {
            WINE_ERR("cudaEventRecord: %s\n", debug_cudaError(evtErr));
        }
    }

    if (err) {
        WINE_TRACE("return %s\n", debug_cudaError(err));
    }

    return err;
}

cudaError_t WINAPI wine_cudaMemcpy(void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) {
    WINE_TRACE("%p, %p, %d, %d\n", dst, src, count, kind);

    cudaError_t err = cudaMemcpy(dst, src, count, kind);

    if (err) {
        WINE_TRACE("return %s\n", debug_cudaError(err));
    }

    return err;
}

cudaError_t WINAPI wine_cudaMemcpyFromSymbol(void *dst, const char *symbol, size_t count, size_t offset,
                                             enum cudaMemcpyKind kind) {
    WINE_TRACE("\n");
    return cudaMemcpyFromSymbol(dst, symbol, count, offset, kind);
}

cudaError_t WINAPI wine_cudaMemcpyToSymbol(const char *symbol, const void *src, size_t count, size_t offset,
                                           enum cudaMemcpyKind kind) {
    WINE_TRACE("\n");
    return cudaMemcpyToSymbol(symbol, src, count, offset, kind);
}

void** WINAPI wine_cudaRegisterFatBinary(void *fatCubin) {
    WINE_TRACE("\n");
    return __cudaRegisterFatBinary(fatCubin);
}

void WINAPI wine_cudaRegisterFunction(void **fatCubinHandle, const char *hostFun, char *deviceFun,
                                      const char *deviceName, int thread_limit, uint3 *tid,
                                      uint3 *bid, dim3 *bDim, dim3 *gDim, int *wSize) {
    WINE_TRACE("\n");
    __cudaRegisterFunction(fatCubinHandle, hostFun, deviceFun, deviceName, thread_limit, tid, bid,
                           bDim, gDim, wSize);
}

void WINAPI wine_cudaRegisterVar(void **fatCubinHandle, char *hostVar, char *deviceAddress,
                                 const char  *deviceName, int ext, int size, int constant,
                                 int global) {
    WINE_TRACE("\n");
    __cudaRegisterVar(fatCubinHandle, hostVar, deviceAddress, deviceName, ext, size, constant, global);
}

void WINAPI wine_cudaRegisterShared(void **fatCubinHandle, void **devicePtr) {
    WINE_TRACE("\n");
    __cudaRegisterShared(fatCubinHandle, devicePtr);
}

void WINAPI wine_cudaRegisterSharedVar(void **fatCubinHandle, void **devicePtr, size_t size,
                                    size_t alignment, int storage) {
    WINE_TRACE("\n");
    __cudaRegisterSharedVar(fatCubinHandle, devicePtr, size, alignment, storage);
}

cudaError_t WINAPI wine_cudaSetDevice(int device) {
    WINE_TRACE("\n");
    return cudaSetDevice(device);
}

void WINAPI wine_cudaUnregisterFatBinary(void **fatCubinHandle) {
    WINE_TRACE("\n");
    __cudaUnregisterFatBinary(fatCubinHandle);
}

cudaError_t WINAPI wine_cudaFree(void *devPtr) {
    WINE_TRACE("\n");
    return cudaFree(devPtr);
}

cudaError_t WINAPI wine_cudaMalloc(void **devPtr, size_t size) {
    WINE_TRACE("\n");
    return cudaMalloc(devPtr, size);
}


cudart.dll.spec
Code:
    @ stdcall __cudaRegisterFatBinary(ptr) wine_cudaRegisterFatBinary
    @ stdcall __cudaRegisterFunction(ptr ptr ptr ptr long ptr ptr ptr ptr ptr) wine_cudaRegisterFunction
    @ stdcall __cudaRegisterVar(ptr ptr ptr ptr long long long long) wine_cudaRegisterVar
    @ stdcall __cudaRegisterShared(ptr ptr) wine_cudaRegisterShared
    @ stdcall __cudaRegisterSharedVar(ptr ptr long long long) wine_cudaRegisterSharedVar
    @ stdcall __cudaUnregisterFatBinary(ptr) wine_cudaUnregisterFatBinary
    @ stub cudaBindTexture
    @ stub cudaBindTextureToArray
    @ stub cudaChooseDevice
    @ stdcall cudaConfigureCall(ptr ptr long long) wine_cudaConfigureCall
    @ stub cudaCreateChannelDesc
    @ stub cudaD3D9Begin
    @ stub cudaD3D9End
    @ stub cudaD3D9GetDevice
    @ stub cudaD3D9GetDirect3DDevice
    @ stub cudaD3D9MapResources
    @ stub cudaD3D9MapVertexBuffer
    @ stub cudaD3D9RegisterResource
    @ stub cudaD3D9RegisterVertexBuffer
    @ stub cudaD3D9ResourceGetMappedPitch
    @ stub cudaD3D9ResourceGetMappedPointer
    @ stub cudaD3D9ResourceGetMappedSize
    @ stub cudaD3D9ResourceGetSurfaceDimensions
    @ stub cudaD3D9ResourceSetMapFlags
    @ stub cudaD3D9SetDirect3DDevice
    @ stub cudaD3D9UnmapResources
    @ stub cudaD3D9UnmapVertexBuffer
    @ stub cudaD3D9UnregisterResource
    @ stub cudaD3D9UnregisterVertexBuffer
    @ stub cudaEventCreate
    @ stub cudaEventDestroy
    @ stub cudaEventElapsedTime
    @ stub cudaEventQuery
    @ stub cudaEventRecord
    @ stub cudaEventSynchronize
    @ stdcall cudaFree(ptr) wine_cudaFree
    @ stub cudaFreeArray

    @ stub cudaFreeHost
    @ stub cudaGetChannelDesc
    @ stub cudaGetDevice
    @ stub cudaGetDeviceCount
    @ stdcall cudaGetDeviceProperties(ptr long) wine_cudaGetDeviceProperties
    @ stdcall cudaGetErrorString(long) wine_cudaGetErrorString
    @ stdcall cudaGetLastError() wine_cudaGetLastError
    @ stub cudaGetSymbolAddress
    @ stub cudaGetSymbolSize
    @ stub cudaGetTextureAlignmentOffset
    @ stub cudaGetTextureReference
    @ stub cudaGLMapBufferObject
    @ stub cudaGLRegisterBufferObject
    @ stub cudaGLSetGLDevice
    @ stub cudaGLUnmapBufferObject
    @ stub cudaGLUnregisterBufferObject
    @ stdcall cudaLaunch(ptr) wine_cudaLaunch
    @ stdcall cudaMalloc(ptr long) wine_cudaMalloc
    @ stub cudaMalloc3D
    @ stub cudaMalloc3DArray
    @ stub cudaMallocArray
    @ stub cudaMallocHost
    @ stub cudaMallocPitch
    @ stdcall cudaMemcpy(ptr ptr long long) wine_cudaMemcpy
    @ stub cudaMemcpy2D
    @ stub cudaMemcpy2DArrayToArray
    @ stub cudaMemcpy2DFromArray
    @ stub cudaMemcpy2DToArray
    @ stub cudaMemcpy3D
    @ stub cudaMemcpyArrayToArray
    @ stub cudaMemcpyFromArray
    @ stdcall cudaMemcpyFromSymbol(ptr ptr long long long) wine_cudaMemcpyFromSymbol
    @ stub cudaMemcpyToArray
    @ stdcall cudaMemcpyToSymbol(ptr ptr long long long) wine_cudaMemcpyToSymbol
    @ stub cudaMemset
    @ stub cudaMemset2D
    @ stub cudaMemset3D
    @ stub cudaRegisterFatBinary
    @ stdcall cudaSetDevice(long) wine_cudaSetDevice
    @ stub cudaSetupArgument
    @ stub cudaStreamCreate
    @ stub cudaStreamDestroy
    @ stub cudaStreamQuery
    @ stub cudaStreamSynchronize
    @ stub cudaThreadExit
    @ stub cudaThreadSynchronize
    @ stub cudaUnbindTexture


cudart.h
Code:
    #include "cuda_runtime_api.h"

    void** __cudaRegisterFatBinary(void *fatCubin);
    void __cudaUnregisterFatBinary(void **fatCubinHandle);

    void __cudaRegisterFunction(void **fatCubinHandle, const char *hostFun, char *deviceFun,
                                const char *deviceName, int thread_limit, uint3 *tid,
                                uint3 *bid, dim3 *bDim, dim3 *gDim, int *wSize);

    void __cudaRegisterVar(void **fatCubinHandle, char *hostVar, char *deviceAddress,
                           const char  *deviceName, int ext, int size, int constant,
                           int global);

    void __cudaRegisterShared(void **fatCubinHandle, void **devicePtr);

    void __cudaRegisterSharedVar(void **fatCubinHandle, void **devicePtr, size_t size,
                                 size_t alignment, int storage);


Makefile
Code:
### Generated by Winemaker


SRCDIR                = .
SUBDIRS               =
DLLS                  = cudart.dll
EXES                  =



### Common settings

CEXTRA                =
CXXEXTRA              =
RCEXTRA               =
INCLUDE_PATH          = -I/usr/local/cuda/include
DLL_PATH              =
LIBRARY_PATH          = -L/usr/local/cuda/lib
LIBRARIES             = -lcudart
DEFINES               = -DUSE_SLEEPWAIT=300000    # 300 usecs seems to give reasonable results


### cudart.dll sources and settings

cudart_dll_MODULE     = cudart.dll
cudart_dll_C_SRCS     = cudart.c
cudart_dll_CXX_SRCS   =
cudart_dll_RC_SRCS    =
cudart_dll_LDFLAGS    = -shared \
         $(cudart_dll_MODULE:%=%.spec)
cudart_dll_DLL_PATH   =
cudart_dll_DLLS       = odbc32 \
         ole32 \
         oleaut32 \
         winspool
cudart_dll_LIBRARY_PATH=
cudart_dll_LIBRARIES  = uuid

cudart_dll_OBJS       = $(cudart_dll_C_SRCS:.c=.o) \
         $(cudart_dll_CXX_SRCS:.cpp=.o) \
         $(cudart_dll_RC_SRCS:.rc=.res)



### Global source lists

C_SRCS                = $(cudart_dll_C_SRCS)
CXX_SRCS              = $(cudart_dll_CXX_SRCS)
RC_SRCS               = $(cudart_dll_RC_SRCS)


### Tools

CC = winegcc -m32
CXX = wineg++ -m32
RC = wrc


### Generic targets

all: $(SUBDIRS) $(DLLS:%=%.so) $(EXES:%=%.so)

### Build rules

.PHONY: all clean dummy

$(SUBDIRS): dummy
   @cd $@ && $(MAKE)

# Implicit rules

.SUFFIXES: .cpp .rc .res
DEFINCL = $(INCLUDE_PATH) $(DEFINES) $(OPTIONS)

.c.o:
   $(CC) -c $(CFLAGS) $(CEXTRA) $(DEFINCL) -o $@ $<

.cpp.o:
   $(CXX) -c $(CXXFLAGS) $(CXXEXTRA) $(DEFINCL) -o $@ $<

.cxx.o:
   $(CXX) -c $(CXXFLAGS) $(CXXEXTRA) $(DEFINCL) -o $@ $<

.rc.res:
   $(RC) $(RCFLAGS) $(RCEXTRA) $(DEFINCL) -fo$@ $<

# Rules for cleaning

CLEAN_FILES     = y.tab.c y.tab.h lex.yy.c core *.orig *.rej \
                  \\\#*\\\# *~ *% .\\\#*

clean:: $(SUBDIRS:%=%/__clean__) $(EXTRASUBDIRS:%=%/__clean__)
   $(RM) $(CLEAN_FILES) $(RC_SRCS:.rc=.res) $(C_SRCS:.c=.o) $(CXX_SRCS:.cpp=.o)
   $(RM) $(DLLS:%=%.so) $(EXES:%=%.so) $(EXES:%.exe=%)

$(SUBDIRS:%=%/__clean__): dummy
   cd `dirname $@` && $(MAKE) clean

$(EXTRASUBDIRS:%=%/__clean__): dummy
   -cd `dirname $@` && $(RM) $(CLEAN_FILES)

### Target specific build rules
DEFLIB = $(LIBRARY_PATH) $(LIBRARIES) $(DLL_PATH)

$(cudart_dll_MODULE).so: $(cudart_dll_OBJS)
   $(CC) $(cudart_dll_LDFLAGS) -o $@ $(cudart_dll_OBJS) $(cudart_dll_LIBRARY_PATH) $(DEFLIB) $(cudart_dll_DLLS:%=-l%) $(cudart_dll_LIBRARIES:%=-l%)


1.3 Go into the directory and run make:
Code:
make

You will likely get errors like:
Quote:
Makefile:68: *** missing separator. Stop.

The errors are due to the code tags in the forum. To fix this, change the spaces at the beginning of the line for a tab, on every line you get this error.

1.4 Rename the newly compiled cudart.dll.so to nvcuda.dll and copy it to 'drive_c/windows/system32'
Code:
cp -a cudart.dll.so ~/drive_c/windows/system32/nvcuda.dll


1.5 As root, copy the CUDA libraries to the lib32 folder:
Code:
cp -a /usr/local/cuda/lib/* /usr/lib32


2. Download and install the F@H GPU Client

2.1 Goto http://folding.stanford.edu/English/DownloadWinOther and get the XP console client. Unzip it to a folder.

2.2 Change into the directory you extracted the zip to and run
Code:
nice -n18 wine folding@home-Win32-GPU.exe -forcegpu nvidia_g80


The GPU client should now be running. Thanks to actong, andromeda and everyone else who contributed in the folding forums.

EDIT: Updated, no need to recompile wine.
EDIT: Clarified a bit


Last edited by rada on Wed Sep 03, 2008 4:13 pm; edited 4 times in total
Back to top
View user's profile Send private message
rada
Apprentice
Apprentice


Joined: 21 Oct 2005
Posts: 202
Location: Ottawa, Canada

PostPosted: Tue Jul 29, 2008 7:14 pm    Post subject: Reply with quote

For 32-bit users the tutorial is the exact same but there are two small modifications:

1. In the makefile, remove the two instances of -m32.

2. Instead of copying the cuda libraries to the lib32 folder, copy them to the lib folder:
Code:
cp -a /usr/local/cuda/lib/* /usr/lib
Back to top
View user's profile Send private message
rada
Apprentice
Apprentice


Joined: 21 Oct 2005
Posts: 202
Location: Ottawa, Canada

PostPosted: Mon Aug 04, 2008 6:59 pm    Post subject: Reply with quote

So has this been useful for anyone?
Back to top
View user's profile Send private message
rada
Apprentice
Apprentice


Joined: 21 Oct 2005
Posts: 202
Location: Ottawa, Canada

PostPosted: Sat Aug 16, 2008 6:27 pm    Post subject: Reply with quote

updated.
Back to top
View user's profile Send private message
myceliv
Apprentice
Apprentice


Joined: 29 Nov 2007
Posts: 178

PostPosted: Wed Sep 03, 2008 3:53 am    Post subject: Reply with quote

Thanks! This is very cool. Since cutting way back on gaming, 8800 has been sort of wasted. Now it is doing something more useful. Guess will keep it around a while longer. You could make it clear that only steps 1.1 and 1.5 require root. Tried to think of a way to do this completely as user, but couldn't work it out. Thanks again.
Back to top
View user's profile Send private message
rada
Apprentice
Apprentice


Joined: 21 Oct 2005
Posts: 202
Location: Ottawa, Canada

PostPosted: Wed Sep 03, 2008 4:14 pm    Post subject: Reply with quote

done. happy this was of help :)
Back to top
View user's profile Send private message
shadowknight
Tux's lil' helper
Tux's lil' helper


Joined: 03 Aug 2002
Posts: 142

PostPosted: Fri Jul 17, 2009 4:46 am    Post subject: Reply with quote

I can't believe this post isn't more popular.... You have my thanks. I know I'm a bit late in regards to the original post date, but the information was still useful and accurate. I hate the cpu clients, and until now didn't realize the GPU client would run in wine.... So again, a big thank you!
Back to top
View user's profile Send private message
Alanceil
n00b
n00b


Joined: 14 Aug 2007
Posts: 36
Location: Regensburg, Germany

PostPosted: Tue Sep 01, 2009 1:23 pm    Post subject: Reply with quote

Just a note for anyone else trying this out and using Nvidia GPUs:
If you get the dreaded UNSTABLE_MACHINE error, make sure to use =x11-drivers/nvidia-drivers-180.60 . Any newer version failed for me, using a GeForce GTX 275.

You might also want to enable Powermizer to underclock your graphics card - full speed caused around 90C GPU Temperature on my rig. Setting Powermizer to medium got it down to a much better 65C. For this you'll have to add a line to your /etc/X11/xorg.conf Device section:

Code:
Option   "RegistryDwords"   "PowerMizerEnable=0x1; PerfLevelSrc=0x2222; PowerMizerDefault=0x2; PowerMizerDefaultAC=0x2"

Source: http://tutanhamon.com.ua/technovodstvo/NVIDIA-UNIX-driver/

I found some other reports about a PowerMizerLevel=0x2 setting, this didn't work for me. You can check your current temperature and GPU frequency by running nvidia-settings (media-video/nvidia-settings).

Happy crunching,
Alan
Back to top
View user's profile Send private message
jimerickson
n00b
n00b


Joined: 19 Jul 2008
Posts: 11

PostPosted: Fri Sep 11, 2009 9:53 pm    Post subject: nvclock Reply with quote

if your card is getting that hot you may want to try nvclock to speed up your fan. just use:

nvclock -f -F 100

the -i switch will display everything you could want to know about your card. i am using a gtx8800 and its fan only runs at 60% by default and never seems to speed up unless i use nvclock. happy folding and best regards.
Back to top
View user's profile Send private message
Jagaer
n00b
n00b


Joined: 27 Feb 2004
Posts: 16
Location: Kingston, On, Canada

PostPosted: Fri Oct 23, 2009 4:46 pm    Post subject: Reply with quote

Working, thanks

Although there is a performance hit, to be expected running through wine, I guess.
Back to top
View user's profile Send private message
rada
Apprentice
Apprentice


Joined: 21 Oct 2005
Posts: 202
Location: Ottawa, Canada

PostPosted: Sat Oct 24, 2009 6:26 pm    Post subject: Reply with quote

which drivers do you have it working with?
Back to top
View user's profile Send private message
SandStar
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jan 2005
Posts: 77

PostPosted: Mon Nov 02, 2009 7:37 pm    Post subject: Reply with quote

rada wrote:
which drivers do you have it working with?


Drivers >180.06 don't work with folding
Back to top
View user's profile Send private message
SteveBallmersChair
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jul 2006
Posts: 84
Location: Being thrown around in Redmond

PostPosted: Tue Jun 08, 2010 2:21 pm    Post subject: Reply with quote

I managed to get this to work with just a few tweaks on amd64 on my new GTS250 with the current stable 195.36.24 drivers. Here's what I needed to change:

1. The most current version of CUDA is 3.0, which is not compatible with the wrappers used here, you will need to use CUDA 2.x. Unfortunately the posted link to the Ubuntu 7.04 CUDA 2.0 beta does not work any more. I managed to extract the address for the latest CUDA 2.x series for x86 from the nvidia-cuda-toolkit ebuild, and it is the following: http://www.nvidia.com/object/thankyou.html?url=/compute/cuda/2_3/toolkit/cudatoolkit_2.3_linux_32_rhel5.3.run

2. The Makefile bugs out on my system even after correcting the spaces to tabs. However, somebody has successfully compiled and posted the cudart.dll.so at http://www.hyperchronos.org/cudart.dll.so . Put this in place of the cudart.dll.so that you were supposed to compile with the Makefile and it works perfectly.

That's it!

NB: This guide has the niceness of the GPU client set at 18, which means it will run at a higher priority than the CPU client (default niceness of 19) if you haven't mucked with the core priority in the CPU client. If you have set the priority in the CPU client to "low" rather than "idle," the CPU client then runs with a niceness of 13 and will starve the GPU client of CPU cycles and kill GPU performance without adding much to CPU client performance. You will either want to start the GPU client with "nice -n12" instead of "-nice -n18" or reset the CPU client core priority to idle.
_________________
Unix is user friendly- it is just picky who its friends are.
Back to top
View user's profile Send private message
rada
Apprentice
Apprentice


Joined: 21 Oct 2005
Posts: 202
Location: Ottawa, Canada

PostPosted: Sat Jun 12, 2010 12:15 pm    Post subject: Reply with quote

Nice, I got it working in Linux again. Happy to see there's still interest in this topic. Thanks guys!

Unfortunately using a binary cudart.dll.so means that the wrapper is now not open source and if there are any bugs in the future, we'll hope whoever coded this one will patch it.
Back to top
View user's profile Send private message
while1
n00b
n00b


Joined: 18 Sep 2007
Posts: 17
Location: Lund, Sweden

PostPosted: Fri Nov 12, 2010 8:16 am    Post subject: Reply with quote

Anyone got this to work recently? I tried the above binary dll as suggested but it complains about a nvcuda.dll when trying to run it which isn't even mentioned here. I tried copying the cudart.dll to nvcuda.dll but it still doesn't work. I've got a GTX 470. Could this be the problem? Its a quite new card so maybe it isnt supported yet or something?

So sad to have a new, really fast gpu just wasting cycles. Any help would be greatly appreciated!
Back to top
View user's profile Send private message
while1
n00b
n00b


Joined: 18 Sep 2007
Posts: 17
Location: Lund, Sweden

PostPosted: Fri Dec 10, 2010 4:28 pm    Post subject: Reply with quote

Got this working on my GTX 470 btw.

If someone wants to know, you need to use the 32bit cuda toolkit, even if you're on amd64, so you get the right lib files for the client. I installed this manually using this script for ubuntu:

Code:
wget http://developer.download.nvidia.com/compute/cuda/3_0/toolkit/cudatoolkit_3.0_linux_32_ubuntu9.04.run


I ran this file and added the lib file dir bu creating /etc/ld.so.conf.d/cuda.conf and adding the dir to the file.

You can check if the dll's are linked properly using

Code:
ldd .wine/drive_c/windows/system32/cudart.dll
ldd .wine/drive_c/windows/system32/cufft.dll


where libcudart.so.3 and libcufft.so.3 should point to your manually installed lib files

I use "-forcegpu nvidia_fermi" instead of "nvidia_g80" as well. Should go for all newer nvidia cards that support fermi I guess.

Otherwise I think I followed the guide above...
Back to top
View user's profile Send private message
JanErik
Guru
Guru


Joined: 28 Oct 2002
Posts: 488
Location: Finland

PostPosted: Mon Feb 14, 2011 11:55 am    Post subject: Reply with quote

I followed this guide and it worked right away: http://linuxfah.info/index.php?title=Main_Page .
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum