grendizerufo / nvidia-texture-tools

Automatically exported from code.google.com/p/nvidia-texture-tools
Other
0 stars 0 forks source link

CUDA errors #196

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have noticed some strange behavior of nvtt compessor when using CUDA and 
threading.
I have a wrapper class for batch file compression (attached), when compression 
is called from main thread everything fine, but UI frozen. So I decided to run 
compressing in separate thread. In Qt framework I used QtConcurrent::run for 
this, but get many CUDA errors. Most interesting that 
compressor.process(inputOptions, compressionOptions, outputOptions);
returns true despite of errors.

Disabling GPU acceleration by
compressor.enableCudaAcceleration(false);
removes any errors.

void MainWindow::on_selectFolderButton_clicked()
{
    ui->progressBar->setValue( 0 );
    QString dirPath = QFileDialog::getExistingDirectory( this, tr("Open directory"), "" );
    if ( dirPath .isNull() )
        return;

    QDir dir( dirPath );
    QFutureWatcher<void>* w = new QFutureWatcher<void>();
    connect( w, SIGNAL(finished()), this, SLOT(convertFinished()) );
    connect( w, SIGNAL(finished()), w, SLOT( deleteLater() ) );

    mConverter.setMaxSize( ui->maxSizeEdit->text().toInt() );
//  mConverter.compressFolder( dir ); // <------------ Okay
    QFuture<void> f = QtConcurrent::run(&mConverter, &TextureConverter::compressFolder, dir ); // <---- CUDA error
    w->setFuture( f );
}

Original issue reported on code.google.com by jeka.vla...@gmail.com on 6 Aug 2013 at 1:47

Attachments:

GoogleCodeExporter commented 9 years ago
Honestly, it's been a while since I've done any CUDA work and I believe the 
threading model of the runtime API may have changed since the last time I 
looked.

If you are willing to dig deeper and make this work I'd be happy to integrate 
your changes, but currently I don't have much time to work on CUDA features.

Original comment by cast...@gmail.com on 9 Sep 2013 at 2:02